This DIY Time Server Is More Accurate Than You Need

You almost certainly don’t have an application for the sort of accurate timekeeping that’s made possible by this enhanced version of [Cristiano Monteiro]’s satellite-backed time server. By his own admission, the vast majority of users will be more than happy to have their system’s time synchronized by the traditional Network Time Protocol (NTP). But if you’re really chasing those last few microseconds, that’s where the Precision Time Protocol (PTP) comes in.

With NTP, you can get within 10 milliseconds or so of your upstream time source — but PTP is accurate down to nanoseconds. Unless you’re performing some kind of scientific research, running a robotic assembly line, or perhaps doing high-speed financial trading, there’s no reason for this level of accuracy. In fact, PTP is such a niche technology that until the release of the ESP32-P4, [Cristiano] couldn’t even find an affordable enough chip that supported it.

Hardware-level support for PTP is important as there’s no way to achieve this level of accuracy with software alone, the capability needs to be baked into the Ethernet controller. As you might expect, it takes a highly accurate time source to make the most of PTP, and that’s where the navigation-grade Global Navigation Satellite System (GNSS) receiver comes in. All told the cost of the build is unsurprisingly higher than that of its predecessor, but [Cristiano] says it’s still a couple zeros shy of what a commercial offering would run.

As with his original time server from 2021, [Cristiano] made sure this build was as friendly as possible for hackers and makers. We especially like the 3D printed case designed in OpenSCAD, and his insistence that the gadget have a front panel with blinking status LEDs. Again, the vast majority of us don’t need our clocks to be accurate down to the nanosecond…but it’s nice to know we have the option.

Stratum 1 Grandmaster Time Server On A Budget

[Jeff Geerling] has been following the various open source time projects for some time now, and is finally able to demonstrate a working and affordable solution for nanoseconds-accurate timekeeping in your local lab. The possibility of a low-cost time server came about with the introduction of the Raspberry Pi CM4 compute module back in Oct 2020, whose Broadcom network chip (BCM54210PE) supports PTP (Precision Time Protocol, IEEE-1588) 1PPS output and hardware-based time stamping. Despite the CM4 data sheet specifying PTP support, it wasn’t available in the kernel. An issue was raised in Feb last year, and Raspberry Pi kernel support was finally released this month.

[Jeff] demonstrates how easy it is to get two CM4 modules to synchronize to within a few tens of nanoseconds in the video below the break. That alone can be very useful on many projects. But if you want really stable and absolute time, you need a stratum 1 external source. These time servers, called grandmasters in PTP nomenclature, have traditionally been specialized pieces of kit costing tens of thousands of dollars, using precision oscillators for stability and RF signals from stratum 0 devices like navigation satellites or terrestrial broadcast stations to get absolute time. But as Lasse Johnsen, who worked on the kernel updates remarks in the video:

In 2022 these purpose-built grandmaster clocks from the traditional vendors are about as relevant as the appliance web servers like the Raq and Qube were back in 1998.

It is now possible to build your own low-cost stratum 1 time server in your lab from open source projects. Two examples shown in the video. The Open Time Server project’s Timecard uses a GNSS satellite receiver and a Microchip MAC-SA5X Rubidium oscillator. If that’s overkill for your projects or budget, the Time4Pi CM4 hat is about to be release for under $200. If accurate time keeping is your thing, the technology is now within reach of the average home lab. You can also add PTP to a non-CM4 Raspberry Pi — check out the Real-Time HAT that we covered last year.

Continue reading “Stratum 1 Grandmaster Time Server On A Budget”