Pi OS 12 VK‐162 - BYO-NTP/recipes GitHub Wiki
date | server | os | gnss | daemon | 🎯 | 🗣️ |
---|---|---|---|---|---|---|
2025-05 | Raspberry Pi 4 Raspberry Pi 5 |
Pi OS 12 |
Stratux VK-162 | chrony NTPsec ntp |
6 ms | discuss |
Connect the VK-162 to a USB port of a Windows computer with u-blox u-center installed. Configure per the recommendations on the gnss page.
Then plug the USB plug into your NTP server.
The VK-162 presents itself to the system via the cdc_acm driver, so look for that:
dmesg | grep cdc_acm | grep tty
[ 4.708559] cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device
And there is the GPS unit, at ttyACM0
. If it presents at another location, like ttyACM1
, adjust the following commands accordingly.
- symlink /dev/ttyACM0 to /dev/gps0
- configure the USB serial port for low latency
apt install -y setserial
/bin/setserial /dev/ttyACM0 low_latency
cat > /etc/udev/rules.d/10-gps.rules <<EOL
KERNEL=="ttyACM0", SYMLINK+="gps0", GROUP="dialout", MODE="0660"
KERNEL=="ttyACM0", RUN+="/bin/setserial /dev/ttyACM0 low_latency"
EOL
udevadm control --reload-rules
udevadm trigger
Exports a refclock config and then installs (if needed) and configures the NTP daemon.
export NTP_REFCLOCKS=$(cat <<EO_CHRONY
refclock SHM 0 refid NMEA offset 0.05
EO_CHRONY
)
curl -sS https://byo-ntp.github.io/tools/chrony/install.sh | sh
export NTP_REFCLOCKS=$(cat <<EO_NTPSEC
refclock nmea minpoll 3 maxpoll 4 time2 0.052 mode 8 baud 115200
EO_NTPSEC
)
curl -sS https://byo-ntp.github.io/tools/ntpsec/install.sh | sh
The gpsd driver would improve accuracy here, but it's not built into the apt package.
export NTP_REFCLOCKS=$(cat <<EO_NTP
server 127.127.20.0 minpoll 3 maxpoll 4 mode 88
fudge 127.127.20.0 refid NMEA time2 0.052 minjitter 0.1
EO_NTP
)
curl -sS https://byo-ntp.github.io/tools/ntp/install.sh | sh
- watch the status in near real time:
- printf '\e[8;9;80t'; ssh -t pi5 watch -n2 chronyc sources
- printf '\e[8;9;80t'; ssh -t pi5 watch -n2 ntpq -c peer
- Measure the offset
- Gather statistics with telegraf + influxdb + grafana or similar.
- GNSS
- NTP daemons
- Linux CDC ACM
chrony
NTPsec
ntp