The Raspberry Pi as a Stratum-1 NTP Server (2012)
satsignal.eu
satsignal.eu
For serious DIY players, BeagleBone hardware has both hardware timestamping on ethernet and hard realtime IO capabilities through the PRU interface (used for PPS signal from your GPSDO). It makes a ridiculously superior (orders of magnitude) time server compared to Rpi.
The general concept still works fine but you will have to research more up-to-date documentation.
These are my notes from the last time I did it, which are pretty scratchy, but hopefully you can glean something useful from them:
I’ve had a buildroot image on a Pi 4 for over a year now, and it appears to be accurate to within 10 microseconds.
https://github.com/jrockway/beaglebone-gps-clock
My guide is also quite out of date, but I did rebuild it from scratch a couple years ago by following my own instructions and they worked ;)
Some discussion on HN this morning: https://news.ycombinator.com/item?id=28141493
I never got SNMP/MRTG logging running correctly, but that's not a big deal to me for now.
I have been trying to make an accurate and precise raspberry pi desk clock. The key thing I need is PPS output. The older Uputronics modules drop the PPS signal when there isn't a 4-point lock. They also don't have an on-board RTC but the new ones do (grumble grumble).
I haven't been able to compile any repos that enable PTP emulation yet, but I haven't tried in the past year. The proper solution is probably to just buy another (newer) module with fewer quirks. The RTC alone would have saved me from an hour of headaches bootstrapping my home network.
https://timemachinescorp.com/product/gps-time-server-tm1000a...
One would think both interfaces would suffer the same problems, after all.
It's not the prettiest but works brilliantly.
Now just waiting for Raspbian to respin to be Bullseye based so that I can update to a version of chrony with NTS support.
(And I think you can upgrade RpiOS to bullseye right now. It's not "officially" out but it seems to work anyway.)
On older Pi versions USB is run in kernel instead of on chip, causing thousands of cpu interrupts per second. Also its on board ethernet is run through USB.
See https://docs.microsoft.com/en-us/windows-server/networking/w...
However, I'm doing research into being able to turn this into a short range WWVB transmitter as I like radio clocks but my area does not get good reception. So I suppose, there's an ultimate end goal there.
I made one for my Citizen RF synced watch. It works.
So a nice middle ground is to buy a separate RTC and attach it via the I2C GPIO pins. The modules are ~$10 including shipping. I wrote up the software setup recently here: https://github.com/scottlamb/moonfire-nvr/wiki/System-setup#...
Though I suppose that anyone that has strict time needs has multi-protocol GPS / GLONASS / Galileo / BeiDo receivers so it would take a huge disaster to knock out the time signal entirely.
To remove these dependencies, we’ve built a new dedicated piece of hardware called Time Appliance, which consists of a GNSS receiver and a miniaturized atomic clock (MAC). Users of time appliances can keep accurate time, even in the event of GNSS connectivity loss. While building our Time Appliance, we also invented a Time Card, a PCIe card that can turn any commodity server into a time appliance.
https://engineering.fb.com/2021/08/11/open-source/time-appli...
https://news.ycombinator.com/item?id=28140732
I didn't even know that a "Miniaturized Atomic Clock" was a thing.
Looks like they cost a couple thousand dollars, but that's probably not a bad price for what you get.
some other discussion from a few years ago: