Achronite / energenie-ener314rt

Node module for RaspberryPi energenie ener314-rt board, used by node-red-contrib-energenie-ener314rt
MIT License
4 stars 2 forks source link

MIH0032 - PIR Sensor Trigger Causing Buffer Overflow #25

Closed hazzakins closed 1 year ago

hazzakins commented 1 year ago

.....Moving issue from Node-RED integration.....

After doing some further investigation and running the debug tool also, the issue of a buffer overflow output is being caused whenever one of my 2 PIR sensors triggers for Movement. This has been tested on both RPI 3B+ & RPI 4 and Node-RED & MQTT options.

Happy to provide any further logs if it helps but my C & node knowledge is non existent so hoping someone may be able to find what's causing the issue or point me in the right direction if OS Level tweaks may be needed.

root@xyz:~/ener314rt-debug-master# node test.js napi_energenie.Init() called test.js: Initialising board init_ener314(): initialising init_ener314(): mutex created & locked radio_init radio_ver=36 radio_standby _wait_ready *radio_standby _waitready test.js: Starting monitoring... tf napi_create_threadsafefunction done tf monitor thread started, timeout=10000tx_openThings_receive_thread starting

_wait_ready ***test.js: switching 1:1:true

Thanks in advance

Achronite commented 1 year ago

I've never had a buffer overflow reported before. I have a PIR and it has been working for years.

Can you please follow a 'cut down' versionof the instructions here, changing the dir as applicable, to enable debug? And then post the log file here. I believe this one might need FULLTRACE enabled.

hazzakins commented 1 year ago

Sure will get this going tonight after work.

It's weird as everything else works as expected but as soon as one of the PIRs trigger the entire process exits.

hazzakins commented 1 year ago

Unfortunately this doesn't seem to provide much more information.

`root@ubuntu:/opt/mqtt-energenie-ener314rt# node app.js napi_energenie.Init() called MQTT connected to broker mqtt://192.168.3.111 starting monitoring of FSK devices... MQTT subscribed to energenie/+/+/+/command napi_energenie.Init() called init_ener314(): initialising init_ener314(): mutex created & locked radio_init() radio_ver=36 radio_standby writereg 1 4 _wait_ready *writereg 2 8 writereg 5 0 writereg 6 0 writereg 7 108 writereg 8 122 writereg 9 225 writereg 25 65 writereg 3 26 writereg 4 11 writereg 45 0 writereg 46 0 writereg 55 128 writereg 56 0 radio_standby writereg 1 4 _waitready energenie: ENER314-RT initialised succesfully. energenie: received command: { cmd: 'monitor', enabled: true } tf napi_create_threadsafefunction done tf monitor thread started, timeout=10000 tx_openThings_receive_thread starting writereg 2 0 writereg 5 1 writereg 6 236 writereg 7 108 energenie: Monitoring thread started writereg 8 147 writereg 9 51 writereg 11 0 writereg 24 8 writereg 25 67 writereg 3 26 writereg 4 11 writereg 46 136 writereg 47 45 writereg 48 212 writereg 55 160 writereg 56 66 writereg 57 6 writereg 1 16 _wait_ready **@openThings_receive(): rec:0 {"name":"APPARENT_POWER","id":80,"type":1,"str":"","int":868,"float":868.000000} openThings_receive(): rec:1 {"name":"VOLTAGE","id":118,"type":2,"str":"","int":1133,"float":4.425781} openThings_receive(): rec:2 {"name":"CURRENT","id":105,"type":2,"str":"","int":792,"float":3.093750} openThings_devicePut() device added: 0:22865 openThings_receive: Returning: {"deviceId":22865,"mfrId":4,"productId":5,"timestamp":1673653004,"APPARENT_POWER":868,"VOLTAGE":4.425781,"CURRENT":3.093750} energenie: monitor received={"deviceId":22865,"mfrId":4,"productId":5,"timestamp":1673653004,"APPARENT_POWER":868,"VOLTAGE":4.425781,"CURRENT":3.093750} publishing energenie/5/22865/APPARENT_POWER/state: 868 publishing energenie/5/22865/VOLTAGE/state: 4.425781 publishing energenie/5/22865/CURRENT/state: 3.09375 ***@* buffer overflow detected ***: terminated ERROR: energenie process has terminated due to receipt of signal SIGABRT /opt/mqtt-energenie-ener314rt/app.js:254 clearInterval(intervalId); ^

ReferenceError: intervalId is not defined at ChildProcess. (/opt/mqtt-energenie-ener314rt/app.js:254:19) at ChildProcess.emit (node:events:513:28) at maybeClose (node:internal/child_process:1091:16) at ChildProcess._handle.onexit (node:internal/child_process:302:5)

Node.js v18.7.0 `

