Page 1 of 1
Issues with sunset
Posted: 06 May 2020, 19:32
by Mrwomble
Hi all,
I've got a project running with some events triggered at sunrise, 2 minutes before sunset and at sunset. The sunrise event is working just fine but the sunset triggers don't seem to be working. The log shows an event at the time, but nothing happens. Is there a known issue with the sunset timer in the latest build (ESP_Easy_mega-20200410_normal_ESP8266_4M1M on a Wemos D1 NodeMcu board)?
Re: Issues with sunset
Posted: 06 May 2020, 19:44
by grovkillen
How does your rule look like?
Re: Issues with sunset
Posted: 07 May 2020, 00:07
by TD-er
Like Jimmy suggested, please show the rules + the error.
There is no known issue with sunrise/sunset.
Re: Issues with sunset
Posted: 07 May 2020, 10:49
by Mrwomble
Thanks for the response.
These are the rules in question:
Code: Select all
on CoopClose do //-------Close coop
timerSet,2,20 //start timer, 10s
gpio,14,1 //activate motor
gpio,12,0
TaskValueSet 3,1,1 //Coopstatus
SendToHTTP maker.ifttt.com,80,/trigger/Coop_closed/with/key/cHEgUQg_iyUkaVZG-tOaV2 //IFTT
endon
on Motor_stop#State do //to stop motor, for CoopClose
gpio,14,0
gpio,12,0
endon
On Rules#Timer=2 do //stops motor turning if micro-switch not triggered
gpio,14,0
gpio,12,0
endon
// Sunrise/Sunset timers
on Clock#Time=All,%sunrise-20m% do //---------20mins before sunrise activation
event,CoopOpen
endon
on Clock#Time=All,%sunset-2m% do //---------2mins before sunset trigger, buzzer warning
rtttl,5:d=5,o=6,b=180,c,e,g
endon
on Clock#Time=All,%sunset% do //---------sunset trigger
event,CoopClose
endon
I don't get an error in the logs, but when I tried changing the entry for %sunset-2m% to run earlier so that I could test it, it would work occassionally and other times nothing would happen, but the logs would show this:
1262509: WD : Uptime 21 ConnectFailures 0 FreeMem 20800 WiFiStatus 3
1282666: EVENT: Clock#Time=Wed,17:52
1472509: WD : Uptime 25 ConnectFailures 0 FreeMem 20800 WiFiStatus 3
1502509: WD : Uptime 25 ConnectFailures 0 FreeMem 20800 WiFiStatus 3
1522665: EVENT: Clock#Time=Wed,17:56
Any ideas?
Re: Issues with sunset
Posted: 07 May 2020, 20:06
by TD-er
Can you have a look at the timing stats page (Tools => timing stats) ?
N.B. every time you load that page, the statistics are reset, so it is important to have a good look at the first load after running for a while, preferably after these rules executed.
Try to see if there is something that may take longer than a few-100 msec.
Also check if the node does run stable and not reboot quite often.
The more recent builds do keep the time after a crash (about a second offset per crash) but if you run a build older than 1 or 2 months old, then it may be the unit just hasn't got the time from a NTP server after a reboot.