Microsecond accurate NTP with a Raspberry Pi and PPS GPS(2021)
10 points by juliethefoxcoon
10 points by juliethefoxcoon
It's a bit of a shame that while the original post is obviously fully hand-written, the updated post is apparently AI generated and contains verbose clanker code examples.
Overall the topic is very interesting, though.
I put 2 GPS receivers, a $12 GT-U7 and a $120 NEO-M8T, on my home network using his original article last summer. Every Linux host on my home network synched to within 1 millisecond of the NEO-M8T, and probably within 300 microseconds. The Raspberry Pi's that had the GPS receivers on them claimed to synch to within 100 nanoseconds of the GPS receivers.
I don't know much about GPS, but the two GPS receivers would decide to use different sets of satellites, even though they both had the same view of the eastern horizon.
Interesting. Is the next step to then use the Pi as your NTP in your network and configure all devices to use it as the authoritative NTP server? Wouldn't the error of that device-to-pi handshake be larger than the nanosecond precision anyway?
I think these hobbyists are just having fun seeing how high they can get precision on small/cheap devices, for the fun of it.
You almost certainly don't use NTP if you want very high levels of precision, you use something like PTP. Also, some network cards have hardware timestamping, so you can have the NIC handle a lot of the workload for you, which helps with device load. I can't remember off the top of my head, but I think one of the Pi's does this, but most of the models do not, though I might be misremembering.
It depends a lot on the use-cases you need, but most of these things are hobbyist level, where precision past one second is probably overkill. A Pi can definitely handle a 1 sec precision for pretty much all hobbyist applications.
If you need real time sync for some reason, you then need to make sure you understand how precise you need the time sync and design around that. NTP isn't designed for super precision, but in getting across large network sizes. There is a reason NTP basically runs time-sync for the internet at large. PTP and friends are designed for much higher precision but at the cost of much smaller network sizes.
The dream would be to have a Pi as a time source for all the "stupid" clocks in my house, like the microwave and oven... Then maybe they wouldn't constantly drift!