Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. pi gateway just stops communicating

pi gateway just stops communicating

Scheduled Pinned Locked Moved Troubleshooting
20 Posts 5 Posters 1.3k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • bgunnarbB Offline
    bgunnarbB Offline
    bgunnarb
    wrote on last edited by
    #9

    My two cents worth:

    I have been battling this issue as well for the last couple of days.
    I am now using the master version on an Rpi 1, a really old one. It did work for a few hours, 1 - 10 and then stopped communicating.

    The discovery I made today was that I goofed up and built the mqtt version of the gw with the option --my-rf24-irq-pin=15 set in the config file. All well only if I had not forgotten to connect the IRQ from the rf24 to pin 15 on the RPi. Stupid!

    So, I rebuilt the gw today without this option and it is still running well after a few hours. We'll see tomorrow.

    I have never been so busy since I retired!

    1 Reply Last reply
    0
    • CrankyCoderC Offline
      CrankyCoderC Offline
      CrankyCoder
      wrote on last edited by
      #10

      I read that the irq thing may not be necessary. I haven't setup the irq on mine. I don't have that much traffic for the irq to be needed yet.

      anyone else using the irq on the pi gateway?

      Home Automation Tinkerer
      www.CrankyCoder.net

      Controller: HomeAssistant in Kubernetes
      Gateway: MQTTClientGateway
      MySensors: 2.3

      1 Reply Last reply
      0
      • skywatchS Offline
        skywatchS Offline
        skywatch
        wrote on last edited by
        #11

        @CrankyCoder IRQ made no difference when I tried it. But that was over a year ago now.

        1 Reply Last reply
        0
        • CrankyCoderC Offline
          CrankyCoderC Offline
          CrankyCoder
          wrote on last edited by
          #12

          So I have a new development. I noticed something strange. The mysgw stopped again today. I went digging through the syslog around the same time. Didn't see anything just before it went offline, but i did notice that shortly after it went offline it said that the carrier dropped for the nic.

          Apr  2 15:50:55 raspberrypi mysgw: TSF:MSG:READ,200-200-0,s=2,c=2,t=25,pt=0,l=0,sg=0:
          Apr  2 15:50:55 raspberrypi mysgw: GWT:TPS:TOPIC=mygateway1-out/200/2/2/0/25,MSG SENT
          Apr  2 15:51:07 raspberrypi mysgw: TSF:MSG:READ,200-200-0,s=2,c=1,t=23,pt=2,l=2,sg=0:25
          Apr  2 15:51:07 raspberrypi mysgw: GWT:TPS:TOPIC=mygateway1-out/200/2/1/0/23,MSG SENT
          Apr  2 15:52:27 raspberrypi dhcpcd[377]: eth0: carrier lost
          Apr  2 15:52:27 raspberrypi kernel: [  461.474897] smsc95xx 1-1.1:1.0 eth0: link down
          Apr  2 15:52:28 raspberrypi dhcpcd[377]: eth0: deleting address fe80::669:d81d:83fb:3aaa
          Apr  2 15:52:28 raspberrypi avahi-daemon[226]: Withdrawing address record for fe80::669:d81d:83fb:3aaa on eth0.
          Apr  2 15:52:28 raspberrypi avahi-daemon[226]: Leaving mDNS multicast group on interface eth0.IPv6 with address fe80::669:d81d:83fb:3aaa.
          Apr  2 15:52:28 raspberrypi avahi-daemon[226]: Interface eth0.IPv6 no longer relevant for mDNS.
          Apr  2 15:52:28 raspberrypi dhcpcd[377]: eth0: deleting default route via 192.168.2.1
          Apr  2 15:52:28 raspberrypi dhcpcd[377]: eth0: deleting route to 192.168.2.0/24
          Apr  2 15:52:28 raspberrypi avahi-daemon[226]: Withdrawing address record for 192.168.2.71 on eth0.
          Apr  2 15:52:28 raspberrypi avahi-daemon[226]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.2.71.
          

          So i decided to check a few other times in the last 48 hours and sure enough. Same thing. It seems that something is causing the nic to think it lost it's connection to the switch. The mysgw seems to go in to a weird state. Not sure what error checking is in it or what i could do to log more since i am already on debug for the logging of mysgw.

          Next step i guess will be instead of dhcp reservation ill static assign it. See if that changes anything, and see swap network cable. Maybe hard set some things like the speed/duplex on the switch.

          Just figured i would throw out my latest finding.

          Home Automation Tinkerer
          www.CrankyCoder.net

          Controller: HomeAssistant in Kubernetes
          Gateway: MQTTClientGateway
          MySensors: 2.3

          mfalkviddM 1 Reply Last reply
          2
          • CrankyCoderC CrankyCoder

            So I have a new development. I noticed something strange. The mysgw stopped again today. I went digging through the syslog around the same time. Didn't see anything just before it went offline, but i did notice that shortly after it went offline it said that the carrier dropped for the nic.

            Apr  2 15:50:55 raspberrypi mysgw: TSF:MSG:READ,200-200-0,s=2,c=2,t=25,pt=0,l=0,sg=0:
            Apr  2 15:50:55 raspberrypi mysgw: GWT:TPS:TOPIC=mygateway1-out/200/2/2/0/25,MSG SENT
            Apr  2 15:51:07 raspberrypi mysgw: TSF:MSG:READ,200-200-0,s=2,c=1,t=23,pt=2,l=2,sg=0:25
            Apr  2 15:51:07 raspberrypi mysgw: GWT:TPS:TOPIC=mygateway1-out/200/2/1/0/23,MSG SENT
            Apr  2 15:52:27 raspberrypi dhcpcd[377]: eth0: carrier lost
            Apr  2 15:52:27 raspberrypi kernel: [  461.474897] smsc95xx 1-1.1:1.0 eth0: link down
            Apr  2 15:52:28 raspberrypi dhcpcd[377]: eth0: deleting address fe80::669:d81d:83fb:3aaa
            Apr  2 15:52:28 raspberrypi avahi-daemon[226]: Withdrawing address record for fe80::669:d81d:83fb:3aaa on eth0.
            Apr  2 15:52:28 raspberrypi avahi-daemon[226]: Leaving mDNS multicast group on interface eth0.IPv6 with address fe80::669:d81d:83fb:3aaa.
            Apr  2 15:52:28 raspberrypi avahi-daemon[226]: Interface eth0.IPv6 no longer relevant for mDNS.
            Apr  2 15:52:28 raspberrypi dhcpcd[377]: eth0: deleting default route via 192.168.2.1
            Apr  2 15:52:28 raspberrypi dhcpcd[377]: eth0: deleting route to 192.168.2.0/24
            Apr  2 15:52:28 raspberrypi avahi-daemon[226]: Withdrawing address record for 192.168.2.71 on eth0.
            Apr  2 15:52:28 raspberrypi avahi-daemon[226]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.2.71.
            

            So i decided to check a few other times in the last 48 hours and sure enough. Same thing. It seems that something is causing the nic to think it lost it's connection to the switch. The mysgw seems to go in to a weird state. Not sure what error checking is in it or what i could do to log more since i am already on debug for the logging of mysgw.

            Next step i guess will be instead of dhcp reservation ill static assign it. See if that changes anything, and see swap network cable. Maybe hard set some things like the speed/duplex on the switch.

            Just figured i would throw out my latest finding.

            mfalkviddM Offline
            mfalkviddM Offline
            mfalkvidd
            Mod
            wrote on last edited by
            #13

            @crankycoder maybe adding MY_DEBUG_VERBOSE_GATEWAY and MY_DEBUG_VERBOSE_RF24 can give a clue to what is happening.

            CrankyCoderC 1 Reply Last reply
            0
            • W Offline
              W Offline
              waspie
              wrote on last edited by
              #14

              my pi3b does this as well. it's far and few in between. I even made a watchdog in openhab to "ping" the msgw (requesting an ack) and mysgw responds but it doesn't send out new sensor readings. i thought about expanding the watchdog to watch for all sensor readings and throw up a restart to the gw if it receives no readings in a 10 minute period but mine doesn't fail nearly as consistently as yours so I haven't worried about it too much...

              would still like to see a resolution to this as I've moved most of my PIRs and temp sensors to mysgw so when it goes down it can be a bit of a problem.

              1 Reply Last reply
              1
              • mfalkviddM mfalkvidd

                @crankycoder maybe adding MY_DEBUG_VERBOSE_GATEWAY and MY_DEBUG_VERBOSE_RF24 can give a clue to what is happening.

                CrankyCoderC Offline
                CrankyCoderC Offline
                CrankyCoder
                wrote on last edited by
                #15

                @mfalkvidd do i need to modify the pi code and add that in and recompile? or can i add those in to the config file in /etc/mysensors.conf?

                Home Automation Tinkerer
                www.CrankyCoder.net

                Controller: HomeAssistant in Kubernetes
                Gateway: MQTTClientGateway
                MySensors: 2.3

                mfalkviddM 1 Reply Last reply
                0
                • CrankyCoderC CrankyCoder

                  @mfalkvidd do i need to modify the pi code and add that in and recompile? or can i add those in to the config file in /etc/mysensors.conf?

                  mfalkviddM Offline
                  mfalkviddM Offline
                  mfalkvidd
                  Mod
                  wrote on last edited by
                  #16

                  @crankycoder I think you can add them in MySensors.conf but I would add them to the ./configure command. See the section called ”Advanced” at https://www.mysensors.org/build/raspberry

                  CrankyCoderC 1 Reply Last reply
                  0
                  • mfalkviddM mfalkvidd

                    @crankycoder I think you can add them in MySensors.conf but I would add them to the ./configure command. See the section called ”Advanced” at https://www.mysensors.org/build/raspberry

                    CrankyCoderC Offline
                    CrankyCoderC Offline
                    CrankyCoder
                    wrote on last edited by
                    #17

                    @mfalkvidd compiling now. side question, can the ip address be put in the config later? i hate that i have to hard code it in at compile time.

                    Home Automation Tinkerer
                    www.CrankyCoder.net

                    Controller: HomeAssistant in Kubernetes
                    Gateway: MQTTClientGateway
                    MySensors: 2.3

                    mfalkviddM 1 Reply Last reply
                    0
                    • CrankyCoderC Offline
                      CrankyCoderC Offline
                      CrankyCoder
                      wrote on last edited by
                      #18

                      compiled with new (very noisy) options lol

                      Apr 03 13:50:48 DEBUG RF24:RBR:REG=23,VAL=17
                      Apr 03 13:50:48 DEBUG RF24:RBR:REG=23,VAL=17
                      Apr 03 13:50:48 DEBUG RF24:RBR:REG=23,VAL=17
                      Apr 03 13:50:48 DEBUG RF24:RBR:REG=23,VAL=17
                      Apr 03 13:50:48 DEBUG RF24:RBR:REG=23,VAL=17
                      Apr 03 13:50:48 DEBUG RF24:RBR:REG=23,VAL=17
                      Apr 03 13:50:48 DEBUG RF24:RBR:REG=23,VAL=17
                      Apr 03 13:50:48 DEBUG RF24:RBR:REG=23,VAL=17
                      Apr 03 13:50:48 DEBUG RF24:RBR:REG=23,VAL=17
                      Apr 03 13:50:48 DEBUG RF24:RBR:REG=23,VAL=17
                      Apr 03 13:50:48 DEBUG RF24:RBR:REG=23,VAL=17
                      Apr 03 13:50:48 DEBUG RF24:RBR:REG=23,VAL=17
                      

                      No idea what that means, but it seems if i am seeing that, it's working lol.

                      Home Automation Tinkerer
                      www.CrankyCoder.net

                      Controller: HomeAssistant in Kubernetes
                      Gateway: MQTTClientGateway
                      MySensors: 2.3

                      1 Reply Last reply
                      0
                      • CrankyCoderC CrankyCoder

                        @mfalkvidd compiling now. side question, can the ip address be put in the config later? i hate that i have to hard code it in at compile time.

                        mfalkviddM Offline
                        mfalkviddM Offline
                        mfalkvidd
                        Mod
                        wrote on last edited by
                        #19

                        @crankycoder it doesn't seem to be possible to change the IP without recompiling. I checked https://www.mysensors.org/build/raspberry#configuration-file and the source code and couldn't find anything about IP.

                        I have not thought about changing IP before, since I only use my-gateway=serial. It would make sense to have the IP in the config file, so if someone wants to implement it it would be great.

                        A workaround might be to use --my-controller-url-address and a host name, which can then be added to /etc/hosts on the Raspberry Pi.

                        Something like this should work:

                        --my-controller-url-address=controller
                        

                        Then add the following to /etc/hosts:

                        192.168.1.235  controller
                        

                        (assuming your controller has IP address 192.168.1.235). If you need to change the IP later, just change the IP in /etc/hosts and restart the gateway.

                        1 Reply Last reply
                        0
                        • CrankyCoderC Offline
                          CrankyCoderC Offline
                          CrankyCoder
                          wrote on last edited by
                          #20

                          So here's the latest.

                          I checked and the PI was already set to static ip and not dhcp reservation. However, I made 2 changes and have been ok for 3 days now.

                          1. i changed ports on the switch. Not sure if it mattered, but i have plenty.
                          2. this is the one I think may have more impact. Since it seemed the carrier was dropping, but coming back, I started wondering if maybe something was triggering an auto renegotiation for nic speed. So I went in to the switch and have it hard set to 100 FULL instead of auto.

                          I still have the debug running and gonna let this run for quite some time just to make sure im feeling it's ok.

                          Home Automation Tinkerer
                          www.CrankyCoder.net

                          Controller: HomeAssistant in Kubernetes
                          Gateway: MQTTClientGateway
                          MySensors: 2.3

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          19

                          Online

                          11.7k

                          Users

                          11.2k

                          Topics

                          113.1k

                          Posts


                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • MySensors
                          • OpenHardware.io
                          • Categories
                          • Recent
                          • Tags
                          • Popular