Want to make a stratum one time server you need some tools and software too. I prefer Chrony as I find more stable, reliable and lightning fast when it comes control time on the nano-scale. Moreover its easy to install and control.
Chronyd is a time server and client software corresponding to NTP. GPSD is a piece of software that works as a kind of bridge and mediator between the GPS/GNSS-receiver, and your signals on your GPIO.
It comes fine as Linux distribution but even it is possible to do a compiling and install it by hand it works fantastic straight of the box. After fine tuning and trimming it should be good for operation online.
Time: app 1 hour all included.
This is fast installation for all the software needed including web radio for your convenience, monitoring and chrony as the production NTP-server. No compiling needed, just follow my easy battle plan:
Prerequisite:
On a fresh clean Raspberry OS installation prepared with Rufus and added files name “ssh” to the boot directory via windows 10/11.
// I use Bullseye 32 and 64 bit, both light and desktop. The latter because a use it as streaming net radio over web-browser and this makes its easy even the jitter in chrony a bit higher with that running. But for home use its no problem.
Copy and backup of the files before editing them. Just in case you need them later.
Guide:
#apt update -y
#apt install chrony gpsd gpsd-clients pps-tools bind9 -y
Then do:
#rm /lib/dhcpcd/dhcpcd-hooks/50-ntp.conf (not need after 30 NOV 21 on ver 32bit)
Now we trim RasPi:
edit:
#nano /boot/cmdline.txt
At the front of the string remove:
console=serial0,115200
(This can be removed automatically from desktop too or via #raspi-config)
To the end, add:
nohz=off ipv6.disable=1 smsc95xx.turbo_mode=0
Do edit of config and add the communication for GNSS and PPS (pulse per second):
#nano /boot/config.txt
Add this
at the end after [all]:
enable_uart=1
dtoverlay=pps-gpio,gpiopin=4
force_turbo=1
avoid_warnings=2
and now time for making GPSD and Chrony work in cooperation:
#nano /etc/default/chrony
# Options to pass to chrony. DAEMON_OPTS="-4 -F -1 -r -m -s"
❗ Watch out that some copy and paste convert and add English “goose-eyes” instead of the straight. This will NOT work and make Chrony and/GPSD invalid for start. (It took quite a while before I realized this little bug).
Now do:
#nano /etc/default/gpsd
and add this:
DEVICES="/dev/ttyS0" GPSD_OPTIONS="-n -D3"
And now we need to make GSPD to start automatically at boot. Do:
#systemctl enable gpsd
Edit in #raspi-config: (can be done in parallel with upgrade if you open up a second console) ans save some time.
- Change PASSWORD
- Change HOSTNAME
- Change TIMEZONE = UTC
- Change KEYBOARD
In desktop disable (Bluetooth using mouse) and disable WiFi
If not done you should set static ip:
#nano /etc/dhcpcd.conf
Find this phrase and change it to something like this:
# Example static IP configuration:
interface eth0
static ip_address=192.168.77.244/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
static routers=192.168.77.1
static domain_name_servers=127.0.0.1 192.168.77.1
I also install bind9 to make faster and more reliable dns request for chrony and myself by using the Pi as local DNS-Server.
Hence edit:
#nano /etc/resolv.conf
The file should look like something like this
# Generated by resolvconf
domain lan
nameserver 127.0.0.1
nameserver 192.168.77.1
(First nameset is bind9 itself on RasPi, second is for my home router as needed for looking up other gear on the DMZ-LAN)
#reboot
#upgrade -y
(this usually takes looong time. If any kernelhack or kernel update are adressed you should do a reboot again)
After trim and configurations
GPSD
GPSD come more or less as as configureless setup => Apart from the above, nothing to do.
You might study tips and manuals here: https://gpsd.io/
Chrony
Now you should be ready fine trim the config-file of chrony to make it a proper NTP-server on Stratum One nano scale:
https://jes.saxe.dk/ntp-stratum-one-server/configuration-of-ntp-server-chrony-for-stratum-one-438
Chrony have home here: https://chrony.tuxfamily.org/