Achronite commented 1 year ago

Yes that is rather a dramatic crash! It does tell me one thing, that it likely crashed in the decode of this particular message which ties up with what you were saying about the PIR.

I'll need to know the payload message bytes to diagnose further. I have just finished work on my new hardware driver, so I have left a lot of payload debug in the code for you, this is now available on the development branch for you try. https://github.com/Achronite/energenie-ener314rt/tree/develop

hazzakins commented 1 year ago

Cheers, I've run the debug again with Dev version of the code and can find the output below.

Snip from Trigger **HRF_readfifo_burst_cbp() len=14, data:13:4:12:51:242:153:243:13:28:61:75:247:30:185:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0: @ buffer overflow detected ***: terminated ERROR: energenie process has terminated due to receipt of signal SIGABRT

Trace root@ubuntu:/opt/mqtt-energenie-ener314rt# node app.js napi_energenie.Init() called MQTT connected to broker mqtt://192.168.3.111 starting monitoring of FSK devices... MQTT subscribed to energenie/+/+/+/command napi_energenie.Init() called init_ener314(0): Initialising init_ener314(): mutex created & locked radio_init() HRF_spi_init(): Initialising gpio HRF_spi_init(): Hardware driver enabled on /dev/spidev0.1 Hardware SPI ret=0,spiMode=4 radio_ver=36 radio_standby HRF_writereg(1,4) _wait_ready(): initener314(): mutex unlocked energenie: ENER314-RT initialised succesfully. energenie: received command: { cmd: 'monitor', enabled: true } tf napi_create_threadsafefunction done tf monitor thread started, timeout=10000 tx_openThings_receive_thread starting HRF_writereg(2,0) HRF_writereg(5,1) HRF_writereg(6,236) HRF_writereg(7,108) energenie: Monitoring thread started HRF_writereg(8,147) HRF_writereg(9,51) HRF_writereg(11,0) HRF_writereg(24,8) HRF_writereg(25,67) HRF_writereg(3,26) HRF_writereg(4,11) HRF_writereg(46,136) HRF_writereg(47,45) HRF_writereg(48,212) HRF_writereg(55,162) HRF_writereg(56,66) HRF_writereg(57,4) radio_setmode() modulation changed to FSK mode changed to 16 HRF_writereg(1,16) _wait_ready(): P***HRF_readfifo_burst_cbp() len=23, data:22:4:5:201:140:251:143:178:68:142:237:96:33:204:204:255:74:184:103:196:44:95:158:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0: @openThings_receive(): rec:0 {"name":"APPARENT_POWER","id":80,"type":1,"str":"","int":848,"float":848.000000} openThings_receive(): rec:1 {"name":"VOLTAGE","id":118,"type":2,"str":"","int":1133,"float":4.425781} openThings_receive(): rec:2 {"name":"CURRENT","id":105,"type":2,"str":"","int":774,"float":3.023438} openThings_devicePut() device added: 0:22865 openThings_receive: Returning: {"deviceId":22865,"mfrId":4,"productId":5,"timestamp":1673702933,"APPARENT_POWER":848,"VOLTAGE":4.425781,"CURRENT":3.023438} energenie: monitor received={"deviceId":22865,"mfrId":4,"productId":5,"timestamp":1673702933,"APPARENT_POWER":848,"VOLTAGE":4.425781,"CURRENT":3.023438} Message from energenie process: { deviceId: 22865, mfrId: 4, productId: 5, timestamp: 1673702933, APPARENT_POWER: 848, VOLTAGE: 4.425781, CURRENT: 3.023438, cmd: 'monitor' } publishing energenie/5/22865/APPARENT_POWER/state: 848 publishing energenie/5/22865/VOLTAGE/state: 4.425781 publishing energenie/5/22865/CURRENT/state: 3.023438 *HRF_readfifo_burst_cbp() len=14, data:13:4:12:51:242:153:243:13:28:61:75:247:30:185:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0: @ buffer overflow detected : terminated ERROR: energenie process has terminated due to receipt of signal SIGABRT /opt/mqtt-energenie-ener314rt/app.js:254 clearInterval(intervalId); ^

