This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Movement Sensor active without connection

Hello,

so i managed to get the Movement sensor write data to the flash memory, but it only works, when the movement sensor is active and in connection currently.

But what we need is, the movement sensor should always stay active and write to flash.

My plan is, every change of the movement sensor i calculate the vector length of all 3 axes. I don't need exact measurement of all axes, just the amount of movement in the time when there is no connection.

As soon as the SensorTag is connected, the flash data will be available as characteristic and the flash should be reset to 0. After disconnect the SensorTag should restart writing to flash.

I added the switch for that in "static void SensorTag_taskFxn(UArg a0, UArg a1)" in SensorTag.c and it's enough if the write will be every second, just the movement sensor should stay on, instead off.

  • Hi Stephan,

    Right now I believe that the sensor is only set up to be active while in a connection. There are a couple layers of software in place here, primarily that the sensor is put into a low power state when the device is in sleep. You will need to modify this so that the sensor is always on. Remember that flash writes using the SNV call can only be done from ICALL aware tasks.
  • Currently the flash-calls are done inside SensorTag_Mov, and there in the SensorTagMov_init and SensorTagMov_processSensorEvent.
    The first is called on bootup, so before any connection, but the other will only be called when the SensorTag is connected and there are notifications on Movement-Sensor.
    Is there a simple way to set the MovementSensor to always on and run some function on an interval, to let it save my vector to flash
  • when the BT disconnects, the clock that calls the semaphore is stopped. Make sure the clock is not turned off when disconnect. This is either in Sensortag.c or in the movement file.