HomeSmartMesh / IoT_Frameworks

Sensor Node STM8, Server C++ Raspberry pi, Webclient with d3js and websockets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mobile Node Light message sporadic

wassfila opened this issue · comments

The light is not every time captured by the RF receiver.
Note that the alive message is on the RTC IRQ while the light is when it returns to the main before calling the halt again.
Line 583: 2016-10-31 16:58:34 NodeId:6,Light: 1940
Line 589: 2016-10-31 16:59:01 NodeId:6,Light: 1940
Line 592: 2016-10-31 16:59:29 NodeId:6,Light: 1940
Line 672: 2016-10-31 17:09:59 NodeId:6,Light: 13
Line 864: 2016-10-31 17:35:36 NodeId:6,Light: 1
Line 1050: 2016-10-31 18:00:45 NodeId:6,Light: 1
Line 1293: 2016-10-31 18:33:42 NodeId:6,Light: 1
Line 1492: 2016-10-31 19:00:14 NodeId:6,Light: 1
Line 1618: 2016-10-31 19:17:10 NodeId:6,Light: 1949
Line 1621: 2016-10-31 19:17:38 NodeId:6,Light: 1947
Line 1627: 2016-10-31 19:18:05 NodeId:6,Light: 1948

2016-11-23 17:35:04 NodeId:6,is:Alive
2016-11-23 17:35:31 NodeId:6,is:Alive
2016-11-23 17:35:59 NodeId:6,is:Alive
2016-11-23 17:35:59 NodeId:6,Light: 151
2016-11-23 17:36:26 NodeId:6,is:Alive
2016-11-23 17:36:54 NodeId:6,is:Alive
2016-11-23 17:36:54 NodeId:6,Light: 150
2016-11-23 17:37:21 NodeId:6,is:Alive
2016-11-23 17:37:48 NodeId:6,is:Alive
2016-11-23 17:38:16 NodeId:6,is:Alive
2016-11-23 17:38:43 NodeId:6,is:Alive
2016-11-23 17:39:11 NodeId:6,is:Alive
2016-11-23 17:39:38 NodeId:6,is:Alive
2016-11-23 17:40:06 NodeId:6,is:Alive
2016-11-23 17:40:33 NodeId:6,is:Alive
2016-11-23 17:40:33 NodeId:6,Light: 151
2016-11-23 17:41:00 NodeId:6,is:Alive
2016-11-23 17:41:28 NodeId:6,is:Alive
2016-11-23 17:41:28 NodeId:6,Light: 150
2016-11-23 17:41:55 NodeId:6,is:Alive
2016-11-23 17:42:23 NodeId:6,is:Alive

The node is restarting after the IRQ

RTC IRQ
ws04_Node_LowSimple\pr02_AmbientLight
nRF_Config
Config updated with : 0x72 ; reread 0x72 ; STATUS: 0x2E : No Data Ready i; Data Sent i; No Max Ret i; Rx Fifo Empty ; Available TX Fifo Locations;
Clearing the status, New STATUS: 0x0E : No Data Ready i; No Data Sent i; No Max Ret i; Rx Fifo Empty ; Available TX Fifo Locations;

stays in the unhandled exception loop until the IRQ is called again, which explains why the main was not called, until probably a restart happened (potentially due to battery voltage drop).
2016-11-23_20h28_23

0eea79d works around it with a delay between RF transmissions

So as a summary, the unhandled exception could not be reproduced, and the delay between the two RF transmissions works around the problem

moved actions in main, no calls of i2c from interrupt