Sinapse-Energia / talking-fiber

Firmware for optic fiber activity detection. Based on M3 MCU
0 stars 1 forks source link

[API] MVP of L3_TF_STATUS_R #4

Closed ralcaide closed 5 years ago

ralcaide commented 5 years ago

To develop a MVP for the command L3_TF_STATUS_R that contains the ID of the device (last 6 digits of IMEI) , the current power measured by the photo-diode and the timestamp

The main program should perform the following actions each minute

ralcaide commented 5 years ago

Great, it will be tested asap

ralcaide commented 5 years ago

Testing.. Results:

  1. Power is always 0.00

At this moment we are receiving always 0.00 as measured power in photodiode. Is that normal? Are you receiving different values? Are you enabling this peripheral? By default is disabled

L3_TF_STATUS_R;072078;0.00;1534247820;

How have you tested up to now the photodiode

  1. Connection is not performed without SD. The SD will be not used at this version of the product, remove its use. Also of the SD is not available, the connection should be performed anyway
ralcaide commented 5 years ago

Testing:

  1. OK, now is sending different values when the Fiber is not connect.

  2. To be tested

Question: Now, the device is publishing each minute and consuming a lot of battery. How can we change this period in order to set 5 or 10 minutes and see if the battery have more longlife?

ghost commented 5 years ago

Before 802980be85c3f23f9de6174dc0f6d77c941e5e2e commit: Change line 578 in freertos.c from if (nowMinute != prevMinute) to if ((nowMinute != prevMinute) && (nowMinute%5 == 0))

After 802980be85c3f23f9de6174dc0f6d77c941e5e2e commit: Change line 300 in Application.cpp from CTimeEvent timer = new CTimeEvent("TFP", GetTimeStamp(), 1 , -1, 60, SendTF); to CTimeEvent timer = new CTimeEvent("TFP", GetTimeStamp(), 1 , -1, 60*5, SendTF);

ralcaide commented 5 years ago

Thanks

ghost commented 5 years ago

Now period of publishing L3_TF_STATUS_R could be adjusted using TFPER variable and DEFAULT_PERIOD definition (default value for TFPER).

ralcaide commented 5 years ago

Thanks, change the status to "To be tested" again

ralcaide commented 5 years ago

Tested OK