Stratum 1 GNSS NTP Server running on a Raspberry Pi 2
These are the parts I have used.
- Raspberry Pi 2
- SparkFun ublox NEO-M9N
- This Adafruit module is a good alternative
- Adafruit DS3231 RTC
- Some cheap Active GPS Antenna
- uFL to SMA Adapter Pigtail (Example)
- Pin Headers for the GNSS module (Soldering required)
- Some Male-to-Female DuPont Cables
Previously the BeagleBone Black SBC was used, check the beaglebone branch for more information.
- Install packages:
sudo apt update
sudo apt install pps-tools gpsd chrony nginx php-fpm php-gd- Edit
/boot/firmware/config.txt
-
Uncomment
dtparam=i2c_arm=on -
Add the following under
[all]:# Overclock arm_freq=1000 core_freq=500 sdram_freq=500 over_voltage=2 # Serial, RTC, PPS enable_uart=1 dtoverlay=i2c-rtc,ds3231 dtoverlay=pps-gpio,gpiopin=18 nohz=off
-
Edit
/boot/firmware/cmdline.txt, removeconsole=serial0,115200 -
Reboot to apply changes.
-
Setup GPSd
-
Edit
/etc/default/gpsd. Use file in this repo as reference. -
Edit systemd service to start after chrony:
sudo systemctl edit gpsdAdd:
[Unit] After=chrony.service -
Start GPSd:
sudo systemctl disable --now [email protected] sudo systemctl mask [email protected] sudo systemctl enable --now gpsd systemctl status gpsd
-
Check using
gpsmonandcgpscommands.
- Setup Chrony
-
Edit Chrony config files. Use file in this repo as reference.
-
Start Chrony:
sudo systemctl enable chrony sudo systemctl restart chrony gpsd systemctl status chrony -
Check using
chronyc tracking,chronyc sources -v, andchronyc sourcestats -vcommands.
- (Optional) Setup nginx + php to serve webpage:
/etc/nginx/&/var/www/html.
The following webpages are included in this repo.
Shows current time + offset, similar to time.is (Requires serverDate.js.php).
Quick page that shows the output of the following commands: chronyc sources, chronyc sourcestats, chronyc tracking.
My setup is based off the following guides.