Page 1 of 1

Schedule reboot issue

Posted: 18 Jan 2021, 09:51
by asuz
I want to restart my nodemcu once a day. So i put a script like that.

Code: Select all

On Clock#Time=All,12:00 Do
 Reboot
EndOn
but each time esp reboot at that time it keep restarting for 1 minute because after restart it see that time is 12:00 again it restarts, that keep restarting until 12:01, how can i solve that issue?

Re: Schedule reboot issue

Posted: 18 Jan 2021, 10:35
by Ath
- Define a Dummy Device (on Task: 5 name=Reboot, variable: 1 name=Last, in my case)
- Change your code like this:

Code: Select all

On Clock#Time=All,12:00 Do
  If [Reboot#Last]<>%sysday%
    TaskValueSet,5,1,%sysday% // Will survive a reboot, not a power-cycle
    Reboot
  EndIf
EndOn
NB: Untested!

Re: Schedule reboot issue

Posted: 18 Jan 2021, 10:51
by Micha_he
Or start a 60s timer at your time (12:00) and reboot when the timer expire.

Re: Schedule reboot issue

Posted: 18 Jan 2021, 18:49
by asuz
Ath wrote: 18 Jan 2021, 10:35 - Define a Dummy Device (on Task: 5 name=Reboot, variable: 1 name=Last, in my case)
- Change your code like this:

Code: Select all

On Clock#Time=All,12:00 Do
  If [Reboot#Last]<>%sysday%
    TaskValueSet,5,1,%sysday% // Will survive a reboot, not a power-cycle
    Reboot
  EndIf
EndOn
NB: Untested!
That fits my need, thank you very much.