Configuring the time server
Recommended (optional) steps: setting up the hardware device names
For the ADAPT payload software, we use /dev/gps and /dev/spatial as names for the NMEA and Advanced Navigation Spatial hardware names (this avoids issues with ttyUSB0/1/2 etc. numbering). In order to set this up, you'll need to know the device IDs - usually found with the 'lsusb' command. For reference, the USB hardware we used look like this:
lsusb
067b:2303 Prolific Technology, Inc. PL2303 Serial Port # <- this is the 9-pin serial to USB converter
0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC # <- this is the standard Spatial USB cable
sudo nano /etc/udev/rules.d/99-zgps.rules
# copy and paste the info below (after changing the IDs to match your hardware)
SUBSYSTEM=="tty", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", GROUP="dialout", SYMLINK+="gps"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", GROUP="dialout", SYMLINK+="spatial"
udevadm control --reload-rules && udevadm trigger
Required steps: configuring gpsd and chronyd
Disable the standard timesync
sudo systemctl stop systemd-timesyncd.service
sudo systemctl disable systemd-timesyncd.service
sudo systemctl stop gpsd
sudo systemctl disable gpsd
sudo systemctl stop gpsd.socket
sudo systemctl disable gpsd.socket
sudo killall gpsd
sudo gpsd -D 5 -N -n -b /dev/gps /dev/pps0
Configure chrony
sudo systemctl stop chronyd
sudo nano /etc/chrony/chrony.conf
# add/edit lines as shown below
allow
# rtcsync # note: turn this off to not use system clock
refclock SHM 0 refid GPS precision 1e-1 offset 0.045 noselect
refclock SHM 2 refid PPS precision 1e-7 prefer
sudo systemctl start chronyd
chronyc sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
#- GPS 0 4 377 12 +3580us[+3580us] +/- 101ms
#* PPS 0 4 377 10 -86ns[ -157ns] +/- 181ns