ReferenceError: intervalId is not defined at ChildProcess. (/opt/mqtt-energenie-ener314rt/app.js:254:19) at ChildProcess.emit (node:events:513:28) at maybeClose (node:internal/child_process:1091:16) at ChildProcess._handle.onexit (node:internal/child_process:302:5)

Node.js v18.7.0 root@ubuntu:/opt/mqtt-energenie-ener314rt#

Achronite commented 1 year ago

I've tried forcing that payload into the decoder and it seems to decode it OK for me:

@openThings_receive(): rec:0 {"name":"MOTION_DETECTOR","id":109,"type":1,"str":"","int":1,"float":1.000000}
openThings_receive: Returning: {"deviceId":44852,"mfrId":4,"productId":12,"timestamp":1673710059,"MOTION_DETECTOR":1}
energenie: monitor received={"deviceId":44852,"mfrId":4,"productId":12,"timestamp":1673710059,"MOTION_DETECTOR":1}
publishing energenie/12/44852/motion/state: ON

I think I'm going to have to add some extra debug statements...

Achronite commented 1 year ago

@hazzakins - Ok try downloading develop branch again now, I've added extra debugs to the decode routine.

hazzakins commented 1 year ago

Thanks @Achronite I have run the new code in Dev as asked please see below.

Output on trigger ****HRF_readfifo_burst_cbp() len=14, data:13:4:12:51:242:153:243:13:28:61:75:247:30:185:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0: @openThings_decode(): length=13, payload=13:4:12:51:242:153:243:13:28:61:75:247:30: mfrId=4, productId=12, deviceId=44852 decoding record 0. pos=8 buffer overflow detected : terminated ERROR: energenie process has terminated due to receipt of signal SIGABRT

Full trace root@ubuntu:/opt/mqtt-energenie-ener314rt# node app.js napi_energenie.Init() called MQTT connected to broker mqtt://192.168.3.111 starting monitoring of FSK devices... MQTT subscribed to energenie/+/+/+/command napi_energenie.Init() called init_ener314(0): Initialising init_ener314(): mutex created & locked radio_init() HRF_spi_init(): Initialising gpio HRF_spi_init(): Hardware driver enabled on /dev/spidev0.1 Hardware SPI ret=0,spiMode=4 radio_ver=36 radio_standby HRF_writereg(1,4) _wait_ready(): initener314(): mutex unlocked energenie: ENER314-RT initialised succesfully. energenie: received command: { cmd: 'monitor', enabled: true } tf napi_create_threadsafefunction done tf monitor thread started, timeout=10000tx_openThings_receive_thread starting

