August 24.2024
Over the weekend, I built a … thing.
I had a spare Raspberry Pi 4B gathering dust that needed a project. So (in no way influenced by my social media feed), I set out to build a self-hosted GPS-backed NTP server.
By the time I was done, I had a Stratum-1 NTP server with GPS PPS input and microsecond-level accuracy. A fully self-hosted Stratum-1 NTP server using a Raspberry Pi 4B, GPS hat, and PPS signal input — delivering microsecond accuracy from your own home lab.
- ✅ Microsecond-accurate time sync (Stratum-1)
- 📡 GPS + PPS integration via Adafruit GPS Hat
- 🐧 Raspberry Pi OS Lite 64-bit
- 🔧 Rebuild-ready scripts and full config exports
- 📁 Project structure includes tooling, configs, documentation, and original blog source
- Raspberry Pi 4B
- Adafruit Ultimate GPS Hat (product)
- Active GPS antenna (example) with SMA → IPEX adapter
- Pi OS 64-bit Lite + SD card
.
├── images/ # Photos of hardware setup
├── ntp-configs/ # Exported configs and status snapshots
├── scripts/ # Build, export, and validation tools
├── source_blog/ # Original guide reference (katron.org)
├── LICENSE
└── README.md
To set up from scratch or rebuild an existing config:
cd scripts/
sudo ./ntp-toolkit.shYou'll be presented with a menu to:
- Build a new NTP server
- Restore previously exported configs from
ntp-configs/ - Export current live config
- Run validation tests
All exported configs and status are located in ntp-configs/:
chrony.conf– NTP server core configgpsd,pps-sources.rules– GPS/PPS integrationconfig.txt,cmdline.txt– Pi boot overlayschronycoutput – time sync & source stabilityntpshmmon,gpspipe– diagnostics & fix status
Use:
sudo ./scripts/build.sh --restore ./ntp-configs/To verify GPS lock, PPS detection, and time sync:
cd scripts/
sudo ./test_gps.shIt checks for:
- PPS device presence
- GPSD and Chrony service status
- GPS fix status via
gpspipe - NTP source tracking and stability
Photos of the build can be found in images/. A few examples:
- GPS hat mounted to Pi
- Antenna placement
- Terminal output from
chronyc,gpsmon, etc.
This project was inspired by Katron.org. Original Post: https://katron.org/blog/2021/10/raspberry-pi-gps/
and if the blog gets taken down, here is a local copy of the page:
📖 katron-rp1-GPS.html
The full referenced files are available in source_blog/katron-rp1-GPS_files/
MIT License – see LICENSE
⌚ Happy timing from tick.local