Reboot inside rules?

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
alabama
Normal user
Posts: 90
Joined: 24 Nov 2017, 10:04

Reboot inside rules?

#1 Post by alabama » 21 Oct 2018, 10:38

Sometimes I have the problem that my NodeMCU-V3 seems stops working. But I'm not sure whether it really completly stops or only the wifi connection is broken and the devise itself continues running. This happens sometimes after days or even weeks, sometimes after hours. So my idea is to give a reboot command inside the rules sets. Simples one can be to general reset after the main action of the NodeMCU-V3 (watering the garden in the night), more complicate it shall reboot if the wifi connection is broken.

Is something like that possible? The other way will be to do this from outside like I do with other devices; Ping it from my FHEM and if there is no answers break the voltage for some seconds by another FHEM-device. This is not the elegantes way, I prefer the method inside the NodeMCU-V3.

Has someone same problems?

Code: Select all

Build	20102 - Mega
Libraries	ESP82xx Core 00000000, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3
GIT version	mega-20180826
Plugins	46 [Normal]
Build Md5	68b5a4e37d60a2651976a1c4178e370
Md5 check	passed.
Build time	Aug 26 2018 02:14:44
Binary filename	ESP_Easy_mega-20180826_normal_ESP8266_4096.bin
Last edited by alabama on 21 Oct 2018, 12:28, edited 1 time in total.

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: Reboot inside rules?

#2 Post by Domosapiens » 21 Oct 2018, 12:16

You don't mention your version ...
More recent versions (November? / October) do have stability issues.

For the older version (ESPEasy_v2.0.0-dev11) with the 49 day bug, I use this rule

Code: Select all

On Uptime#MUC1_Uptime do
if [Uptime#MUC1_Uptime]>60000
 Reboot
endif
endon
Where:
Uptime is a System Info task with Variable MUC1_Uptime
it reboots the unit after 60000 minutes.

You could try 1440 to force a daily reboot and see if it helps
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

alabama
Normal user
Posts: 90
Joined: 24 Nov 2017, 10:04

Re: Reboot inside rules?

#3 Post by alabama » 21 Oct 2018, 12:32

You are right, I have added some information in the first post. Thanks.

Ok, I'll ry the reboot rule like your's. I have seen in the command reference that this is only an internal command. But if it' valid also for rules it will be exactly what I have searched.

I try this:

Code: Select all

On Clock#Time=All,00:50 do
 Reboot
endOn
and see tomorrow

Thank you!

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: Reboot inside rules?

#4 Post by chunter1 » 22 Oct 2018, 12:58

I am using the "Connection Failure Threshold" setting under Tools=>Advanced.
Set it to 30 and it will reboot after 30 connection failures.

alabama
Normal user
Posts: 90
Joined: 24 Nov 2017, 10:04

Re: Reboot inside rules?

#5 Post by alabama » 22 Oct 2018, 15:29

The reboot was done last night. But just now my NodeMCU-V3 stops to send me information and I can't connect. So I have to wait until 00:55 next night to see if it reboots again. Next I'll try the "Connection Failure Threshold".

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Reboot inside rules?

#6 Post by grovkillen » 22 Oct 2018, 17:23

You could do a wifidisconnect just before the reboot command just to be on the sure side.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

alabama
Normal user
Posts: 90
Joined: 24 Nov 2017, 10:04

Re: Reboot inside rules?

#7 Post by alabama » 22 Oct 2018, 21:06

Ok, I'll try it. Can I use all "internal"-commands in the rules?

EDIT: Oh oh, is written in the documentation. :oops:
Last edited by alabama on 22 Oct 2018, 21:37, edited 1 time in total.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Reboot inside rules?

#8 Post by grovkillen » 22 Oct 2018, 21:32

Yep they are very much internal when inside the rules :)
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

alabama
Normal user
Posts: 90
Joined: 24 Nov 2017, 10:04

Re: Reboot inside rules?

#9 Post by alabama » 23 Oct 2018, 08:19