HRF_writereg(2,0) HRF_writereg(5,1) HRF_writereg(6,236) HRF_writereg(7,108) HRF_writereg(8,147) HRF_writereg(9,51) HRF_writereg(11,0) energenie: Monitoring thread started HRF_writereg(24,8) HRF_writereg(25,67) HRF_writereg(3,26) HRF_writereg(4,11) HRF_writereg(46,136) HRF_writereg(47,45) HRF_writereg(48,212) HRF_writereg(55,162) HRF_writereg(56,66) HRF_writereg(57,4) radio_setmode() modulation changed to FSK mode changed to 16 HRF_writereg(1,16) _wait_ready(): P*HRF_readfifo_burst_cbp() len=23, data:22:4:5:201:140:251:143:178:68:142:237:125:33:204:204:255:74:184:103:193:44:188:198:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0: @openThings_decode(): length=22, payload=22:4:5:201:140:251:143:178:68:142:237:125:33:204:204:255:74:184:103:193:44:188: mfrId=4, productId=5, deviceId=22865 decoding record 0. pos=8 decoding record 1. pos=12 decoding record 2. pos=16 openThings_receive(): rec:0 {"name":"APPARENT_POWER","id":80,"type":1,"str":"","int":845,"float":845.000000} openThings_receive(): rec:1 {"name":"VOLTAGE","id":118,"type":2,"str":"","int":1133,"float":4.425781} openThings_receive(): rec:2 {"name":"CURRENT","id":105,"type":2,"str":"","int":771,"float":3.011719} openThings_devicePut() device added: 0:22865 openThings_receive: Returning: {"deviceId":22865,"mfrId":4,"productId":5,"timestamp":1673712831,"APPARENT_POWER":845,"VOLTAGE":4.425781,"CURRENT":3.011719} energenie: monitor received={"deviceId":22865,"mfrId":4,"productId":5,"timestamp":1673712831,"APPARENT_POWER":845,"VOLTAGE":4.425781,"CURRENT":3.011719} Message from energenie process: { deviceId: 22865, mfrId: 4, productId: 5, timestamp: 1673712831, APPARENT_POWER: 845, VOLTAGE: 4.425781, CURRENT: 3.011719, cmd: 'monitor' } publishing energenie/5/22865/APPARENT_POWER/state: 845 publishing energenie/5/22865/VOLTAGE/state: 4.425781 publishing energenie/5/22865/CURRENT/state: 3.011719 ****HRF_readfifo_burst_cbp() len=14, data:13:4:12:51:242:153:243:13:28:61:75:247:30:185:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0: @openThings_decode(): length=13, payload=13:4:12:51:242:153:243:13:28:61:75:247:30: mfrId=4, productId=12, deviceId=44852 decoding record 0. pos=8 * buffer overflow detected ***: terminated ERROR: energenie process has terminated due to receipt of signal SIGABRT /opt/mqtt-energenie-ener314rt/app.js:254 clearInterval(intervalId); ^

ReferenceError: intervalId is not defined at ChildProcess. (/opt/mqtt-energenie-ener314rt/app.js:254:19) at ChildProcess.emit (node:events:513:28) at maybeClose (node:internal/child_process:1091:16) at ChildProcess._handle.onexit (node:internal/child_process:302:5)

Node.js v18.7.0 root@ubuntu:/opt/mqtt-energenie-ener314rt# cd node_modules/energenie-ener314rt/

Achronite commented 1 year ago

Getting closer, still don't know where it is crashing. Can you re-download again pls?

hazzakins commented 1 year ago

@Achronite see below as requested.

On Trigger HRF_writereg(1,16) _wait_ready(): P***HRF_readfifo_burst_cbp() len=14, data:13:4:12:51:242:153:243:13:28:61:75:247:30:185:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0: @openThings_decode(): length=13, payload=13:4:12:51:242:153:243:13:28:61:75:247:30:185: mfrId=4, productId=12, deviceId=44852 decoding record 0. pos=8, * buffer overflow detected ***: terminated ERROR: energenie process has terminated due to receipt of signal SIGABRT

Full Trace root@ubuntu:/opt/mqtt-energenie-ener314rt# node app.js napi_energenie.Init() called MQTT connected to broker mqtt://192.168.3.111 starting monitoring of FSK devices... MQTT subscribed to energenie/+/+/+/command napi_energenie.Init() called init_ener314(0): Initialising init_ener314(): mutex created & locked radio_init() HRF_spi_init(): Initialising gpio HRF_spi_init(): Hardware driver enabled on /dev/spidev0.1 Hardware SPI ret=0,spiMode=4 radio_ver=36 radio_standby HRF_writereg(1,4) _wait_ready(): initener314(): mutex unlocked energenie: ENER314-RT initialised succesfully. energenie: received command: { cmd: 'monitor', enabled: true } tf napi_create_threadsafefunction done tf monitor thread started, timeout=10000 tx_openThings_receive_thread starting HRF_writereg(2,0) HRF_writereg(5,1) HRF_writereg(6,236) HRF_writereg(7,108) energenie: Monitoring thread started HRF_writereg(8,147) HRF_writereg(9,51) HRF_writereg(11,0) HRF_writereg(24,8) HRF_writereg(25,67) HRF_writereg(3,26) HRF_writereg(4,11) HRF_writereg(46,136) HRF_writereg(47,45) HRF_writereg(48,212) HRF_writereg(55,162) HRF_writereg(56,66) HRF_writereg(57,4) radio_setmode() modulation changed to FSK mode changed to 16 HRF_writereg(1,16) _wait_ready(): P***HRF_readfifo_burst_cbp() len=14, data:13:4:12:51:242:153:243:13:28:61:75:247:30:185:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0: @openThings_decode(): length=13, payload=13:4:12:51:242:153:243:13:28:61:75:247:30:185: mfrId=4, productId=12, deviceId=44852 decoding record 0. pos=8, * buffer overflow detected ***: terminated ERROR: energenie process has terminated due to receipt of signal SIGABRT /opt/mqtt-energenie-ener314rt/app.js:254 clearInterval(intervalId); ^

