Hello @Eduardo_Mtz,
I successfully followed your instructions.
Then I check the sensor’s counts, I found out that the sensor will restart after a series of counting.
pls check the debug results,
7/11/2024, 8:08:04 AM[node: debug 1](http://192.168.0.1:1880/#)sensor_data : msg : Object
{ topic: "sensor_data", payload: object, time: 1720656468045, _msgid: "080839b70cfc56d1" }
7/11/2024, 8:08:04 AM[node: debug 3](http://192.168.0.1:1880/#)sensor_data : msg.payload : Object
{ nodeId: 2, addr: "00:13:a2:00:42:2a:34:e6", counts: 1, received: "2024-07-11 08:07:48" }
7/11/2024, 8:08:10 AM[node: debug 1](http://192.168.0.1:1880/#)sensor_data : msg : Object
{ topic: "sensor_data", payload: object, time: 1720656474306, _msgid: "cae76e6b3510cc35" }
7/11/2024, 8:08:10 AM[node: debug 3](http://192.168.0.1:1880/#)sensor_data : msg.payload : Object
{ nodeId: 2, addr: "00:13:a2:00:42:2a:34:e6", counts: 2, received: "2024-07-11 08:07:54" }
7/11/2024, 8:08:16 AM[node: debug 1](http://192.168.0.1:1880/#)sensor_data : msg : Object
{ topic: "sensor_data", payload: object, time: 1720656480562, _msgid: "9ce55bf7446eb09b" }
7/11/2024, 8:08:16 AM[node: debug 3](http://192.168.0.1:1880/#)sensor_data : msg.payload : Object
{ nodeId: 2, addr: "00:13:a2:00:42:2a:34:e6", counts: 3, received: "2024-07-11 08:08:00" }
7/11/2024, 8:08:21 AM[node: Format Data](http://192.168.0.1:1880/#)function : (error)
"Invalid payload structure received"
7/11/2024, 8:08:21 AM[node: debug 1](http://192.168.0.1:1880/#)sensor_mode : msg : Object
object
topic: "sensor_mode"
payload: object
mac: "00:13:a2:00:42:2a:34:e6"
type: 35
nodeId: 2
mode: "RUN"
lastHeard: 1720656485656
time: 1720656485657
_msgid: "0b1b1fcca76dc580"
7/11/2024, 8:08:22 AM[node: debug 1](http://192.168.0.1:1880/#)sensor_data : msg : Object
{ topic: "sensor_data", payload: object, time: 1720656485879, _msgid: "2275c708da906731" }
7/11/2024, 8:08:22 AM[node: debug 3](http://192.168.0.1:1880/#)sensor_data : msg.payload : Object
{ nodeId: 2, addr: "00:13:a2:00:42:2a:34:e6", counts: 0, received: "2024-07-11 08:08:05" }
I noticed at 7/11/2024, 8:08:21 AM[node: debug 1]
the transmitted data was different with “Run Mode”?
object
topic: “sensor_mode”
payload: object
mac: “00:13:a2:00:42:2a:34:e6”
type: 35
nodeId: 2
mode: “RUN”
lastHeard: 1720656485656
time: 1720656485657
_msgid: “0b1b1fcca76dc580”
Then the succeeding data count will reset to zero,
Object
{ nodeId: 2, addr: “00:13:a2:00:42:2a:34:e6”, counts: 0, received: “2024-07-11 08:08:05” }
Please see the screen shots of my Node-Red flow and config:
Please advise what should I do to fix this issue.
thank you,