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. Gateway stops communicating (again)

Gateway stops communicating (again)

Scheduled Pinned Locked Moved Troubleshooting
2 Posts 2 Posters 24 Views 2 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.
  • OldSurferDudeO Offline
    OldSurferDudeO Offline
    OldSurferDude
    wrote on last edited by
    #1

    Re: RPI MQTT gateway stops communicating

    My problem is similar, if not the same. Over some period of time, a week or so, the actuators that are part of the gateway stop receiving commands. The aforementioned topic indicates an unstable network, yet I ssh into the RPi and use systemctl to restart mysgw and the gateway starts acting on the sent commands. The RPi zero W does not have an ethernet port.

    Because I can still ssh into the RPi, I don't think it's a network problem. At the moment, all is fine. What can I do to debug this problem next time it happens?

    Thanks for your help,

    OSD

    My system is:
    Raspberry Pi Zero W Rev 1.1
    MySensors Library v2.4.0-alpha
    configuration: --spi-driver=SPIDEV --my-gateway=mqtt --my-controller-ip-address=192.168.1.142 --my-port=1883 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-transport=rf24 --my-rf24-channel=121 --my-rf24-pa-level=RF24_PA_MAX

    1 Reply Last reply
    0
    • E Offline
      E Offline
      eiten
      wrote on last edited by
      #2

      Hm, maybe the problem is that your rPI has a short interruption in the WIFI connection, the MQTT TCP connection is interrupted and does not autostart again. Maybe there is something in the logs. Maybe you can find something about reconnects in one of these:

      journalctl --unit=systemd-networkd
      journalctl --unit=wpa_supplicant
      

      You could try to run wpa_cli in daemon mode to react to disconnects and connects. Create a script like this:

      #!/bin/bash
      
      case "$2" in
          CONNECTED)
              <your command to start the gateway>;
              ;;
          DISCONNECTED)
              <your command to stop the gateway>;
              ;;
      esac
      
      

      then, start wpa_cli in deamon mode:

      wpa_cli -a /path/to/your/script #use sudo if your gateway commands need sudo
      

      If that helps, you could create a service from this command.

      Regards, Edi

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


      17

      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