ReferenceError: intervalId is not defined at ChildProcess. (/opt/mqtt-energenie-ener314rt/app.js:254:19) at ChildProcess.emit (node:events:513:28) at maybeClose (node:internal/child_process:1091:16) at ChildProcess._handle.onexit (node:internal/child_process:302:5)

Node.js v18.7.0

Achronite commented 1 year ago

download again pls

hazzakins commented 1 year ago

See below.

root@ubuntu:/opt/mqtt-energenie-ener314rt# node app.js napi_energenie.Init() called MQTT connected to broker mqtt://192.168.3.111 starting monitoring of FSK devices... MQTT subscribed to energenie/+/+/+/command napi_energenie.Init() called init_ener314(0): Initialising init_ener314(): mutex created & locked radio_init() HRF_spi_init(): Initialising gpio HRF_spi_init(): Hardware driver enabled on /dev/spidev0.1 Hardware SPI ret=0,spiMode=4 radio_ver=36 radio_standby HRF_writereg(1,4) _wait_ready(): initener314(): mutex unlocked energenie: ENER314-RT initialised succesfully. energenie: received command: { cmd: 'monitor', enabled: true } tf napi_create_threadsafefunction done tf monitor thread started, timeout=10000 tx_openThings_receive_thread starting HRF_writereg(2,0) HRF_writereg(5,1) HRF_writereg(6,236) HRF_writereg(energenie: Monitoring thread started 7,108) HRF_writereg(8,147) HRF_writereg(9,51) HRF_writereg(11,0) HRF_writereg(24,8) HRF_writereg(25,67) HRF_writereg(3,26) HRF_writereg(4,11) HRF_writereg(46,136) HRF_writereg(47,45) HRF_writereg(48,212) HRF_writereg(55,162) HRF_writereg(56,66) HRF_writereg(57,4) radio_setmode() modulation changed to FSK mode changed to 16 HRF_writereg(1,16) _wait_ready(): P*****HRF_readfifo_burst_cbp() len=14, data:13:4:12:51:242:153:243:13:28:61:75:247:30:185:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0: @openThings_decode(): length=13, payload=13:4:12:51:242:153:243:13:28:61:75:247:30:185: mfrId=4, productId=12, deviceId=44852 decoding record 0. pos=8, param=109, wr=0, paramId=109 , paramIndex=1* buffer overflow detected ***: terminated ERROR: energenie process has terminated due to receipt of signal SIGABRT

Achronite commented 1 year ago

I have a possible fix - please try again.

hazzakins commented 1 year ago

Will give this a go in the morning, thank you!

hazzakins commented 1 year ago

It works!!!

I can see the messages being processed now. Traces can be seen below.

Thank you

