Issues with sunset

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Mrwomble
New user
Posts: 2
Joined: 06 May 2020, 19:25

Issues with sunset

#1 Post by Mrwomble » 06 May 2020, 19:32

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)?

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

Re: Issues with sunset

#2 Post by grovkillen » 06 May 2020, 19:44

How does your rule look like?
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:

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

Re: Issues with sunset

#3 Post by TD-er » 07 May 2020, 00:07

Like Jimmy suggested, please show the rules + the error.
There is no known issue with sunrise/sunset.

Mrwomble
New user
Posts: 2
Joined: 06 May 2020, 19:25

Re: Issues with sunset

#4 Post by Mrwomble » 07 May 2020, 10:49

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?

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

Re: Issues with sunset

#5 Post by TD-er » 07 May 2020, 20:06

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.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 45 guests