grovkillen wrote: 22 Oct 2018, 17:23 You could do a wifidisconnect just before the reboot command just to be on the sure side.
Can you tell me why this is the "sure side"?

My rebbot last night works and the NodeMCU-V3 is running. So it's true, its only the connection to the network that domn' work. The device itself runs.

Just now I have updated the firmware to

Code: Select all

Firmware
Build:⋄	20102 - Mega
Libraries:⋄	ESP82xx Core 2_4_1, NONOS SDK 2.2.1(cfd48f3), LWIP: 1.4.0-RC2
GIT version:⋄	mega-20181022
Plugins:⋄	46 [Normal]
Build Md5:	9cef131dabb8e8555ff540276f8dfaea
Md5 check:	passed.
Build time:⋄	Oct 22 2018 02:16:57
Binary filename:⋄	ESP_Easy_mega-20181022_normal_ESP8266_4096.bin
My first OTA-Update for ESPEasy and it works fine without any problems :D

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Reboot inside rules?

#10 Post by grovkillen » 23 Oct 2018, 10:04

Giving the "wifidisconnect" command will let the router/access point know that you (the unit) is going away from the network. Thus you will be sure that the network will greet the unit welcome once it returns online.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

alabama
Normal user
Posts: 90
Joined: 24 Nov 2017, 10:04

Re: Reboot inside rules?

#11 Post by alabama » 24 Oct 2018, 08:07

Hmmm, now I saw that the "Reboot-Rule" is done 7 times this night, because there are 7 events while this process between 00:55 and 00:56.
On the other side I understand that the "Connection Failure Threshold" does the restart in any case if the number 30 of connection failures is reached, even if there in the meantime are successful connections. I thought that this only happens if the failures are direct one after the other and counter will be set to 0 if there is a successful connection. Not bad, but good to know.

Of cause, all this measures are workarounds and not really the best solution, so it's okay so.

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: Reboot inside rules?

#12 Post by chunter1 » 24 Oct 2018, 09:42

alabama wrote: 24 Oct 2018, 08:07 On the other side I understand that the "Connection Failure Threshold" does the restart in any case if the number 30 of connection failures is reached, even if there in the meantime are successful connections. I thought that this only happens if the failures are direct one after the other and counter will be set to 0 if there is a successful connection. Not bad, but good to know.
I would appreciate if the logic behind the "Connection Failure Threshold" could be modified to something like this:

A) Reboot if 30 consecutive connection attempts fail, otherwise reset fail-counter
B) Reboot if 30 connection attempts fail within a specified timeframe

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: Reboot inside rules?

#13 Post by mackowiakp » 30 Oct 2018, 07:19

Hmmm, now I saw that the "Reboot-Rule" is done 7 times this night, because there are 7 events while this process between 00:55 and 00:56.
As I understand Your problem, try my solution for reboot rule

Code: Select all

On Clock#Time=All,3:25 do 
  timerSet 3,55
Endon

on Rules#Timer=3 do
  Reboot
endon
That means. At 3:55 AM run timer for 55 seconds and after that reboot unit. After reboot it takes several seconds do sync NTP and after that, sys time is 3:26, so the rule will not run again at the same minute.

alabama
Normal user
Posts: 90
Joined: 24 Nov 2017, 10:04

Re: Reboot inside rules?

#14 Post by alabama » 30 Oct 2018, 08:25

That's a good idea, as far as I understand it. But I have only one problem with it: I already use all 8 possible timers in this unit. So I will see if there is one that I can use twice.

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: Reboot inside rules?

#15 Post by mackowiakp » 30 Oct 2018, 08:28

OK, it was only the sample. Below full rule I use. I reboot my unit 3 times per day.

Code: Select all

On Clock#Time=All,16:05 do 
  timerSet 3,55
Endon

On Clock#Time=All,8:25 do 
  timerSet 3,55
Endon

On Clock#Time=All,3:25 do 
  timerSet 3,55
Endon

on Rules#Timer=3 do
  Reboot
endon

