Raspberry Pi stability problem



  • Hi,

    running a raspi 3 with raspbian

    pi@pi:~ $ uname -a
    Linux pi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

    Have updated the system to latest status but I still have lots of stability issues with the gateway.

    I build it with

    ...

    git clone https://github.com/mysensors/MySensors.git --branch development
    cd MySensors/
    ./configure --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mygateway1 --my-rf24-ce-pin=22 --my-rf24-cs-pin=24
    make
    cd MySensors/bin/
    sudo ./mysgw -d

    ...

    It works but very very unstable - if new sensor come online the gateway goes down with a segmentation fault.

    Its basically not usable. As mysensors have such a great reputation plus I already placed lots of sensors in my place - how I can get a mqtt gateway stable? What version? maybe some configure switches I forgot.

    I tried different pi's, different NRF24L01 modules, they have an extra capacitor etc.

    I really get frustrated and I can not believe its that unstable, so there must be something I must do wrong.

    Who has run it on a pi with out issues?

    Many thanks!
    Regards
    Joerg



  • I will try out the version for the ESP8266 (GatewayESP8266MQTTClient.ino), however this seems really strange to me. Any hint?


  • Mod

    @alterfritz said in Raspberry Pi stability problem:

    I will try out the version for the ESP8266 (GatewayESP8266MQTTClient.ino), however this seems really strange to me. Any hint?

    Could you be a bit more specific? What seems strange? The esp8266 gateway sketch? In what way does the sketch seem strange?



  • The gateway basically stops with a segmentation fault after working ok for a few minutes... let me try it...give me a minute...


  • Mod

    @alterfritz the troubleshooting instructions in https://forum.mysensors.org/post/82711 could give valuable input regarding the raspberry pi gateway.


  • Mod

    @alterfritz that's not what I was asking about. See the text I quoted.



  • Ok - thanks will do that...



  • pi@pi:~ $ sudo gdb /home/pi/mysensors_dev/MySensors/bin/mysgw
    GNU gdb (Raspbian 7.7.1+dfsg-5+rpi1) 7.7.1
    Copyright (C) 2014 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "arm-linux-gnueabihf".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    http://www.gnu.org/software/gdb/bugs/.
    Find the GDB manual and other documentation resources online at:
    http://www.gnu.org/software/gdb/documentation/.
    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from /home/pi/mysensors_dev/MySensors/bin/mysgw...done.
    (gdb) run -d
    Starting program: /home/pi/mysensors_dev/MySensors/bin/mysgw -d
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
    mysgw: Starting gateway...
    mysgw: Protocol version - 2.2.0-rc.2
    mysgw: MCO:BGN:INIT GW,CP=RNNGL-Q-,VER=2.2.0-rc.2
    mysgw: TSF:LRT:OK
    mysgw: TSM:INIT
    mysgw: TSF:WUR:MS=0
    [New Thread 0x75cc8450 (LWP 4703)]
    mysgw: TSM:INIT:TSP OK
    mysgw: TSM:INIT:GW MODE
    mysgw: TSM:READY:ID=0,PAR=0,DIS=0
    mysgw: MCO:REG:NOT NEEDED
    mysgw: MCO:BGN:STP
    mysgw: MCO:BGN:INIT OK,TSP=1
    mysgw: GWT:RMQ:MQTT RECONNECT
    mysgw: connected to 127.0.0.1
    mysgw: GWT:RMQ:MQTT CONNECTED
    mysgw: GWT:TPS:TOPIC=mysensors-out/0/255/0/0/18,MSG SENT
    mysgw: TSF:MSG:READ,3-3-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    mysgw: TSF:MSG:BC
    mysgw: TSF:MSG:FPAR REQ,ID=3
    mysgw: TSF:PNG:SEND,TO=0
    mysgw: TSF:CKU:OK
    mysgw: TSF:MSG:GWL OK

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 0x75cc8450 (LWP 4703)]
    0x0001ac74 in RF24_spiMultiByteTransfer (readMode=true, len=6 '\006', buf=0x1 <error: Cannot access memory at address 0x1>, cmd=97 'a') at ./drivers/RF24/RF24.cpp:87
    87 *buf++ = *prx++;
    (gdb)



  • Here is another screenshot - seems that sometimes it works... for some time...

    mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    mysgw: GWT:TPS:TOPIC=mysensors-out/1/255/3/0/6,MSG SENT
    mysgw: TSF:MSG:READ,6-6-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    mysgw: TSF:MSG:PINGED,ID=6,HP=1
    mysgw: TSF:MSG:SEND,0-0-6-6,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
    mysgw: TSF:MSG:READ,6-6-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    mysgw: TSF:MSG:SEND,0-0-6-6,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    mysgw: TSF:MSG:READ,6-6-0,s=255,c=0,t=17,pt=0,l=10,sg=0:2.2.0-beta
    mysgw: GWT:TPS:TOPIC=mysensors-out/6/255/0/0/17,MSG SENT
    mysgw: TSF:MSG:READ,6-6-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    mysgw: GWT:TPS:TOPIC=mysensors-out/6/255/3/0/6,MSG SENT
    mysgw: TSF:MSG:READ,5-5-0,s=255,c=0,t=17,pt=0,l=10,sg=0:2.2.0-beta
    mysgw: GWT:TPS:TOPIC=mysensors-out/5/255/0/0/17,MSG SENT
    mysgw: TSF:MSG:READ,5-5-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    mysgw: GWT:TPS:TOPIC=mysensors-out/5/255/3/0/6,MSG SENT
    mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=11,pt=0,l=10,sg=0:WallLight1
    mysgw: GWT:TPS:TOPIC=mysensors-out/1/255/3/0/11,MSG SENT
    mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=12,pt=0,l=3,sg=0:1.0
    mysgw: GWT:TPS:TOPIC=mysensors-out/1/255/3/0/12,MSG SENT
    mysgw: TSF:MSG:READ,1-1-0,s=1,c=0,t=4,pt=0,l=0,sg=0:
    mysgw: GWT:TPS:TOPIC=mysensors-out/1/1/0/0/4,MSG SENT
    mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    mysgw: TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
    mysgw: TSF:MSG:READ,1-1-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
    mysgw: GWT:TPS:TOPIC=mysensors-out/1/1/1/0/3,MSG SENT
    mysgw: TSF:MSG:READ,3-3-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    mysgw: TSF:MSG:BC
    mysgw: TSF:MSG:FPAR REQ,ID=3
    mysgw: TSF:CKU:OK,FCTRL
    mysgw: TSF:MSG:GWL OK
    mysgw: TSF:MSG:SEND,0-0-3-3,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    mysgw: TSF:MSG:READ,4-4-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    mysgw: TSF:MSG:BC
    mysgw: TSF:MSG:FPAR REQ,ID=4
    mysgw: TSF:CKU:OK,FCTRL
    mysgw: TSF:MSG:GWL OK
    mysgw: TSF:MSG:SEND,0-0-4-4,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    mysgw: TSF:MSG:READ,6-6-0,s=255,c=3,t=11,pt=0,l=10,sg=0:WallLight6
    mysgw: GWT:TPS:TOPIC=mysensors-out/6/255/3/0/11,MSG SENT
    mysgw: TSF:MSG:READ,6-6-0,s=255,c=3,t=12,pt=0,l=3,sg=0:1.0
    mysgw: GWT:TPS:TOPIC=mysensors-out/6/255/3/0/12,MSG SENT
    mysgw: TSF:MSG:READ,6-6-0,s=1,c=0,t=4,pt=0,l=0,sg=0:
    mysgw: GWT:TPS:TOPIC=mysensors-out/6/1/0/0/4,MSG SENT
    mysgw: TSF:MSG:READ,6-6-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    mysgw: !TSF:MSG:SEND,0-0-6-6,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=NACK:1
    mysgw: TSF:MSG:READ,5-5-0,s=255,c=3,t=11,pt=0,l=10,sg=0:WallLight5
    mysgw: GWT:TPS:TOPIC=mysensors-out/5/255/3/0/11,MSG SENT
    mysgw: TSF:MSG:READ,5-5-0,s=255,c=3,t=12,pt=0,l=3,sg=0:1.0
    mysgw: GWT:TPS:TOPIC=mysensors-out/5/255/3/0/12,MSG SENT
    mysgw: TSF:MSG:READ,5-5-0,s=1,c=0,t=4,pt=0,l=0,sg=0:
    mysgw: GWT:TPS:TOPIC=mysensors-out/5/1/0/0/4,MSG SENT
    mysgw: TSF:MSG:READ,5-5-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    mysgw: TSF:MSG:SEND,0-0-5-5,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
    mysgw: TSF:MSG:READ,5-5-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
    mysgw: GWT:TPS:TOPIC=mysensors-out/5/1/1/0/3,MSG SENT
    mysgw: TSF:MSG:READ,3-3-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    mysgw: TSF:MSG:PINGED,ID=3,HP=1
    mysgw: TSF:MSG:SEND,0-0-3-3,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
    mysgw: TSF:MSG:READ,3-3-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    mysgw: TSF:MSG:SEND,0-0-3-3,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    mysgw: TSF:MSG:READ,3-3-0,s=255,c=0,t=17,pt=0,l=10,sg=0:2.2.0-beta
    mysgw: GWT:TPS:TOPIC=mysensors-out/3/255/0/0/17,MSG SENT
    mysgw: TSF:MSG:READ,3-3-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    mysgw: GWT:TPS:TOPIC=mysensors-out/3/255/3/0/6,MSG SENT
    mysgw: TSF:MSG:READ,4-4-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    mysgw: TSF:MSG:PINGED,ID=4,HP=1
    mysgw: TSF:MSG:SEND,0-0-4-4,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
    mysgw: TSF:MSG:READ,4-4-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    mysgw: TSF:MSG:SEND,0-0-4-4,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    mysgw: TSF:MSG:READ,3-3-0,s=255,c=3,t=11,pt=0,l=10,sg=0:WallLight3
    mysgw: GWT:TPS:TOPIC=mysensors-out/3/255/3/0/11,MSG SENT
    mysgw: TSF:MSG:READ,3-3-0,s=255,c=3,t=12,pt=0,l=3,sg=0:1.0
    mysgw: GWT:TPS:TOPIC=mysensors-out/3/255/3/0/12,MSG SENT
    mysgw: TSF:MSG:READ,3-3-0,s=1,c=0,t=4,pt=0,l=0,sg=0:
    mysgw: GWT:TPS:TOPIC=mysensors-out/3/1/0/0/4,MSG SENT
    mysgw: TSF:MSG:READ,3-3-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    mysgw: TSF:MSG:SEND,0-0-3-3,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
    mysgw: TSF:MSG:READ,4-4-0,s=255,c=0,t=17,pt=0,l=10,sg=0:2.2.0-beta
    mysgw: GWT:TPS:TOPIC=mysensors-out/4/255/0/0/17,MSG SENT
    mysgw: TSF:MSG:READ,3-3-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
    mysgw: GWT:TPS:TOPIC=mysensors-out/3/1/1/0/3,MSG SENT
    mysgw: TSF:MSG:READ,4-4-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    mysgw: GWT:TPS:TOPIC=mysensors-out/4/255/3/0/6,MSG SENT
    mysgw: TSF:MSG:READ,4-4-0,s=255,c=3,t=11,pt=0,l=10,sg=0:WallLight4
    mysgw: GWT:TPS:TOPIC=mysensors-out/4/255/3/0/11,MSG SENT
    mysgw: TSF:MSG:READ,4-4-0,s=255,c=3,t=12,pt=0,l=3,sg=0:1.0
    mysgw: GWT:TPS:TOPIC=mysensors-out/4/255/3/0/12,MSG SENT
    mysgw: TSF:MSG:READ,4-4-0,s=1,c=0,t=4,pt=0,l=0,sg=0:
    mysgw: GWT:TPS:TOPIC=mysensors-out/4/1/0/0/4,MSG SENT
    mysgw: TSF:MSG:READ,4-4-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    mysgw: TSF:MSG:SEND,0-0-4-4,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
    mysgw: TSF:MSG:READ,4-4-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
    mysgw: GWT:TPS:TOPIC=mysensors-out/4/1/1/0/3,MSG SENT



  • until it crashes...

    mysgw: TSF:MSG:BC
    mysgw: TSF:MSG:FPAR REQ,ID=3
    mysgw: TSF:PNG:SEND,TO=0
    mysgw: TSF:CKU:OK
    mysgw: TSF:MSG:GWL OK

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 0x75cc8450 (LWP 4759)]
    0x0001ac74 in RF24_spiMultiByteTransfer (readMode=true, len=6 '\006', buf=0x1 <error: Cannot access memory at address 0x1>, cmd=97 'a') at ./drivers/RF24/RF24.cpp:87
    87 *buf++ = *prx++;


  • Mod

    @alterfritz thanks. Now we know where in the code the crash occurs. Hopefully @marceloaqno can figure out what's wrong. I'll take a look as well, but I am not familiar with that code so I am not sure I will understand it.



  • Thanks a lot. Looking forward to any update... have a nice weekend, I will try the version for ESP8266 in the meantime, however run it on the pi would be preferred.

    Thanks again!



  • Just to let you know - I have uploaded the ESP8266 sketch (from 2.1.1) via Arduino IDE, seems to run stable with the same NRF24L01 module.

    But if possible I would like to go back to have all run on the raspi.

    Again thanks for all that support here!


  • Admin

    @alterfritz I've prepared a PR that should fix the segmentation fault: https://github.com/tekka007/MySensors/tree/nullptr - can you test this PR?



  • Many thanks - yes, will do today. Let you know results.



  • Seems this does the trick. Thanks!


  • Admin

    @alterfritz Thanks for the feedback, PR merged to 2.2.0-rc.2


  • Mod

    Excellent work. Thanks everyone!


Log in to reply
 

Suggested Topics

  • 33
  • 8
  • 5
  • 5
  • 11
  • 9

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts