This is something I’ve been considering doing for years and following a recent conversation with a good friend, I looked into it again and found this guide which was posted back in July 2023.
In my box of stuff, I found I had a couple of GPS modules, one Adafruit and one of exactly the same type described that article, a generic GT-U7 module. It was a no brainer really, I decided to go for it.
There’s no point me rewriting the entire guide because it’s very detailed already. Following it was very straightforward with one change – Using Bookworm which is the latest version of the Raspberry Pi OS, the /boot/config.txt file is now located at /boot/firmware/config.txt
.
This is towards the end of Step 3, the correct commands to use are:
sudo bash -c "echo '# the next 3 lines are for GPS PPS signals' >> /boot/firmware/config.txt"
sudo bash -c "echo 'dtoverlay=pps-gpio,gpiopin=18' >> /boot/firmware/config.txt"
sudo bash -c "echo 'enable_uart=1' >> /boot/firmware/config.txt"
sudo bash -c "echo 'init_uart_baud=57600' >> /boot/firmware/config.txt"
After I’d had it running on the shack desk for a while for testing, I decided to move the Raspberry Pi to the final location where I wanted it to be. I shut it down, pulled the power and moved everything around.
To my dismay, it didn’t start back up again.
Investigation showed that the SD card was dead. Not just corrupted but actually completely dead. I’m not 100% sure what happened but I think I may have pulled the power before it had fully shut down, which is unusual for me as I’m normally very careful to ensure that I shut down my Pis before pulling the power. I just got unlucky.
As it was in situ, I replaced the SD card with a new one and started again from scratch. Because I’d gone through the process once already, I was more familiar with the instructions and it was a very quick process.
With it all working, it was time to update all the various clients on my network to actually use this NTP server. I have one Windows PC, three Macs and multiple Raspberry Pis.
My Windows PC uses Meinberg, on the start button program group, there’s an option to edit the time server configuration, so I selected that and replaced the existing time servers with just mine, then saved the file and restarted the service.
My Macs use ChronyControl and again, it’s a simple matter to edit the config file and add the IP address of the local NTP server.
It took a little longer on the Raspberry Pis, you need to edit /etc/systemd/timesyncd.conf
and add the following under the [Time] section (replace xxx.xxx.xxx.xxx with the IP address of your NTP Time Server.
NTP=xxx.xxx.xxx.xxx
FallbackNTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
When done, restart the time service with sudo systemctl restart systemd-timesyncd
and then check the status with systemctl status systemd-timesyncd
.
The guide gives a number of commands to show the status of the time server but I didn’t want to have to remember all of them so I set them up as aliases. To do this, enter the following command: sudo nano ~/.bash_aliases
and add the following text:
alias activity='sudo tcpdump -Qin -ni any port 123'
alias satellites='gpspipe -w | jq ".uSat| select( . != null )"'
alias sources='watch -n 1 chronyc sources'
alias tracking='watch -n 1 chronyc tracking'
Save the file, log out from your Pi and back in again and you’ll have four new commands, ‘activity’, ‘satellites’, ‘sources’ and ‘tracking’. Nice and easy.
Finally I went through and updated the time server details in any software I have which has that option.
I suppose the obvious question to ask is “Why?”, especially as taking the time from the internet is so easy. The answer is the same as when asked that question about many things. “Because I can”.
All in all, I can thoroughly recommend the guide at NetworkProfile.org. If you want your own NTP time server using a Raspberry Pi, this is the way to do it.
Thank you for your extended guide on how to install HamClock. The section on configuring the software was far more helpful than the software manual. Much appreciated!