alabama
Normal user
Posts: 90
Joined: 24 Nov 2017, 10:04

Re: Reboot inside rules?

#16 Post by alabama » 30 Oct 2018, 10:49

Yes, I understand your priniple: delay the reboot until 5 seconds before the next full minute. That's a good idea.

I use this NodeMCU for controlling my watering sytstem in the gartden and for this control I use all possible timers. So I must rearrange my rules to use your idea. But this needs some time. Now the watering season is over and some other projects are in the foreground....
My system seems to work and the many reboots while this minute are not really a problem. But anyway it shall be changed.

Thank you for your tip.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Reboot inside rules?

#17 Post by grovkillen » 30 Oct 2018, 10:55

alabama wrote: 30 Oct 2018, 08:25 That's a good idea, as far as I understand it. But I have only one problem with it: I already use all 8 possible timers in this unit. So I will see if there is one that I can use twice.
Are they all used at the same time or can you use one for more than one assignment? I mean, you don't need to use separate timers if they are not running in parallel.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: Reboot inside rules?

#18 Post by mackowiakp » 30 Oct 2018, 10:56

Try to use CRON, the feature released just today officially instead timers if possible.

wernieman
Normal user
Posts: 13
Joined: 03 Jun 2018, 20:42

Re: Reboot inside rules?

#19 Post by wernieman » 30 Oct 2018, 11:37

Is there a doku for the feature cron?

Sorry but I don't found it ...

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: Reboot inside rules?

#20 Post by mackowiakp » 30 Oct 2018, 12:04

I dont think so. But it is physically in "test" FW.

alabama
Normal user
Posts: 90
Joined: 24 Nov 2017, 10:04

Re: Reboot inside rules?

#21 Post by alabama » 30 Oct 2018, 12:47

grovkillen wrote: 30 Oct 2018, 10:55 Are they all used at the same time or can you use one for more than one assignment? I mean, you don't need to use separate timers if they are not running in parallel.
No, they are not used the same time. But I have to learn how to avoid the triggered action in the unused part, perhaps something like if ... else

But of cause, I have to learn much more about the language of the rules.

@mackowiakp: Thanks for the tip. Up to now I never used the test-FW, perhaps I shoud do so. Last weekend I had a lot of time used to test several FW-versions, but with some ESP8266-01 - that's another story....

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Reboot inside rules?

#22 Post by manjh » 25 Nov 2018, 15:11

grovkillen wrote: 23 Oct 2018, 10:04 Giving the "wifidisconnect" command will let the router/access point know that you (the unit) is going away from the network. Thus you will be sure that the network will greet the unit welcome once it returns online.
If it is recommendable to do a WifiDisconnect before the reboot, then why not build this into the ESPEasy core? Every Reboot command would then imply a WifiDisconnect done before the actual reboot takes place.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Reboot inside rules?

#23 Post by manjh » 20 Jan 2019, 10:28

I have used "On Clock#Time=Sun,04:00 do " to trigger a reboot once a week, in order to prevent the 49 day crash. It is working well, but I think I want to change this into a reboot once a month.
How can I do this? I've looked at the wiki, looking for something like "Clock#Date", but somehow can't find it.
Can someone point me in the right direction?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Reboot inside rules?

#24 Post by grovkillen » 20 Jan 2019, 11:39

You could add a counter which is adding +1 each day at a given time. Once the timer hit 30 you do a reboot.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: Reboot inside rules?

#25 Post by Domosapiens » 20 Jan 2019, 12:02

To prevent the 49 day bug:

A Task: System Info, called Uptime
With Variable MUC1_Uptime

Rule:

Code: Select all

