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. Mysensors 2.2.0: need to force restart of nodes if controller or gateway are not available. How to do?

Mysensors 2.2.0: need to force restart of nodes if controller or gateway are not available. How to do?

Scheduled Pinned Locked Moved Troubleshooting
7 Posts 3 Posters 1.8k Views 3 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.
  • S Offline
    S Offline
    sineverba
    Hardware Contributor
    wrote on last edited by sineverba
    #1

    Hi to all! My environment: Domoticz on RPI3 + Battery LIfePo4 nodes (temp/hum, baro etc). Preamble: all nodes with RFM69W and HW on the gateway. All is very stable from +3 months, no restart, all works as charme.

    From a couple of week I have issues with domoticz that hangs (I will need to solve, but this is another story).

    I need, absolutely, to force the nodes to check if uplink (gateway/domoticz) is "alive", if not, sleep and repeat for infinite, until I can restart Domoticz.

    In effect my nodes for the moment have this logic: try send for 30 times, if cannot receive an ACK delay 5000. I have watchdog at 2 sec, so of course the node restart. For same strange obscure reason, node hangs instead when Domoticz off.

    TL;DR:

    Currently, this is my sketch: https://pastebin.com/raw/0qWBn6iQ

    I found this instructions:

    https://www.mysensors.org/apidocs/group__RoutingNodeSettingGrpPub.html#ga7117d6c2ab335ad8a03caae3ef2c46e7

    If I did understand right, can I at the start of the sketch for node add simply:

    #define MY_TRANSPORT_SANITY_CHECK true
    #define MY_TRANSPORT_SANITY_CHECK_INTERVAL_MS 10 * 60 * 1000ul

    To check every 10 minutes the transport?

    1. What will be happening if transport is not ready? It will go to sleep? Eg. Node sleeping. Awaking after 10 minutes, tryng to transmit and No uplink available. It will be restart continuously? Is it possible to put in sleep for example 10 minutes and retry and go on?

    2. I cannot understand the purpose of:

    MY_SLEEP_TRANSPORT_RECONNECT_TIMEOUT_MS 10000 Timeout (in ms) to re-establish link if node is put to sleep and transport is not ready.

    (got here https://www.mysensors.org/download/sensor_api_20 )

    Thank you

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

      Hi,
      Are you sure about node hang ?
      i've read your sketch but i don't see wdt_reset().
      I'm not sure but for canceling watchdog timer shouldn't you call wdt_reset() ?
      that can't explain node hang but take a look.
      Eric.

      S 1 Reply Last reply
      0
      • gohanG Offline
        gohanG Offline
        gohan
        Mod
        wrote on last edited by
        #3

        I usually enable wdt at beginning of loop and disable it before sleep

        1 Reply Last reply
        0
        • E eric007

          Hi,
          Are you sure about node hang ?
          i've read your sketch but i don't see wdt_reset().
          I'm not sure but for canceling watchdog timer shouldn't you call wdt_reset() ?
          that can't explain node hang but take a look.
          Eric.

          S Offline
          S Offline
          sineverba
          Hardware Contributor
          wrote on last edited by
          #4

          @eric007 Yes, Im sure at 100%. No more transmit. Also if I heat sensors with my Hands (and After 6h the temp surely changed a bit). I think that wd reset is called internally by MyS. If controller and gateway are live, I have no issues. So I think (also answering to @gohan ) that It is not an issues....

          1 Reply Last reply
          0
          • gohanG Offline
            gohanG Offline
            gohan
            Mod
            wrote on last edited by
            #5

            What boards definitions are you using for arduino?

            S 1 Reply Last reply
            0
            • gohanG gohan

              What boards definitions are you using for arduino?

              S Offline
              S Offline
              sineverba
              Hardware Contributor
              wrote on last edited by
              #6

              @gohan do u mean bootloader? Optiboot with BOD @1.8 with AA and @2.7 with LifePo4

              1 Reply Last reply
              0
              • gohanG Offline
                gohanG Offline
                gohan
                Mod
                wrote on last edited by
                #7

                In arduino IDE, boards manager

                0_1529873291107_f4bc9c8e-0716-46a1-8264-54b05d8aa6ff-image.png

                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