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. Hardware
  3. Is it worth it adding a reset circuit to MySensors nodes?

Is it worth it adding a reset circuit to MySensors nodes?

Scheduled Pinned Locked Moved Hardware
11 Posts 8 Posters 173 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.
  • EncryptE Offline
    EncryptE Offline
    Encrypt
    wrote on last edited by
    #1

    Helloes 👋

    I am back on the forums with a quite simple question for you :)

    I am currently finishing to design a PCB for a MySensors project with "elementary" components: an ATMEGA328P as microcontroller, an HLK-PM03 as power supply, an RFM69W as radio...
    This node will be directly connected to mains, therefore the only way to reboot it is to remove the fuse at the fuse box, which isn't very handy.

    This made me wonder: is it worth adding a reset circuit (connected to the RESET pin of the microcontroller) to a MySensors node?
    In other words, have you ever experienced issues with your nodes that required a power cycle / reset?

    I'm in touch with a MySensors user (brianx) over IRC (#mysensors on Freenode, which I invite you to join :P ). He told me that one of his nodes sometimes freezes and power cycling isn't very easy.

    On my side, I built a MySensors "pilot wire" node a few months ago. Sometimes, after something like 15 days to a month, the node also freezes: it stops responding to any command, including network discovery requests.
    I didn't add an electrolytic capacitor to the prototype -- which probably doesn't help -- but I guess a reset circuit could be worth in the final version of the board.

    So what are your opinions / experiences?

    Come have fun with me on IRC: #mysensors on Libera.chat :)

    sundberg84S 1 Reply Last reply
    0
    • EncryptE Encrypt

      Helloes 👋

      I am back on the forums with a quite simple question for you :)

      I am currently finishing to design a PCB for a MySensors project with "elementary" components: an ATMEGA328P as microcontroller, an HLK-PM03 as power supply, an RFM69W as radio...
      This node will be directly connected to mains, therefore the only way to reboot it is to remove the fuse at the fuse box, which isn't very handy.

      This made me wonder: is it worth adding a reset circuit (connected to the RESET pin of the microcontroller) to a MySensors node?
      In other words, have you ever experienced issues with your nodes that required a power cycle / reset?

      I'm in touch with a MySensors user (brianx) over IRC (#mysensors on Freenode, which I invite you to join :P ). He told me that one of his nodes sometimes freezes and power cycling isn't very easy.

      On my side, I built a MySensors "pilot wire" node a few months ago. Sometimes, after something like 15 days to a month, the node also freezes: it stops responding to any command, including network discovery requests.
      I didn't add an electrolytic capacitor to the prototype -- which probably doesn't help -- but I guess a reset circuit could be worth in the final version of the board.

      So what are your opinions / experiences?

      sundberg84S Offline
      sundberg84S Offline
      sundberg84
      Hardware Contributor
      wrote on last edited by
      #2

      @Encrypt - i have a reset on My boards and use them.

      Controller: Proxmox VM - Home Assistant
      MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
      MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
      RFLink GW - Arduino Mega + RFLink Shield, 433mhz

      1 Reply Last reply
      0
      • BearWithBeardB Offline
        BearWithBeardB Offline
        BearWithBeard
        wrote on last edited by
        #3

        I didn't experience a node which stopped working after a certain time so far, but I recently had an incident where I lost the contents of my persistence file in Home Assistant - a file where all presented nodes are listed, so that Home Assistant can display their values, toggle switches, etc.

        Since then I regret not having added a reset button to my nodes. Most of them are small battery / coin cell powered units, which means I had to open their enclosures and force re-presentation through a reset by removing the batteries.

        So I certainly learned my lesson there.

        • Make regular backups of the persistance file
        • Include hardware reset into new designs

        I guess I could also use smart sleep and send either I_REQUEST or I_REBOOT to my nodes in this case, but this would reduce battery life drastically due to the extended uptime.

        1 Reply Last reply
        0
        • fabyteF Offline
          fabyteF Offline
          fabyte
          wrote on last edited by
          #4

          Try to perform a system reset, not only a MCU reset. If only the MCU is reset, initializing the radio may fail (because it's in an undefined state) and the node does not start.

          Happened to me a few times with a nrf24 radio, I don't know how the RFM69 will behave.

          1 Reply Last reply
          0
          • EncryptE Offline
            EncryptE Offline
            Encrypt
            wrote on last edited by
            #5

            Hello everyone and thank you for your feedback so far!

            @BearWithBeard gave a good argument since I'm also using HomeAssistant.

            Moreover, adding such a circuit will only add €0.50 per board, so it sounds good!

            Come have fun with me on IRC: #mysensors on Libera.chat :)

            1 Reply Last reply
            0
            • bjacobseB Offline
              bjacobseB Offline
              bjacobse
              wrote on last edited by bjacobse
              #6

              Just wondering why not use Watchdog?, it's supposed to restart MCU when it freese.
              The watchdog shall be disabled before entering sleep state and enabled when wake up.

              I would recommend to set the watchdog to max time=8seconds. then you only need to clear the wdt every 7 sec :-)
              As I recall the default bootloader in Arduino, doesn't have the WDT enabled, so you shall flash Optiboot or similar bootloader

              I searched for an example:
              https://www.electronicwings.com/arduino/watchdog-in-arduino

              skywatchS 1 Reply Last reply
              1
              • bjacobseB bjacobse

                Just wondering why not use Watchdog?, it's supposed to restart MCU when it freese.
                The watchdog shall be disabled before entering sleep state and enabled when wake up.

                I would recommend to set the watchdog to max time=8seconds. then you only need to clear the wdt every 7 sec :-)
                As I recall the default bootloader in Arduino, doesn't have the WDT enabled, so you shall flash Optiboot or similar bootloader

                I searched for an example:
                https://www.electronicwings.com/arduino/watchdog-in-arduino

                skywatchS Offline
                skywatchS Offline
                skywatch
                wrote on last edited by
                #7

                @bjacobse Good point, but what happens if it freezes during sleep?

                bjacobseB 1 Reply Last reply
                0
                • skywatchS skywatch

                  @bjacobse Good point, but what happens if it freezes during sleep?

                  bjacobseB Offline
                  bjacobseB Offline
                  bjacobse
                  wrote on last edited by bjacobse
                  #8

                  @skywatch said in Is it worth it adding a reset circuit to MySensors nodes?:

                  @bjacobse Good point, but what happens if it freezes during sleep?

                  It's NOT possible, it's in sleep, it's an integrated part of the IC design, and such a bug would have been found many years ago. The ATmeag328 will go into a well defined state, which is sleep, until it's getting woken up, by an interrupt or a timer.
                  Naturally the registers are required to be setup up properly

                  As I wrote, you SHALL disable WDT (watchdog) prior entering sleepmode, and after wakeup then you enable WDT again, else the WDT will reset the Atmega328 while you are in sleeep ;-)

                  ATMeag328 documentation:
                  http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf

                  mfalkviddM skywatchS 2 Replies Last reply
                  1
                  • bjacobseB bjacobse

                    @skywatch said in Is it worth it adding a reset circuit to MySensors nodes?:

                    @bjacobse Good point, but what happens if it freezes during sleep?

                    It's NOT possible, it's in sleep, it's an integrated part of the IC design, and such a bug would have been found many years ago. The ATmeag328 will go into a well defined state, which is sleep, until it's getting woken up, by an interrupt or a timer.
                    Naturally the registers are required to be setup up properly

                    As I wrote, you SHALL disable WDT (watchdog) prior entering sleepmode, and after wakeup then you enable WDT again, else the WDT will reset the Atmega328 while you are in sleeep ;-)

                    ATMeag328 documentation:
                    http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf

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

                    @bjacobse I think MySensors will store the wdt state before going into sleep(), and restore the wdt state after waking up from sleep(). So I don't think sketch developers need to take care of that.

                    tekkaT 1 Reply Last reply
                    1
                    • mfalkviddM mfalkvidd

                      @bjacobse I think MySensors will store the wdt state before going into sleep(), and restore the wdt state after waking up from sleep(). So I don't think sketch developers need to take care of that.

                      tekkaT Offline
                      tekkaT Offline
                      tekka
                      Admin
                      wrote on last edited by tekka
                      #10

                      @mfalkvidd @bjacobse correct, WDT settings are saved and restored - see here https://github.com/mysensors/MySensors/blob/development/hal/architecture/AVR/MyHwAVR.cpp#L92 and https://github.com/mysensors/MySensors/blob/development/hal/architecture/AVR/MyHwAVR.cpp#L116-L119

                      1 Reply Last reply
                      2
                      • bjacobseB bjacobse

                        @skywatch said in Is it worth it adding a reset circuit to MySensors nodes?:

                        @bjacobse Good point, but what happens if it freezes during sleep?

                        It's NOT possible, it's in sleep, it's an integrated part of the IC design, and such a bug would have been found many years ago. The ATmeag328 will go into a well defined state, which is sleep, until it's getting woken up, by an interrupt or a timer.
                        Naturally the registers are required to be setup up properly

                        As I wrote, you SHALL disable WDT (watchdog) prior entering sleepmode, and after wakeup then you enable WDT again, else the WDT will reset the Atmega328 while you are in sleeep ;-)

                        ATMeag328 documentation:
                        http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf

                        skywatchS Offline
                        skywatchS Offline
                        skywatch
                        wrote on last edited by skywatch
                        #11

                        @bjacobse Thank you - I learn something new! :)

                        I have WDT enabled on one of the RF gateways and still it crashes (ir never sleeps as it is a GW node). I am using the stock bootloader (chinese clone uno) so I wonder if this is the issue. I will try and upload the optiboot to that GW node and see if it helps.

                        I also run a script in mycontroller to reboot the GW node if it is down, but that isn't working as I expected either..... Luckily I have plenty of time at home now, unluckily I have a lot of domestic chores and support a vulnerable person living at another address, so time for mysensors is still limited, at least for now.

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


                        27

                        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