On Uptime#MUC1_Uptime do
if [Uptime#MUC1_Uptime]>60000
 Reboot
endif
endon
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Reboot inside rules?

#26 Post by manjh » 20 Jan 2019, 12:06

grovkillen wrote: 20 Jan 2019, 11:39 You could add a counter which is adding +1 each day at a given time. Once the timer hit 30 you do a reboot.
Sounds like a workaround... does this mean that "date" is not available in rules in the same way as "time"?

When I use this method, the unit will reboot every 30 days, not every month. Perhaps not a big deal in this situation.

Alternative is to control the reboots from Domoticz. But I would rather keep things local, if I can.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Reboot inside rules?

#27 Post by manjh » 20 Jan 2019, 12:13

Domosapiens wrote: 20 Jan 2019, 12:02 To prevent the 49 day bug:

A Task: System Info, called Uptime
With Variable MUC1_Uptime

Rule:

Code: Select all

On Uptime#MUC1_Uptime do
if [Uptime#MUC1_Uptime]>60000
 Reboot
endif
endon
Looks like a straightforward way of preventing the bug.
Just out of curiosity: why the 60000 limit? Arbitrary?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Reboot inside rules?

#28 Post by grovkillen » 20 Jan 2019, 12:39

manjh wrote: 20 Jan 2019, 12:06
grovkillen wrote: 20 Jan 2019, 11:39 You could add a counter which is adding +1 each day at a given time. Once the timer hit 30 you do a reboot.
Sounds like a workaround... does this mean that "date" is not available in rules in the same way as "time"?

When I use this method, the unit will reboot every 30 days, not every month. Perhaps not a big deal in this situation.

Alternative is to control the reboots from Domoticz. But I would rather keep things local, if I can.
You can use the sysday variable if you want to. But I thought you wanted to do it after a given number of days.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: Reboot inside rules?

#29 Post by Domosapiens » 20 Jan 2019, 13:25

Just out of curiosity: why the 60000 limit? Arbitrary?
Nice and round:
60000 minutes is 41,6 days
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Reboot inside rules?

#30 Post by manjh » 20 Jan 2019, 18:04

grovkillen wrote: 20 Jan 2019, 12:39
manjh wrote: 20 Jan 2019, 12:06
grovkillen wrote: 20 Jan 2019, 11:39 You could add a counter which is adding +1 each day at a given time. Once the timer hit 30 you do a reboot.
Sounds like a workaround... does this mean that "date" is not available in rules in the same way as "time"?

When I use this method, the unit will reboot every 30 days, not every month. Perhaps not a big deal in this situation.

Alternative is to control the reboots from Domoticz. But I would rather keep things local, if I can.
You can use the sysday variable if you want to. But I thought you wanted to do it after a given number of days.
Not after a given number of days. Ideally I would want to reboot on the first day of the month, at a specific time. This way I can synchronize the reboot of all of my ESPs, and in Domoticz I can see their uptime all being the same. Makes it easy to spot any abnormalities.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Reboot inside rules?

#31 Post by grovkillen » 20 Jan 2019, 18:31

So each day at a set time, look and see if sysday is equal to 1. If so, reboot.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Reboot inside rules?

#32 Post by manjh » 29 Jan 2019, 21:52

OK, I finally got around to putting this change into all (almost 20) of my ESP units.
This is the piece of code that I put into all rules tabs:

Code: Select all

on %sysday% = 1 do
  on Clock#Time=All,03:30 do 
    timerSet 8,59
  endon
endon
on Rules#Timer=8 do
  WifiDisconnect
  Reboot
endon
This will reboot the unit at the first day of the month, at 03:30 to minimize impact.
The delay of 59 seconds is there to prevent multiple reboots, since the ESP can be back up-and-running quite quickly, and would then reboot again.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Reboot inside rules?

#33 Post by grovkillen » 29 Jan 2019, 22:07

There you go. Good job :D
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

megamarco83
Normal user
Posts: 230
Joined: 13 Apr 2017, 23:09

Re: Reboot inside rules?

#34 Post by megamarco83 » 31 Jan 2019, 00:41

i would like to reboot the system after 240min, so i try this code
but is not working, why?

Code: Select all

On %uptime%=240 do
    timerSet 1,58
endo

on Rules#Timer=1 do
  WifiDisconnect
  Reboot
endon
i'm using the latest version of espeasy on nodemcu
i see that i reach 240min of uptime and then go to 241min without reboot

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Reboot inside rules?

#35 Post by grovkillen » 31 Jan 2019, 05:39

"On ... Do" will only fire if the event happens. %systime% is not an event, only a variable. You should do it like this:

Code: Select all

On System#Boot do
    timerSet,1,14400
Endon

on Rules#Timer=1 do
  WifiDisconnect
  Reboot
endon
PS. Your code doesn't have a correct "EndOn" on the first chunk. It says "endo". The last "n" is missing.

EDIT: manjh is implying that your %sysday%= is indeed a än event. So that means that the only error in your rule is the "EndOn" mistake.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

megamarco83
Normal user
Posts: 230
Joined: 13 Apr 2017, 23:09

Re: Reboot inside rules?

#36 Post by megamarco83 » 31 Jan 2019, 15:21

Hi yes i wrote wrong "endon" miss the "n"

but i try again with this code:

Code: Select all

On %uptime%=644 do
    timerSet 1,58
endon

on Rules#Timer=1 do
  WifiDisconnect
  Reboot
endon
but esp is not reboot.
here the log

38582470: WD : Uptime 643 ConnectFailures 0 FreeMem 14168 WiFiStatus 3
38612461: WD : Uptime 644 ConnectFailures 0 FreeMem 12600 WiFiStatus 3
38638913: EVENT: Clock#Time=Thu,15:17
38642461: WD : Uptime 644 ConnectFailures 0 FreeMem 14168 WiFiStatus 3
38672461: WD : Uptime 645 ConnectFailures 0 FreeMem 14168 WiFiStatus 3
38698912: EVENT: Clock#Time=Thu,15:18
38702461: WD : Uptime 645 ConnectFailures 0 FreeMem 14168 WiFiStatus 3
38732485: WD : Uptime 646 ConnectFailures 0 FreeMem 12600 WiFiStatus 3

why?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Reboot inside rules?

#37 Post by grovkillen » 31 Jan 2019, 15:52

Then it's the %uptime% is not an event.

Try this:

Code: Select all

On Clock#Time=All,**:** Do
 If %uptime%>10
   WifiDisconnect
   Reboot
 EndIf
EndOn
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Reboot inside rules?

#38 Post by manjh » 31 Jan 2019, 16:44

megamarco83 wrote: 31 Jan 2019, 15:21 Hi yes i wrote wrong "endon" miss the "n"

but i try again with this code:

Code: Select all

On %uptime%=644 do
    timerSet 1,58
endon

on Rules#Timer=1 do
  WifiDisconnect
  Reboot
endon
but esp is not reboot.
here the log

38582470: WD : Uptime 643 ConnectFailures 0 FreeMem 14168 WiFiStatus 3
38612461: WD : Uptime 644 ConnectFailures 0 FreeMem 12600 WiFiStatus 3
38638913: EVENT: Clock#Time=Thu,15:17
38642461: WD : Uptime 644 ConnectFailures 0 FreeMem 14168 WiFiStatus 3
38672461: WD : Uptime 645 ConnectFailures 0 FreeMem 14168 WiFiStatus 3
38698912: EVENT: Clock#Time=Thu,15:18
38702461: WD : Uptime 645 ConnectFailures 0 FreeMem 14168 WiFiStatus 3
38732485: WD : Uptime 646 ConnectFailures 0 FreeMem 12600 WiFiStatus 3

why?
Try the code from the post from Domosapiens earlier in this string of posts...

megamarco83
Normal user
Posts: 230
Joined: 13 Apr 2017, 23:09

Re: Reboot inside rules?

#39 Post by megamarco83 » 31 Jan 2019, 22:42

grovkillen wrote: 31 Jan 2019, 15:52 Then it's the %uptime% is not an event.

Try this:

Code: Select all

On Clock#Time=All,**:** Do
 If %uptime%>10
   WifiDisconnect
   Reboot
 EndIf
EndOn
hi, is now working, the esp is reboot now!
thans

but i find some issue on reboot...the esp will not connect again :(

182498: WD : Uptime 3 ConnectFailures 0 FreeMem 14176 WiFiStatus 3
>> NetworkError when attempting to fetch resource. <<
>> NetworkError when attempting to fetch resource. <<
>> NetworkError when attempting to fetch resource. <<
>> NetworkError when attempting to fetch resource. <<
>> NetworkError when attempting to fetch resource. <<
>> NetworkError when attempting to fetch resource. <<
>> NetworkError when attempting to fetch resource. <<


if i remove power and give it back again after a while, the esp become connected and working....why this happened??
thanks

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Reboot inside rules?

#40 Post by grovkillen » 01 Feb 2019, 09:22

Is it the web log you mean? Tried to refresh it just as a test?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

megamarco83
Normal user
Posts: 230
Joined: 13 Apr 2017, 23:09

Re: Reboot inside rules?

#41 Post by megamarco83 » 01 Feb 2019, 11:12

yes, correct it's the web log

i try to refresh the brawser but esp is not responding

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Reboot inside rules?

#42 Post by grovkillen » 01 Feb 2019, 12:00

How long do you wait for the log to start catching up? If it takes the unit 30 seconds to start up everything the web log will not fetch anything for minimum 30 seconds.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

megamarco83
Normal user
Posts: 230
Joined: 13 Apr 2017, 23:09

Re: Reboot inside rules?

#43 Post by megamarco83 » 01 Feb 2019, 12:10

i wait more than 10 minutes....
the only chace to have the esp alive was remove power and power on again

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Reboot inside rules?

#44 Post by grovkillen » 01 Feb 2019, 12:18

Maybe remove the WifiDisconnect command to see if it's something with that one making it not connect correctly. Or have a wifi connect command in the boot event?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

megamarco83
Normal user
Posts: 230
Joined: 13 Apr 2017, 23:09

Re: Reboot inside rules?

#45 Post by megamarco83 » 01 Feb 2019, 12:31

grovkillen wrote: 01 Feb 2019, 12:18 Maybe remove the WifiDisconnect command to see if it's something with that one making it not connect correctly. Or have a wifi connect command in the boot event?
what's the command to put inside the boot event?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Reboot inside rules?

#46 Post by grovkillen » 01 Feb 2019, 13:00

WifiConnect
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Reboot inside rules?

#47 Post by manjh » 07 Feb 2019, 18:41

The sysday solution seems to work for Mega units, not so good for build 147.
Does that make sense?

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: Reboot inside rules?

#48 Post by Domosapiens » 07 Feb 2019, 22:45

Does that make sense?
Yep,
Added around August 2017:
https://github.com/letscontrolit/ESPEasy/pull/485
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Reboot inside rules?

#49 Post by manjh » 10 Feb 2019, 21:59

Domosapiens wrote: 07 Feb 2019, 22:45
Does that make sense?
Yep,
Added around August 2017:
https://github.com/letscontrolit/ESPEasy/pull/485
Great, just my luck. I use a mix of Mega and B147. I could upgrade, but some units are hidden away and I don't feel like digging them out for this reason. Upgrading OTA does not always work from B147 to Mega, I found out the hard way. Needs a physical USB connection to get things right.

So, I am back to the "uptime" method, have changed the rules in all of my units.Now to wait and see if they reboot.

megamarco83
Normal user
Posts: 230
Joined: 13 Apr 2017, 23:09

Re: Reboot inside rules?

#50 Post by megamarco83 » 11 Feb 2019, 14:50

manjh wrote: 10 Feb 2019, 21:59
Great, just my luck. I use a mix of Mega and B147. I could upgrade, but some units are hidden away and I don't feel like digging them out for this reason. Upgrading OTA does not always work from B147 to Mega, I found out the hard way. Needs a physical USB connection to get things right.

So, I am back to the "uptime" method, have changed the rules in all of my units.Now to wait and see if they reboot.
sorry for asking a litte bit off topic, but there is a way to update ESP with 1mb with new firmware using OTA ?
i see that there are the two step bin file but how to use it? thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests