Auto reset node.



  • Hi,
    Here the thing,
    I'm using domoticz(on raspberry) +serialgateway+nrf24L01 plus one node.

    My node is a 4 relays node used for watering my garden.
    My node and the gateway are separated for 1m
    In fact, the node is outside, but there were a hole in the wall so i brought back the rfn24L01 attached to my node inside. Gateway and node works fine together.

    My problem is : something like twice a week Gateway stop reaching the node and the problem persist until a do a reset on the node!
    (a reset on my raspberry and gateway, don't solve anything)

    When i'm home, it's not a big deal but if i'm in holiday for 4 week, my garden will not be watered.

    I'm thinking about setting up a watchdog on the node.
    but i don't know nature of the problem:
    if NRF24L01+ module has crashed or if Arduino nano is crashed, it's different;

    I would like to setup something like this:
    I setup a watchdog on the node.
    The gateway send a specific serial command each minutes to the node, and the node use this command to reset watchdog timer.
    is there a way of doing this ?

    I probably could build a .c program on my raspberry to send a command to the node but i would like to do this from the gateway.

    Thank,
    Eric.


  • Mod

    You could try to check istransportready or sanitycheck and if they return false after 4 or 5 times call a delay (60000) and if you enabled the avr watchdog it should reset the node



  • I would suggest to find the problem instead of treating the symptom.
    I had similar problem with a outside node. Lost contact after 3-4 days. Had to switch from electrolytical capacitor to tantalum on the power of the nrf24 to solve the problem. Of course there can be other causes, but it feels much better when the real problem is solved.


  • Mod

    Watchdog is always a good thing to have anyway



  • Thank you both of you,
    i done a mix :
    i setup a watchdog using istransportready and i added a capacitor to the NRF24 (i know i had to but i haden't done it yet, so now it's done).
    for now, it seems working, i'll post a feedback in few days.
    Bye,
    Eric.



  • @eric007 It is possible to know if the watchdog have restarted? Otherwise you wont know which solution worked. But that it is working may be good enough 😃


  • Mod

    you could send millis every time you send data, if you see the millis starting from 0 you had a reset. Maybe there is a more elegant way of doing it



  • Hi,
    It works fine!!! No more signal issue.

    However, i don't know wich solution has worked but the idea of ​​testing the millis function is perfect and should give a clue.

    Thank for advices, it was so helpfull.

    I'll post something when i'll have more details.

    Eric.



  • @gohan yes, i was thinking about using eeprom memory to set a data just before reaching timeout watchdog and use this data at next startup to decide if Arduino has been reseted by watchdog or not.
    But using millis function is more clever and don't use eeprom memory.
    Thank,
    Eric.


  • Mod

    The capacitor is probably the best option to solve stability issues on nrf24


Log in to reply
 

Suggested Topics

80
Online

11.4k
Users

11.1k
Topics

112.7k
Posts