tiagofreire-pt / rpi_uputronics_stratum1_chrony

A straightforward and highly optimized approach to achieve a cost-effective Stratum 1 NTP server using a Raspberry Pi 5B and an Uputronics GPS HAT
GNU General Public License v3.0
28 stars 1 forks source link
chrony ntp phc ptp raspberry-pi-5 stratum-1 ublox uputronics

Raspberry Pi 5B NTP Server - Stratum 1 (with Uputronics GPS HAT)

A straightforward and highly optimized approach to achieve a cost-effective (€200) and high performance Stratum 1 NTP server, disciplined with highly precise PPS (Pulse Per Second) sourced from the GNSS radio service plus NTP public servers across the internet to get the absolute time reference.

Can be prepared to be used with off-the-grid applications such as IoT in remote locations/air-gapped systems or WAN connected IoT ones (as presented here).

The end result with a fully assembled Raspberry Pi 5B and an Uputronics GPS/RTC HAT Ublox M8 engine vs 6.4:

The Server Fully Assembled

This is my recipe for Raspberry Pi OS lite version Bookworm, freshly installed, with kernel 6.1.73-1+rpt1.

Index

Achievements @ January 2024:

Scope Achievement Value
Timekeeping Precision ~ 2^(-26) s
Timekeeping PPS Jitter < 400 ns
Timekeeping Frequency < 200 ppb
Service Clients > 160
Service RMS offset < 100 ns

Optimizations @ January 2024:

(non exaustive)

Sample metrics:

Chrony vs 4.5 server tracking statistics after 1 day of uptime:

Chrony tracking after 1 day of uptime

Chrony vs 4.0 client tracking statistics after 1 day of uptime:

Chrony tracking after 1 day of uptime

Chrony vs 4.0 client tracking ntpdata of this server, after 1 day of uptime:

Chrony ntpdata after 1 day of uptime

List of materials and tools needed

Mandatory:

Optional :

Step-by-step tutorial

For this tutorial, you have 3 major steps. Being the last 2 of them optional, but highly recommended, as achieves huge and superior accuracy and precision.

  1. Setup the server
  2. Advanced Ublox M8 tuning
  3. Advanced system tuning

Acknowledgments

  1. Conor Robinson, for his cooperation and shared knowledge
  2. Anthony Stirk, for his openess to help and cooperate on a further hardware improvement (stay tuned!)

References