No Rules without wifi?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
TungstenE2
Normal user
Posts: 123
Joined: 03 Apr 2018, 21:46

No Rules without wifi?

#1 Post by TungstenE2 » 19 May 2020, 08:53

Hi all,

I control my chicken door with espeasy and some rules.

I was always under the assumption that wifi is only needed after boot in oder to get NTP time and for the normal operations espeasy is working autonomously.

But it happened in the last weeks twice that after repeater was disconneted rules were not working and doors did not open.

So I was wondering why rules are not working, while NTP should have been available before and correct time was set.

Any ideas?

thx

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: No Rules without wifi?

#2 Post by TD-er » 19 May 2020, 09:46

Only recent builds have a new feature to store the time in RTC.
So at a warm boot, the unit will then restore the last known time from RTC.

Older builds don't have any clue of the time after a reboot, if there is no NTP available.

This was added in this commit: https://github.com/letscontrolit/ESPEas ... 60da90fd1f
So if your build was from before mega-20200228 it will not have this feature.

Still after a cold boot (power cycle), the unit will have lost the last known time.

TungstenE2
Normal user
Posts: 123
Joined: 03 Apr 2018, 21:46

Re: No Rules without wifi?

#3 Post by TungstenE2 » 19 May 2020, 11:44

Hi, I am not talking about a reboot of the D1 mini, but just loosing wifi signal.

So my assumption is, that espeasy should work fully (incl rules) once wifi is lost and NTP time was successfull set while wifi was available.

But I just see that the uptime is 13hrs, so it must have rebooted last night. Question is why it rebooted, as it was not me rebooting it.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: No Rules without wifi?

#4 Post by TD-er » 19 May 2020, 12:03

Well it can reboot for lots and lots of reasons.
For one, please check the value set for Connection Failure Threshold: (Tools -> Advanced at the end of the page)
If that's set to something other than 0, it will reboot after set connection attempts.

Also try a more recent build, like 20200426 (not the latest if you're having a flash chip with vendor ID 0x20)
This will at least let you keep the time in RTC at reboot.

TungstenE2
Normal user
Posts: 123
Joined: 03 Apr 2018, 21:46

Re: No Rules without wifi?

#5 Post by TungstenE2 » 19 May 2020, 13:09

Connection Failure Threshold: 0 and I am already on mega-20200426

Vendor: 0xC2

Any other ideas?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: No Rules without wifi?

#6 Post by TD-er » 19 May 2020, 13:22

TungstenE2 wrote: 19 May 2020, 13:09 Connection Failure Threshold: 0 and I am already on mega-20200426

Vendor: 0xC2

Any other ideas?
Probably it has experienced a power-loss then.
Or for some reason, the checksum in the RTC was not correct.
If the checksum is not correct at boot, the RTC will be cleared and thus you will loose any stored time information.

RTC checksum can be corrupted if it reboots while updating the information in RTC.

For such a setup, I guess the only proper way is to use an external clock.
The existing I2C clock chips out there are not yet turned into a plugin by me.
Another option can be to use a GPS module. Maybe a bit overkill and also not a good solution when running on batteries, but I guess that's not the case in your setup.

TungstenE2
Normal user
Posts: 123
Joined: 03 Apr 2018, 21:46

Re: No Rules without wifi?

#7 Post by TungstenE2 » 19 May 2020, 15:40

I do not believe in power-loss as powered by AC adapter.

Need to keep an eye on it.

The wifi was disconnected about 24hrs ago, but reboot about 17hrs ago, so in the middle of the night.
Wifi reconnected about 5hrs ago.

TungstenE2
Normal user
Posts: 123
Joined: 03 Apr 2018, 21:46

Re: No Rules without wifi?

#8 Post by TungstenE2 » 20 May 2020, 11:34

Hi all,

I found my chicken door not working last night.
This morning I was investigating and it seems like all rules are gone.

It was working yesterday morning fine and I did not do any changes to the rules.

Any idea how this can happen? Seems like the D1 mini reboots sometimes by itself.
Can this cause a loos of rules? All other settings and devices are still available.

Not sure if I have the latest rules version as backup.

thx

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: No Rules without wifi?

#9 Post by TD-er » 20 May 2020, 13:29

Rules gone, but also the settings?
If the unit does not detect a correct file system at boot, it formats the file system and starts all over again.
But that implies the settings are also wiped to default, not only a missing rules file.

TungstenE2
Normal user
Posts: 123
Joined: 03 Apr 2018, 21:46

Re: No Rules without wifi?

#10 Post by TungstenE2 » 20 May 2020, 20:13

all settings and devices are still available and working.
Only rules are gone. Also rules page looks strange. Please see issue with included screenshots.
https://github.com/letscontrolit/ESPEasy/issues/3081

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

Re: No Rules without wifi?

#11 Post by Ath » 20 May 2020, 21:06

TungstenE2 wrote: 20 May 2020, 20:13 Only rules are gone. Also rules page looks strange.
Have you been using the Rules with 'Old Engine' option disabled? I think it was default off a couple of releases ago, but been (re-)enabled by default shortly after that. This setting is hiding in the Tools / Advanced Settings page.
/Ton (PayPal.me)

TungstenE2
Normal user
Posts: 123
Joined: 03 Apr 2018, 21:46

Re: No Rules without wifi?

#12 Post by TungstenE2 » 20 May 2020, 22:22

Bingo!

Rules Settings/Old Engine was disabled.

This caused Rules to disappear and destroy Rules page.

Is this a bug or a feature?

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

Re: No Rules without wifi?

#13 Post by Ath » 20 May 2020, 22:47

TungstenE2 wrote: 20 May 2020, 22:22 Is this a bug or a feature?
Well, it's supposed to be a feature to create 1 rules file per event, but I'm not sure how to define a user-defined event here, as the # is a mandatory item in the name.

'Been there, done that' kinda situation (till I found that Old Engine checkbox :lol: )
/Ton (PayPal.me)

TungstenE2
Normal user
Posts: 123
Joined: 03 Apr 2018, 21:46

Re: No Rules without wifi?

#14 Post by TungstenE2 » 21 May 2020, 08:35

Okay, strange. I also tried to create new rules with new engine but always got an error for the name, but no detailed info about what was wrong with the name. Tried to search the wiki but no solution found.

So this issue is fixed for me and I will stay with old rules engine.

But the original issue with the device rebooting randomly and rules not working due to missing time after wifi lost is still pending. Will observe this.

Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests