NTP Client / Local NTP Server support

I think that you're right!
It looks like it's not happening again.

Thanks!

2 Likes

If I am reading this right, I can use this to make sure the time is getting updated even without a local time server? How does one get the IP of a remote time server? Or determine which one to use?

I really don't think it makes sense to set this driver up with a remote server. That is exactly what Hubitat is already doing today. It uses NTP with a remote server.
This driver allows you to specify any NTP server, but it is really meant to provide an ability to use a local (on you home network) NTP server.

You can set it up with a remote server, no questions, but you don't gain any benefit.

To get the IP of a remote NTP server, you can just use ping, e.g.:

ping pool.ntp.org
PING 171.66.97.126 (171.66.97.126) 56(84) bytes of data.
64 bytes from 171.66.97.126: icmp_seq=1 ttl=39 time=62.7 ms
64 bytes from 171.66.97.126: icmp_seq=2 ttl=39 time=62.7 ms
64 bytes from 171.66.97.126: icmp_seq=3 ttl=39 time=62.7 ms

The IP would be 171.66.97.126

1 Like

I guess what I was thinking here. I read somewhere that HE checks the time at midnight or something. If it couldn't read the time then it would be 24 hours before checking again. But I may be mistaken on that. So many posts to look thur it's easy to miss something.

The max drift in 24 hours would be on the order of a few seconds. As I understand it, @dan.t's NTP client, along with a local ntpd, solves an issue where HE gets hung booting if the internet is unavailable.

Yes, that is really where most, if not all, of the problems have been seen.
e.g. After a power outage, your Hubitat and Internet Modem boots up. Most of the time, your hubitat boots faster than your internet being available and Hubitat can't get the current date/time. That is where my driver comes in, it can check a local NTP server and set the hubs time and it can do it on a configurable time interval.

I am not sure if that is 100% accurate, but even if it is, the problem only comes in if the hub time was wrong in the first place. Based on my testing with this driver, I have not seen a large drift of time by the hub that would justify the need to check a NTP more frequently.

1 Like

I see very little drift on my Hubitat I do run this just to be safe and have it connected to my Stratum 1 Raspberry-PI time server. I also capture port 123 requests on my router and re-write the requests to go to my Pi. I got tired of Android, Apple, and the others that want to use their own time servers.

The Pi was a geek project to work on with my son and we stood up Pi-vpn, Pi-hole, and the time server as a summer project.

What are using to keep Raspberry’s time up to date?

@ronv42 says its a Stratum 1 RPi, so it has to be directly connected to a hardware reference clock.

2 Likes

A Stratum 1 server receives its time from a GPS receiver that is connected to the PI and delivers the time intervals in pulse per second

4 Likes

A GPS receiver...

3 Likes