WiFi time provider with NTP support.

More
1 year 2 months ago #10126 by Stackerlee
Yes, of course that's the easiest way but it doesn't really test the specific conditions of the DST changes.
I have another clock that was defined to change to summer time 2019-03-31 02:00. The code was written to define this as 4th sunday (last) in March. But in this case it was the 5th sunday and the changeover was done a week too soon. To catch these kind of conditions it would be more reliable to have a fake NTP source rather than fake the DST occurances.

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #10127 by MikeS
It would be simple to set up ntp on a Raspberry Pi. If set to use the undisciplined local clock driver, it will send out whatever time the local clock is set to.

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #10128 by Stackerlee
@MikeS
I'm not so friendly with Linux to find that easy, however I have set up a local NTP server on my Windows computer
www.meinbergglobal.com/english/sw/ntp.htm#ntp_stable
which allows me to set the local clock (which an be set to anything) as reference.
This works fine (I can confirm by syncing other devices to it) but I find that the ESP8266 does not update the time automatically, I have to force "do full update now", then it updates. I know it can take up to a minute to update but it never happens until I force it.
I guess this is what @TexasPenguin also has noticed(?)
I use your (MikeS) latest version, suffix C.
Any thoughts on this?

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #10129 by Stackerlee
...The DST time change works well though. It changes immediately on set conditions.
Given that it is sync'd to the NTP server (fake or not).

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #10130 by Stackerlee
The NTP polling interval?

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #10131 by MikeS

Stackerlee wrote: I find that the ESP8266 does not update the time automatically, I have to force "do full update now", then it updates. I know it can take up to a minute to update but it never happens until I force it.

There are two different updates - getting time from the ntp server, and sending time to the clock.

It only gets an update from the ntp server every polling interval, which by default is about 2 hours. It uses that to set and maintain the time locally, and sends an update to the clock once per minute. "Do full update now" forces it to poll the ntp server immediately, then send the time to the clock. You can change the ntp polling interval to as low as every 10 minutes, but that should not be done if getting time from a public server. It should keep accurate time to within a small fraction of a second between 2 hour ntp polls, so there's little benefit from doing them more often.

On the Status page, I added a line which shows when the last ntp poll was done. It's in UTC (because of a bug in the ntp library which doesn't report it correctly in local time), so you need to mentally convert it to local time.

Please Log in or Create an account to join the conversation.

Moderators: AccutronTy_EeberfestIan
Time to create page: 0.184 seconds

Search

Tube Suppliers

Go to top
JSN Boot template designed by JoomlaShine.com