
It took me about an hour to work out that I had the board plugged in the wrong way around, and that’s why nothing worked. My excuse is we’re in the middle of a heatwave at the moment ….
Anyway, the picture above is how you’re supposed to do it.
The R-Pi is running standard Raspbian, and the rest of the software setup can be found on this page update: this is the right link.
The board almost immediately finds a timepulse.
After running for a little while:
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
xPPS(0) .PPS. 0 l 13 16 377 0.000 -7.334 0.159
xipv6test.te.net 195.138.80.34 3 u 51 64 377 72.959 -1.776 0.711
(and yes I know it says Stratum 0 …)
The output is saying that the GPS source (PPS) has an offset of 7.3ms from the internal clock. The stratum 3 internet source is 1.8ms from the internal clock (but note the internal clock is likely wrong). The delay (round trip?) to the local clock is 0, and the delay from the internet source is 73ms.
They are both currently marked as “x” meaning “falsetickers”. I think ntpd needs a bit longer to decide to use the GPS source.
# ntpq -c rv
associd=0 status=0018 leap_none, sync_unspec, 1 event, no_sys_peer,
version="ntpd 4.2.6p5@1.2349-o Sat Jul 4 15:08:48 UTC 2015 (1)",
processor="armv7l", system="Linux/3.18.11-v7+", leap=00, stratum=1,
precision=-20, rootdelay=0.000, rootdisp=86.994, refid=PPS,
reftime=d942771e.6dc41fc9 Sat, Jul 4 2015 16:15:42.428,
clock=d9427c3a.d8cd27b8 Sat, Jul 4 2015 16:37:30.846, peer=0, tc=4,
mintc=3, offset=0.003, frequency=0.000, sys_jitter=0.116,
clk_jitter=3.476, clk_wander=0.000
Update: After reading this Red Hat article and this ntp.org document, I realized my mistake was having only two clocksources, which is the worst configuration for ntpd. Adding a bunch more sources makes it better:
# ntpq -c peers
remote refid st t when poll reach delay offset jitter
==============================================================================
oPPS(0) .PPS. 0 l 16 16 377 0.000 -0.094 0.008
*server.104media 193.67.79.202 2 u 30 64 377 29.748 3.890 0.610
-ns2.vnet.sk 95.47.106.34 3 u 29 64 377 50.536 0.622 0.268
+nero.grnet.gr .GPS. 1 u 27 64 377 71.089 4.371 0.619
-frankfurt1.firs 85.214.240.94 3 u 26 64 377 35.655 5.620 0.541
-time.rdg.uk.as4 84.2.44.19 3 u 40 64 377 19.761 3.070 0.197
-ntp1.ic.net.uk 158.43.128.33 2 u 43 64 377 18.153 3.659 0.176
-ns0.luns.net.uk 158.43.192.66 2 u 48 64 377 25.761 3.648 0.219
+ntppub.le.ac.uk 158.43.192.66 2 u 47 64 377 21.566 3.783 0.520
However for some reason it only works when I restart the NTP server a minute after boot. It may be that the kernel PPS device isn’t ready when the NTP server starts first time. In any case, I added this to /etc/rc.local
:
( sleep 60 ; service ntp restart ) &