Inexpensive Stratum 1 Time Server

What is a Stratum 1 Time Server, you might ask? Simply put it is a network appliance that receives PRECISE time from a source such an an atomic clock or GPS Pulse Per Second (PPS).
This accurate time source is then used to provide a time resource to client computers.
Time is VERY important to computers.
Probably the most famous Stratum 1 time server is from the National Institute of Standards and Technology (NIST). They famously broadcast the time over radio, telephone, and internet. Here is an example of their shortwave radio broadcasts.
Is Computer Time Critical?
Short answer, yes. Probably the most critical application comes from the world of banking and financial trades. imagine if you could bend time to make a financial transaction occur before or after it actually did. What if I knew the very microsecond a stock would see a huge gain or loss and adjust for that to, as Cher put it, Turn Back Time.
How about the synchronization of infrastructure such as traffic lights? Other industries such as medical, aerospace, satellite, rocketry, etc. require nanosecond to microsecond accuracy. Heck, even in my world of being an amateur radio operator digital systems such as FT8 and FT4 require accuracy down to a fraction of a second. During field day operations, ham radio operators will use a Stratum 1 time server to obtain accurate time while not connected to the internet. Even being off 1 second can disrupt many of the communication modes.
Make Your Own Stratum 1 Time Server
It’s super easy to make your own Stratum 1 Time Server. Essentially you need:
- Raspberry Pi computer – even an old Pi 3 or Pi Zero works fine
- GNSS Hat or USB GPS puck or breakout board with PPS- Here is an example HAT.
- GNSS Antenna
Some salient points to make. Your Raspberry Pi should be connected to wired ethernet. The example HAT device I posted above is $138. This can actually be accomplished with a far cheaper GPS device that can be had for as little as $6 or so. I won’t link to any device because they typically are counterfeited devices. They are however, actual GPS chips but they are just not what they say they are. The only requirement is that they have a PPS pin to obtain accurate pulses per second from GPS satellites.
By the way, GPS satellites carry atomic clocks.
Finally, the Waveshare GNSS HAT device I linked to above is the most accurate one I have come across in my testing. Many other GPS boards and pucks I have used work just fine but the Waveshare NEO-M8T is really accurate. Guess what the “T” stands for? Yep. Time.
My Level Of Accuracy Obtained

My system time is 5 NANOSECONDS fast of NTP time..
A NANOSECOND IS ONE BILLIONTH OF A SECOND.
Yep, you heard that right. My Raspberry Pi Stratum 1 time server is that accurate. There is some fluctuation that occurs from temperature, and digital noise and there are ways to mitigate it somewhat. But for the sake of argument something that is accurate from 100-300 nanoseconds is still considered great timing.
Quick Configuration
Install the HAT and attach a decent GPS antenna.
Install dependencies:
sudo apt update
sudo apt install gpsd gpsd-clients pps-tools chrony
Then my configuration is as follows:
Modify /boot/firmware/config.txt NOTE: This only applies to the Waveshare NEO-M8T. Other devices have other configurations.
sudo nano /boot/firmware/config.txt
dtoverlay=pps-gpio,gpiopin=18
dtparam=uart0=on
dtoverlay=disable-wifi
dtoverlay=disable-bt
Now reboot. Once rebooted you will have a device name called ttyAMA0. You can plug that into GPSD like so:
sudo nano /etc/default/gpsd
Make sure yours looks like this. Again if using another device your serial port assignment could be different.
GPSD
# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
DEVICES="/dev/ttyAMA0"
# Other options you want to pass to gpsd
GPSD_OPTIONS="-n"
# Automatically hot add/remove USB GPS devices via gpsdctl
USBAUTO="false"
START_DAEMON="true"
Chrony
Now to configure crony.
sudo nano /etc/chrony/chrony.conf
I have added the following lines to the very bottom of the file.
# NMEA data from the USB port via GPSD
refclock SHM 0 offset 0.000 delay 0.200 refid NMEA
# Direct hardware PPS from the GPIO 18 wire
refclock PPS /dev/pps0 lock NMEA refid PPS prefer trust
# Allow any device on your local subnet to query this time server
allow 192.168.1.0/24
# Lock chrony to RAM to prevent memory swapping
lock_all
Regarding the time server address entry, ensure that yours matches YOUR network. Not mine.
Finally, enable chrony and gpsd to start at boot
sudo systemctl enable chrony
sudo systemctl enable gpsd
the reboot. You can manually restart gpsd or chrony but a clean reboot is a good idea here.
Testing
Once rebooted you can make sure your device is using PPS from your GNSS device
chronyc sources -v
It should look like this. Give it a minute or two to select PPS. It will likely start with another address selected. You are looking for the entry that has an asterisk (*) next to it.

And as you can see mine is using PPS.
Now do this:
chronyc tracking
And this should appear. This is the same screenshot as from earlier in the blog.

Final Note
When you pull your first test the numbers will appear to be wildly off. This is normal. Chrony needs time to stabilize and that usually occurs within 15 minutes to an hour. Be patient. Your RMS offset should reduce and the skew should work its way down below 1 ppm.
You can now use your Raspberry Pi NTP Time Server as an accurate time source for your network. On your networked computer.

Bob is, was, and always will be your uncle. You are a Steely Eyed Missile Man.
