force time sync by rules possible?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
_Cyber_
Normal user
Posts: 115
Joined: 20 Oct 2019, 09:46

force time sync by rules possible?

#1 Post by _Cyber_ » 16 Feb 2022, 19:22

hi,

by whatever reason, my esp32 does no like to sync it's time. installed is ESP_Easy_mega_20210114_normal_ESP32_4M316k
I rebooted it, I tcpdumped on the gateway, I can see the NTP communication but the ESP does not set it's time.

is there a possibility to set the time anyhow manually or trigger a NTP sync to hopefully get the unit to sync?
There are sunrise and sunset time rules which do not work currently. :-/

thanks!

BR
Alois

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

Re: force time sync by rules possible?

#2 Post by Ath » 16 Feb 2022, 19:30

You can start by installing a newer release of ESPEasy, the one you are using is > 1 year old, and many improvements have been made since then
/Ton (PayPal.me)

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

Re: force time sync by rules possible?

#3 Post by TD-er » 16 Feb 2022, 21:30

See also the command datetime: https://espeasy.readthedocs.io/en/lates ... l-commands
For the WiFI issues, see Tools -> Advanced: https://espeasy.readthedocs.io/en/lates ... l-settings
If available on your version:
- Send with max TX power: checked
- Periodical WiFi scan: unchecked
- Send Gratuituous ARP: checked

_Cyber_
Normal user
Posts: 115
Joined: 20 Oct 2019, 09:46

Re: force time sync by rules possible?

#4 Post by _Cyber_ » 17 Feb 2022, 08:07

thank you - with this I could set the time. sadly %sunrise% and %sunset% is still at 0:00
I found out, if I use a public ntp server the ESP syncs well. if I use my own it does not sync. trying to switch from openntpd to ntpd maybe this helps. but currently I have again time set on the device :geek:

