Schedule reboot issue

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
asuz
Normal user
Posts: 175
Joined: 31 Oct 2018, 18:22

Schedule reboot issue

#1 Post by asuz » 18 Jan 2021, 09:51

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?

User avatar
Ath
Normal user
Posts: 3418
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Schedule reboot issue

#2 Post by Ath » 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!
/Ton (PayPal.me)

Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: Schedule reboot issue

#3 Post by Micha_he » 18 Jan 2021, 10:51

Or start a 60s timer at your time (12:00) and reboot when the timer expire.

asuz
Normal user
Posts: 175
Joined: 31 Oct 2018, 18:22

Re: Schedule reboot issue

#4 Post by asuz » 18 Jan 2021, 18:49

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests