Hi,
until last week my Raspberry Pi was querying a handful of ntp servers.
Seeing offsets of mostly +/-20ms and up to +/-200ms I wondered if I
could improve this and got an Adafruit Ultimate GPS module (USB
connector with additional PPS pin). The NMEA data is polled via
/dev/ttyUSB0 whereas the PPS pin is connected to GPIO14 and accessed via
/dev/pps0. I followed the instructions on
https://gpsd.gitlab.io/gpsd/gpsd-time-service-howto.html#_chrony_performance_tuning
to come up with a meaningful offset for NMEA.
I have kept five ntp servers and added the "noselect" option to monitor
the difference between GPS and network sources. What I don't understand
is that the external sources are shown as unusable even though I get
updates in the measurements log file roughly every minute:
$ chronyc sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
#- GPS 0 4 377 21 -75ms[ -75ms]
+/- 100ms
#* PPS 0 4 377 20 +1455ns[+1649ns]
+/- 592ns
^? zeit.fu-berlin.de 0 10 377 - +0ns[ +0ns]
+/- 0ns
^? ptbtime1.ptb.de 0 10 377 - +0ns[ +0ns]
+/- 0ns
^? ptbtime2.ptb.de 0 10 377 - +0ns[ +0ns]
+/- 0ns
^? ptbtime3.ptb.de 0 10 377 - +0ns[ +0ns]
+/- 0ns
^? ns.tu-berlin.de 0 10 377 - +0ns[ +0ns]
+/- 0ns
$ cat /var/log/chrony/measurements.log
========================================================================================================================================
Date (UTC) Time IP Address L St 123 567 ABCD LP RP Score
Offset Peer del. Peer disp. Root del. Root disp. Refid MTxRx
========================================================================================================================================
2023-06-03 14:40:36 160.45.10.8 N 2 111 111 1110 9 9 0.70
2.379e-01 6.064e-04 1.617e-06 2.289e-04 5.545e-02 C0A80169 4B K K
2023-06-03 14:40:44 192.53.103.104 N 2 111 111 1110 9 9 0.70
2.379e-01 4.169e-04 1.127e-06 2.289e-04 7.506e-02 C0A80169 4B K K
2023-06-03 14:41:41 192.53.103.108 N 2 111 111 1110 9 9 0.65
-3.330e-01 3.685e-04 1.168e-06 2.594e-04 5.507e-02 C0A80169 4B K K
2023-06-03 14:44:04 192.53.103.103 N 2 111 111 1110 9 9 0.70
9.379e-03 2.501e-04 8.169e-07 6.866e-04 9.549e-02 C0A80169 4B K K
2023-06-03 14:44:50 130.149.7.7 N 2 111 111 1110 9 9 0.75
9.362e-03 1.915e-04 6.917e-07 6.866e-04 2.155e-01 C0A80169 4B K K
2023-06-03 14:49:16 160.45.10.8 N 2 111 111 1110 9 9 0.80
4.805e-02 5.265e-04 1.457e-06 3.967e-04 6.735e-02 C0A80169 4B K K
2023-06-03 14:49:17 192.53.103.104 N 2 111 111 1110 9 9 0.80
4.799e-02 3.270e-04 9.659e-07 3.967e-04 6.847e-02 C0A80169 4B K K
2023-06-03 14:50:14 192.53.103.108 N 2 111 111 1110 9 9 0.75
4.803e-02 4.825e-04 1.409e-06 3.967e-04 2.194e-01 C0A80169 4B K K
2023-06-03 14:52:46 192.53.103.103 N 2 111 111 1110 9 9 0.80
-2.402e-01 2.170e-04 8.102e-07 6.561e-04 1.106e-01 C0A80169 4B K K
2023-06-03 14:53:30 130.149.7.7 N 2 111 111 1110 9 9 0.85
-2.400e-01 4.179e-04 1.210e-06 6.561e-04 2.256e-01 C0A80169 4B K K
2023-06-03 14:57:50 160.45.10.8 N 2 111 111 1110 9 9 0.90
-1.500e-01 2.556e-04 9.407e-07 2.747e-04 5.942e-02 C0A80169 4B K K
2023-06-03 14:57:56 192.53.103.104 N 2 111 111 1110 9 9 0.90
-1.498e-01 6.038e-04 1.527e-06 2.747e-04 7.607e-02 C0A80169 4B K K
2023-06-03 14:58:52 192.53.103.108 N 2 111 111 1110 9 9 0.85
-1.499e-01 4.008e-04 1.118e-06 2.747e-04 2.221e-01 C0A80169 4B K K
2023-06-03 15:01:18 192.53.103.103 N 2 111 111 1110 9 9 0.90
3.526e-01 4.606e-04 1.294e-06 7.324e-04 1.003e-01 C0A80169 4B K K
2023-06-03 15:02:12 130.149.7.7 N 2 111 111 1110 9 9 0.95
-2.383e-01 4.737e-04 1.348e-06 5.341e-04 7.150e-02 C0A80169 4B K K
2023-06-03 15:06:26 160.45.10.8 N 2 111 111 1110 9 9 1.00
2.388e-01 2.450e-04 9.116e-07 3.204e-04 2.239e-01 C0A80169 4B K K
2023-06-03 15:06:33 192.53.103.104 N 2 111 111 1110 9 9 1.00
3.865e-01 5.441e-04 1.423e-06 6.561e-04 7.314e-02 C0A80169 4B K K
2023-06-03 15:07:27 192.53.103.108 N 2 111 111 1110 9 9 0.95
-1.619e-01 1.506e-04 6.009e-07 6.866e-04 1.342e-01 C0A80169 4B K K
2023-06-03 15:09:57 192.53.103.103 N 2 111 111 1110 9 9 1.00
2.173e-05 3.446e-04 1.030e-06 2.747e-04 2.136e-04 C0A80169 4B K K
2023-06-03 15:10:53 130.149.7.7 N 2 111 111 1110 10 9 0.05
5.405e-06 3.135e-04 1.002e-06 2.747e-04 2.899e-04 C0A80169 4B K K
Some additional info:
$ chronyc tracking
Reference ID : 50505300 (PPS)
Stratum : 1
Ref time (UTC) : Sat Jun 03 16:01:54 2023
System time : 0.000000075 seconds slow of NTP time
Last offset : +0.000000010 seconds
RMS offset : 0.000000130 seconds
Frequency : 0.983 ppm fast
Residual freq : +0.000 ppm
Skew : 0.002 ppm
Root delay : 0.000000001 seconds
Root dispersion : 0.000012622 seconds
Update interval : 16.0 seconds
Leap status : Normal
And the configuration
$ cat /etc/chrony/chrony.conf
server zeit.fu-berlin.de iburst noselect
server ptbtime1.ptb.de iburst noselect
server ptbtime2.ptb.de iburst noselect
server ptbtime3.ptb.de iburst noselect
server times.tubit.tu-berlin.de iburst noselect
refclock SHM 0 refid GPS precision 1e-1 offset 0.4
refclock PPS /dev/pps0 lock GPS refid PPS precision 1e-7
keyfile /etc/chrony/chrony.keys
driftfile /var/lib/chrony/chrony.drift
ntsdumpdir /var/lib/chrony
log tracking measurements statistics
logdir /var/log/chrony
maxupdateskew 100.0
rtcsync
makestep 1 3
leapsectz right/UTC
allow 192.168.0.0/16
Could you please tell me where I am messing things up?
Cheers
Torsten