currently I am afraid in updating - I still did not read about a fix for still beeing able to connect without manual intervention to the hidden AP SSIDs. or was this fixed without a release note mention?
the device is obstructed and I do not want to have half a day of work because of this. :-(

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

Re: force time sync by rules possible?

#5 Post by Ath » 17 Feb 2022, 10:19

I have never set the ntp server, only enabled NTP, then it uses the NTP pool, that automagically selects the closest ntp server for you.
/Ton (PayPal.me)

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

Re: force time sync by rules possible?

#6 Post by TD-er » 17 Feb 2022, 20:49

What NTP service do you run locally?
Is it part of your router?
What port is it using? Is it in the same subnet?

The pool.ntp.org default (when no NTP host is configured) is working fine most of the time.

_Cyber_
Normal user
Posts: 115
Joined: 20 Oct 2019, 09:46

Re: force time sync by rules possible?

#7 Post by _Cyber_ » 30 Mar 2022, 10:00

so, the good thing, the NTP is working again flawless. I switched from openntpd to ntpd. I still have no idea why openntpd did not work relyable with ESP's.
besides this I have update all of my ESPs to the latest version. all? no, there was one which struggles. It is the ESP32 which is in charge for controlling the shutters.
there is a quite huge ruleset and I recognized that ESP_Easy_mega_20220328 needs quite a lot more time to handle these big rules.

compared to the old ESP_Easy_mega_20210114 it needs nearly the time twice for the same tasks. is something like this known?

this leads to shutters which drive instead of 2 seconds nearly 5 seconds (the GPIO's are pulsed with LongPulse) and therefore they have a complete different position. :-(

e.g. the log from ESP_Easy_mega_20220328:

Code: Select all

489539: HTTP: event,ControlZ2=10
489569: EVENT: controlz2=10
489975: ACT : Let,5,3
489981: ACT : Let,6,2
490013: ACT : Let,7,=0.00
490020: ACT : Let,8,40
490025: ACT : Let,9,41
490030: ACT : Let,10,45
490035: ACT : Let,11,44
490041: ACT : event,ControlShutter=10,26,25,18
490044: EVENT: ControlShutter=10,26,25,18
490269: ACT : Let,12,18
490275: ACT : Let,13,(18/100)*10
490283: ACT : Let,14,(18/100)*0
490326: ACT : Let,12,1.8-0
490337: ACT : logentry,'GPIO=26,25_close_secs=1.79999995231628'
490339: GPIO=26,25_close_secs=1.79999995231628
490383: ACT : gpio,2,0
490385: GPIO : port#2: set to 0
490390: ACT : TimerSet,8,2
490396: ACT : TaskValueSet,3,4,1
490417: ACT : LongPulse,26,0,2
490419: GPIO : port 26. Pulse set for 2000 ms
490446: ACT : gpio,25,1
490449: GPIO : port#25: set to 1
490454: ACT : Let,41,1
490471: ACT : Let,40,2
490481: ACT : Let,44,33672
490507: ACT : Let,15,2
490514: ACT : Let,16,33672
490522: ACT : loopTimerSet_ms,5,1000,2
491541: ACT : Let,5,3
491546: ACT : Let,6,3
491555: ACT : Let,7,=0.00
491561: ACT : Let,8,45
491566: ACT : Let,9,46
491571: ACT : Let,10,40
491576: ACT : Let,11,49
491583: ACT : event,ControlShutter=10,13,27,18
491586: EVENT: ControlShutter=10,13,27,18
491842: ACT : Let,12,18
491849: ACT : Let,13,(18/100)*10
491856: ACT : Let,14,(18/100)*0
491896: ACT : Let,12,1.8-0
491905: ACT : logentry,'GPIO=13,27_close_secs=1.79999995231628'
491907: GPIO=13,27_close_secs=1.79999995231628
491924: ACT : gpio,2,0
491926: GPIO : port#2: set to 0
491930: ACT : TimerSet,8,2
491936: ACT : TaskValueSet,3,4,1
491945: ACT : LongPulse,13,0,2
491948: GPIO : port 13. Pulse set for 2000 ms
491978: ACT : gpio,27,1
491980: GPIO : port#27: set to 1
491986: ACT : Let,46,1
492004: ACT : Let,45,2
492013: ACT : Let,49,33672
492040: ACT : Let,15,2
492048: ACT : Let,16,33672
492055: ACT : loopTimerSet_ms,5,1000,2
493960: EVENT: Rules#Timer=5,1
493977: ACT : Let,17,33677-33672
493985: ACT : Let,16,33677
493992: ACT : Let,15,2-5
494109: ACT : Let,40,2-5
494116: ACT : Let,43,0+5
494133: ACT : Let,43,5+-3
494140: ACT : asyncevent,finishz2l=2
494157: ACT : Let,45,2-5
494164: ACT : Let,48,0+5
494181: ACT : Let,48,5+-3
494188: ACT : asyncevent,finishz2r=2
494374: ACT : SendToHTTP,192.168.0.250,80,/apcucollector.php?smartswitch=RollladenManager&ipv4=192.168.10.233&uptime=8&load=44.16&free
495556: EVENT: Rules#Timer=8,1
496006: ACT : logentry,'Power still needed (SZ#M=0 Z1#M=0 Z2#M=1 Z3#M=0)'
496009: Power still needed (SZ#M=0 Z1#M=0 Z2#M=1 Z3#M=0)
496012: ACT : TimerSet,8,1
497165: EVENT: finishz2l=2
497804: ACT : Let,63,=0.00
497810: ACT : Let,64,40
497815: ACT : Let,65,41
497821: ACT : Let,66,42
497826: ACT : Let,67,43
497832: ACT : event,StateShutter=2,18,3,2
497834: EVENT: StateShutter=2,18,3,2
498000: ACT : Let,40,-3-1
498009: ACT : Let,69,1
498021: ACT : Let,43,0
498030: ACT : Let,42,(0+(100/18)*1*2)
498058: ACT : Let,40,0
498065: ACT : Let,41,0
498129: ACT : TaskValueSet,3,2,11.1111111111111
499212: ACT : TaskValueSet,3,1,((11.11+0.00)/2)
499224: ACT : Let,40,0
499229: ACT : Let,42,0
499252: ACT : TaskValueSet,3,4,0
499259: ACT : Let,40,0
499264: ACT : Let,42,0
499269: ACT : Let,45,0
499274: ACT : Let,47,0
499906: EVENT: Rules#Timer=5,2
499923: ACT : Let,17,33677-33677
499931: ACT : Let,16,33677
499937: ACT : Let,15,-3-0
500119: ACT : Let,48,2+0
500126: ACT : asyncevent,finishz2r=2
500310: ACT : SendToHTTP,192.168.0.250,80,/apcucollector.php?smartswitch=RollladenManager&ipv4=192.168.10.233&uptime=8&load=44.16&free
501498: EVENT: Rules#Timer=8,1
501725: ACT : logentry,'No Movement, Power off'
501727: No Movement, Power off
501752: ACT : gpio,2,1
501755: GPIO : port#2: set to 1
501758: ACT : TimerSet_ms,5,0
501760: TIMER: disable timer
501869: ACT : SendToHTTP,192.168.0.250,80,/apcucollector.php?smartswitch=RollladenManager&ipv4=192.168.10.233&uptime=8&load=44.16&free
503111: EVENT: finishz2r=2
503769: ACT : Let,63,=0.00
503775: ACT : Let,64,45
503781: ACT : Let,65,46
503786: ACT : Let,66,47
503791: ACT : Let,67,48
503797: ACT : event,StateShutter=2,18,3,3
503799: EVENT: StateShutter=2,18,3,3
503986: ACT : Let,45,0-1
503994: ACT : Let,69,1
504006: ACT : Let,48,0
504015: ACT : Let,47,(0+(100/18)*1*2)
504042: ACT : Let,45,0
504049: ACT : Let,46,0
504113: ACT : TaskValueSet,3,3,11.1111111111111
505199: ACT : TaskValueSet,3,1,((11.11+11.11)/2)
505212: ACT : Let,40,0
505217: ACT : Let,42,0
505237: ACT : TaskValueSet,3,4,0
505244: ACT : Let,40,0
505249: ACT : Let,42,0
505254: ACT : Let,45,0
505259: ACT : Let,47,0
505832: EVENT: finishz2r=2
506514: ACT : Let,63,=11.11
506520: ACT : Let,64,45
506526: ACT : Let,65,46
506532: ACT : Let,66,47
506537: ACT : Let,67,48
506543: ACT : event,StateShutter=2,18,3,3
506545: EVENT: StateShutter=2,18,3,3
506708: ACT : Let,45,0-1
506715: ACT : Let,69,0
506728: ACT : Let,48,0
506738: ACT : Let,47,(11.1099996566772+(100/18)*0*2)
506766: ACT : Let,45,0
506773: ACT : Let,46,0
506839: ACT : TaskValueSet,3,3,11.1099996566772
507921: ACT : TaskValueSet,3,1,((11.11+11.11)/2)
507933: ACT : Let,40,0
507938: ACT : Let,42,0
507958: ACT : TaskValueSet,3,4,0
507966: ACT : Let,40,0
507971: ACT : Let,42,0
507976: ACT : Let,45,0
507981: ACT : Let,47,0
compared to the log from ESP_Easy_mega_20210114:

Code: Select all

791317: HTTP: event,ControlZ2=10
791408: EVENT: controlz2=10
791516: ACT  : Let,5,3
791520: ACT  : Let,6,2
791561: ACT  : Let,7,=0.00
791565: ACT  : Let,8,40
791569: ACT  : Let,9,41
791572: ACT  : Let,10,45
791576: ACT  : Let,11,44
791580: ACT  : event,ControlShutter=10,26,25,18
791583: EVENT: ControlShutter=10,26,25,18
791646: ACT  : Let,12,18
791651: ACT  : Let,13,(18/100)*10
791657: ACT  : Let,14,(18/100)*0
791680: ACT  : Let,12,1.8-0
791687: ACT  : logentry,'GPIO=26,25_close_secs=1.79999995231628'
791690: GPIO=26,25_close_secs=1.79999995231628
791741: ACT  : gpio,2,0
791743: GPIO : port#2: set to 0
791745: ACT  : TimerSet,8,2
791750: ACT  : TaskValueSet,3,4,1
791756: ACT  : LongPulse,26,0,2
791759: GPIO : port 26. Pulse set for 2000 ms
791774: ACT  : gpio,25,1
791776: GPIO : port#25: set to 1
791780: ACT  : Let,41,1
791792: ACT  : Let,40,2
791799: ACT  : Let,44,34867
791815: ACT  : Let,15,2
791821: ACT  : Let,16,34867
791826: ACT  : loopTimerSet_ms,5,1000,2
792135: ACT  : Let,5,3
792139: ACT  : Let,6,3
792178: ACT  : Let,7,=0.00
792182: ACT  : Let,8,45
792186: ACT  : Let,9,46
792189: ACT  : Let,10,40
792193: ACT  : Let,11,49
792197: ACT  : event,ControlShutter=10,13,27,18
792200: EVENT: ControlShutter=10,13,27,18
792262: ACT  : Let,12,18
792267: ACT  : Let,13,(18/100)*10
792273: ACT  : Let,14,(18/100)*0
792295: ACT  : Let,12,1.8-0
792303: ACT  : logentry,'GPIO=13,27_close_secs=1.79999995231628'
792305: GPIO=13,27_close_secs=1.79999995231628
792369: ACT  : gpio,2,0
792371: GPIO : port#2: set to 0
792374: ACT  : TimerSet,8,2
792379: ACT  : TaskValueSet,3,4,1
792385: ACT  : LongPulse,13,0,2
792387: GPIO : port 13. Pulse set for 2000 ms
792403: ACT  : gpio,27,1
792405: GPIO : port#27: set to 1
792409: ACT  : Let,46,1
792420: ACT  : Let,45,2
792427: ACT  : Let,49,34867
792441: ACT  : Let,15,2
792447: ACT  : Let,16,34867
792452: ACT  : loopTimerSet_ms,5,1000,2
793455: EVENT: Rules#Timer=5,1
793472: ACT  : Let,17,34869-34867
793478: ACT  : Let,16,34869
793483: ACT  : Let,15,2-2
793538: ACT  : Let,40,2-2
793543: ACT  : Let,43,0+2
793551: ACT  : Let,43,2+0
793557: ACT  : asyncevent,finishz2l=2
793565: ACT  : Let,45,2-2
793570: ACT  : Let,48,0+2
793579: ACT  : Let,48,2+0
793584: ACT  : asyncevent,finishz2r=2
793725: ACT  : SendToHTTP,192.168.0.250,80,/apcucollector.php?smartswitch=RollladenManager&ipv4=192.168.10.233&uptime=13&load=18.66&fre
794050: EVENT: finishz2l=2
794285: ACT  : Let,63,=0.00
794290: ACT  : Let,64,40
794294: ACT  : Let,65,41
794298: ACT  : Let,66,42
794302: ACT  : Let,67,43
794306: ACT  : event,StateShutter=2,18,3,2
794309: EVENT: StateShutter=2,18,3,2
794358: ACT  : Let,40,0-1
794365: ACT  : Let,69,1
794373: ACT  : Let,43,0
794380: ACT  : Let,42,(0+(100/18)*1*2)
794397: ACT  : Let,40,0
794402: ACT  : Let,41,0
794436: ACT  : TaskValueSet,3,2,11.1111111111111
794755: ACT  : TaskValueSet,3,1,((11.11+0.00)/2)
794762: ACT  : Let,40,0
794766: ACT  : Let,42,0
794778: ACT  : TaskValueSet,3,4,0
794782: ACT  : Let,40,0
794786: ACT  : Let,42,0
794789: ACT  : Let,45,0
794793: ACT  : Let,47,0
794959: EVENT: finishz2r=2
795234: ACT  : Let,64,45
795240: ACT  : Let,65,46
795244: ACT  : Let,66,47
795248: ACT  : Let,67,48
795252: ACT  : event,StateShutter=2,18,3,3
795254: EVENT: StateShutter=2,18,3,3
795303: ACT  : Let,45,0-1
795309: ACT  : Let,69,1
795317: ACT  : Let,48,0
795324: ACT  : Let,47,(0+(100/18)*1*2)
795341: ACT  : Let,45,0
795346: ACT  : Let,46,0
795384: ACT  : TaskValueSet,3,3,11.1111111111111
795752: ACT  : TaskValueSet,3,1,((11.11+11.11)/2)
795760: ACT  : Let,40,0
795763: ACT  : Let,42,0
795774: ACT  : TaskValueSet,3,4,0
795779: ACT  : Let,40,0
795783: ACT  : Let,42,0
795786: ACT  : Let,45,0
795790: ACT  : Let,47,0
795934: EVENT: Rules#Timer=8,1
796059: ACT  : logentry,'No Movement, Power off'
796061: No Movement, Power off
796063: ACT  : gpio,2,1
796065: GPIO : port#2: set to 1
796067: ACT  : TimerSet_ms,5,0
796069: TIMER: disable timer
796169: ACT  : SendToHTTP,192.168.0.250,80,/apcucollector.php?smartswitch=RollladenManager&ipv4=192.168.10.233&uptime=13&load=18.66&fre
can I do anything or do I need to stay at ESP_Easy_mega_20210114 ?

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: force time sync by rules possible?

#8 Post by chromo23 » 30 Mar 2022, 11:11

_Cyber_ wrote: 17 Feb 2022, 08:07 thank you - with this I could set the time. sadly %sunrise% and %sunset% is still at 0:00
did you enter your longitude and latitude in the location settings? Otherwise this will not work...

_Cyber_
Normal user
Posts: 115
Joined: 20 Oct 2019, 09:46

Re: force time sync by rules possible?

#9 Post by _Cyber_ » 30 Mar 2022, 11:30

yes, both are set correct

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

Re: force time sync by rules possible?

#10 Post by TD-er » 30 Mar 2022, 12:26

I can't think of a reason why the rules parsing should be significantly slower in recent builds.
Maybe you should open a new topic about it, including the rules.

There has been some changes in rules parsing, like more extensively parsing floating point values, but that should not be really noticable.

Longpulse should not be depending on the rules execution (unless there is some blocking code) as it schedules its own moment to turn the GPIO pin down again.
What I do see in your log, is that it calls an "event,ControlShutter" before the longpulse was finished.

Maybe I can add an optional feature to log when an event is done being handled, which may help debugging things like these.
The same for the end of a LongPulse.

One other thing that may affecting execution speed on ESP32 is the type of file system used.
LittleFS and SPIFFS work rather different, where LittleFS is typically faster when reading, but (extremely) slower when writing settings.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 101 guests