Skip to content

Chrony and gpsd

Based on:

Attempt to build a Stratum 1 server using chrony with gpsd and a GPS module.

  • Raspberry Pi 2
  • Adafruit Ultimate GPS Hat
  • u.FL to SMA adapter
  • SMA GPS antenna 5m cable
  • Debian 11 for Raspberry from https://raspi.debian.net/
  • chrony
  • gpsd

Installation

Set timezone

timedatectl set-timezone Europe/Berlin

Disable serial console

systemctl mask serial-getty@ttyAMA0.service

Install base packages

apt install gpsd gpsd-clients python3-gps chrony pps-tools

The serial interface needs to be configured. I haven't figured out yet how to make this persist across reboots:

stty -F /dev/ttyAMA0 raw 9600 cs8 clocal -cstopb

gpsd configuration at /etc/default/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 -D1 -s 9600" # Automatically hot add/remove USB GPS devices via gpsdctl USBAUTO="false"