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 restarts a midnight

Gateway restarts a midnight

Scheduled Pinned Locked Moved Troubleshooting
9 Posts 3 Posters 108 Views 4 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 last edited by
    #1

    I think all my gizmos are conspiring against me. This is just one of their ploys.

    My gateway is running on an RPi 3B+. Integral to the gateway are three "sensors" for irrigation control. It receives 3 commands from Home Assistant: Zone, Runtime, and Start. The program translates these inputs into when and what relays to energize or de-energize.

    There are six nRF24 nodes; four soil moisture sensors, a water flow meter and an energy meter.

    All of this worked well but went to *@#!! while I was gone. The nodes worked fine (other than the usual problems with DIY stuff). It was the irrigation control that I couldn't figure out.

    I disabled the service and ran mysgw from the command line instead of as a service so I could try to catch the problem. There was to much data and the problem and the problem seemed to go away. But back as a service, the irrigation control would stop (not the other devices), but when I restarted the service, all was fine (sudo systemctl restart mysgw) for a day.

    I read the documentation about piping the output. This essentially makes the output available when running as a service. At some point the output would stop. I couldn't determine why it stopped and there was no timestamp with the output.

    I installed the utility, ts, that would put a timestamp on the output stream. The stream would stop at midnight every midnight, but the service must have just restarted because mysgw was still running.

    Now here's the weird part. The irrigation control is working.

    Wait, Wait, Wait!

    I just checked to see if mysgw was working. It wasn't! no output from mysgw, meaning all the devices were not working. systemctl status mysgw said it was running. I restarted the service and now it's running as expected.

    Any ideas for me to try. Yes, I could run a cron job every day or every 8 hours, but I'd like to have it work without this crutch.

    1 Reply Last reply
    1
    • TheoLT Offline
      TheoLT Offline
      TheoL
      Contest Winner
      wrote last edited by
      #2

      I have no experience with a raspberry pi as a gateway. I just add MySensors arduino gateways. Because it's easy to run a RFM69 and a NRF gateway.

      I forgot the command. But you should check the sys log. See if it says anything strange

      Also any special scripts running around 12 o'clock?

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

        Just a guess, but check for any power saving or watchdog settings.

        OldSurferDudeO 1 Reply Last reply
        1
        • skywatchS skywatch

          Just a guess, but check for any power saving or watchdog settings.

          OldSurferDudeO Offline
          OldSurferDudeO Offline
          OldSurferDude
          wrote last edited by
          #4

          @skywatch

          Where would I find those? I must believe that they are in the MySensors code because it is not the RPi rebooting.

          I say the RPi is not rebooting because I am monitoring the output of mysgw via an ssh connection and the connection is not being broken, which would indicate a system reboot. It is the stream from the pipe that stops.

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

            Hmm, that is weird. I can only guess that HA and the pi are somehow responsible as they are the only ones that know the time.

            I think you are saying that the nrf24l01+ is connected directly to your pi and that the gw runs on the pi?

            I had issues with this setup and instead opted for a usb to serial module plugged into the pi usb port along with an arduino pro mini and nrf24l01+ as the gw. It has worked well for many years. Maybe an option for you to try if nothing else fixes the problem?

            1 Reply Last reply
            1
            • OldSurferDudeO Offline
              OldSurferDudeO Offline
              OldSurferDude
              wrote last edited by
              #6

              Yes, nRF24 is attached to the RPi3B+ on which the gateway runs.

              I have long considered an Arduino Nano with nRF24 connected to the computer that runs Home Assistant. This probably would not work because the sensors are in the backyard and the HA computer is in the garage which is at the front of the house.

              I have configured the Nano to be a gateway sans radio to which a sensor is connected. This is a very effective way to give the computer some I/O!

              TheoLT skywatchS 2 Replies Last reply
              0
              • OldSurferDudeO OldSurferDude

                Yes, nRF24 is attached to the RPi3B+ on which the gateway runs.

                I have long considered an Arduino Nano with nRF24 connected to the computer that runs Home Assistant. This probably would not work because the sensors are in the backyard and the HA computer is in the garage which is at the front of the house.

                I have configured the Nano to be a gateway sans radio to which a sensor is connected. This is a very effective way to give the computer some I/O!

                TheoLT Offline
                TheoLT Offline
                TheoL
                Contest Winner
                wrote last edited by TheoL
                #7

                @OldSurferDude What is the distance between your Gateway and the backyard Node?

                Also I'm experimenting with radio ranges. I wasn't really happy with the NRF range even when using a PA / LNA. The max I can get is a bit over 20 meters. That is without repeaters.

                I've created an RFM69 gateway with a Nano and added it as a second gateway to Domoticz. On that gateway I soldered a DIY antenna - not a long range - and that one has a range of over 70 meters. Measured with the GW inside an my battery powered test node was outside.

                For my test I just created a simple node that echo's the state of a binary sensor that I toggle each 5 seconds. I have two leds when for the sending and one for the receiving, so I could see where the border of my range is.

                So for my outside nodes I'm in the progress of replacing all the NRFs with RFM radios.

                Also when you change the caps to 100uf you should have a longer range and a more reliable network. But adding repeaters does help in extending the range.

                1 Reply Last reply
                0
                • OldSurferDudeO Offline
                  OldSurferDudeO Offline
                  OldSurferDude
                  wrote last edited by
                  #8

                  The distance to my sensors would be 20-30M through a fire separation wall, four interior walls, a ceiling and an external wall.

                  I, too, have done some experiments with the RFM69 and had the same experience. But they are about 10x the price of an nRF24. ($6.80 vs $0.68) The cost of the RPi zero 2W is $15 (though I've had two where the WiFi chip failed).

                  1 Reply Last reply
                  0
                  • OldSurferDudeO OldSurferDude

                    Yes, nRF24 is attached to the RPi3B+ on which the gateway runs.

                    I have long considered an Arduino Nano with nRF24 connected to the computer that runs Home Assistant. This probably would not work because the sensors are in the backyard and the HA computer is in the garage which is at the front of the house.

                    I have configured the Nano to be a gateway sans radio to which a sensor is connected. This is a very effective way to give the computer some I/O!

                    skywatchS Offline
                    skywatchS Offline
                    skywatch
                    wrote last edited by
                    #9

                    @OldSurferDude If you have a pi2 or pi4 you could try with that instead of the pi3. Pi3 was known for being a bit 'different' with some applications. A quick and simple test if you can.

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


                    23

                    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