**root@ubuntu:/opt/mqtt-energenie-ener314rt# root@ubuntu:/opt/mqtt-energenie-ener314rt# ps -a PID TTY TIME CMD 1043 pts/0 00:00:01 sudo 1060 pts/1 00:00:00 su 1061 pts/1 00:00:00 bash 1113 pts/1 00:00:00 ps root@ubuntu:/opt/mqtt-energenie-ener314rt# node app.js napi_energenie.Init() called MQTT connected to broker mqtt://192.168.3.111 starting monitoring of FSK devices... MQTT subscribed to energenie/+/+/+/command napi_energenie.Init() called init_ener314(0): Initialising init_ener314(): mutex created & locked radio_init() HRF_spi_init(): Initialising gpio HRF_spi_init(): Hardware driver enabled on /dev/spidev0.1 Hardware SPI ret=0,spiMode=4 radio_ver=36 radio_standby HRF_writereg(1,4) _wait_ready(): initener314(): mutex unlocked energenie: ENER314-RT initialised succesfully. energenie: received command: { cmd: 'monitor', enabled: true } tf napi_create_threadsafefunction done tf monitor thread started, timeout=10000 tx_openThings_receive_thread starting HRF_writereg(2energenie: Monitoring thread started ,0) HRF_writereg(5,1) HRF_writereg(6,236) HRF_writereg(7,108) HRF_writereg(8,147) HRF_writereg(9,51) HRF_writereg(11,0) HRF_writereg(24,8) HRF_writereg(25,67) HRF_writereg(3,26) HRF_writereg(4,11) HRF_writereg(46,136) HRF_writereg(47,45) HRF_writereg(48,212) HRF_writereg(55,162) HRF_writereg(56,66) HRF_writereg(57,4) radio_setmode() modulation changed to FSK mode changed to 16 HRF_writereg(1,16) _wait_ready(): P*MQTT connected to broker mqtt://192.168.3.111 starting monitoring of FSK devices... MQTT subscribed to energenie/+/+/+/command energenie: received command: { cmd: 'monitor', enabled: true } **MQTT connected to broker mqtt://192.168.3.111 starting monitoring of FSK devices... MQTT subscribed to energenie/+/+/+/command energenie: received command: { cmd: 'monitor', enabled: true } MQTT connected to broker mqtt://192.168.3.111 starting monitoring of FSK devices... MQTT subscribed to energenie/+/+/+/command energenie: received command: { cmd: 'monitor', enabled: true } MQTT connected to broker mqtt://192.168.3.111 starting monitoring of FSK devices... MQTT subscribed to energenie/+/+/+/command energenie: received command: { cmd: 'monitor', enabled: true } MQTT connected to broker mqtt://192.168.3.111 starting monitoring of FSK devices... MQTT subscribed to energenie/+/+/+/command energenie: received command: { cmd: 'monitor', enabled: true } MQTT connected to broker mqtt://192.168.3.111 starting monitoring of FSK devices... energenie: received command: { cmd: 'monitor', enabled: true } MQTT subscribed to energenie/+/+/+/command *MQTT connected to broker mqtt://192.168.3.111 starting monitoring of FSK devices... MQTT subscribed to energenie/+/+/+/command energenie: received command: { cmd: 'monitor', enabled: true } *HRF_readfifo_burst_cbp() len=14, data:13:4:12:51:242:153:243:13:28:61:75:247:30:185:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0: @openThings_decode(): length=13, payload=13:4:12:51:242:153:243:13:28:61:75:247:30:185: mfrId=4, productId=12, deviceId=44852 decoding record 0. pos=8, param=109, wr=0, paramId=109 , paramIndex=1, recpos=10, type=0, rlen=1 openThings_decode(): returning 1 (i=11) openThings_decode() returned 1 records for deviceId=44852 openThings_receive(): rec:0 {"name":"MOTION_DETECTOR","id":109,"type":1,"str":"","int":1,"float":1.000000} openThings_devicePut() device added: 0:44852 openThings_receive: Returning: {"deviceId":44852,"mfrId":4,"productId":12,"timestamp":1673780047,"MOTION_DETECTOR":1} energenie: monitor received={"deviceId":44852,"mfrId":4,"productId":12,"timestamp":1673780047,"MOTION_DETECTOR":1} Message from energenie process: { deviceId: 44852, mfrId: 4, productId: 12, timestamp: 1673780047, MOTION_DETECTOR: 1, cmd: 'monitor' } publishing energenie/12/44852/motion/state: ON MQTT connected to broker mqtt://192.168.3.111 starting monitoring of FSK devices... MQTT subscribed to energenie/+/+/+/command energenie: received command: { cmd: 'monitor', enabled: true } *^

Achronite commented 1 year ago

Excellent! It was a strange one, it must have been something specific for your compiler in that it didn't like a string of 15 (MOTION_DETECTOR) being stored in a 15 space (ie it needed 16 for null terminator).

I'll remove the extra debugs.

hazzakins commented 1 year ago

That's weird, potentially sounds like an OS limitation using Ubuntu rather than Raspbian maybe, not sure what OS you use for your PI/Setup?

Thanks again

Achronite commented 1 year ago

I guess most are using Raspbian.

hazzakins commented 1 year ago

Yeah that may be why then.