nmea refclock not locking to the pps

Tony Hain tony at tndh.net
Fri Mar 3 09:00:23 UTC 2017


Not clear if this is an ntpsec issue, or comes from upstream, but the pps
lock on the nmea stream never converges to a reasonable offset or apparently
itself. If the nmea refclock is set for flag1 0 (no pps), and the pps
refclock is on then the nmea drift frequently shows nmea as a false-ticker
as expected, and the system locks to within a couple of usec of the pps
(just as it has been for over a decade on previous builds of FreeBSD &
legacy NTP). When the nmea and pps interfaces are both set to track pps,
there is a persistent offset ~120us (the comments in the code suggest that
the pps interface is disabled when another interface has an associated pps,
but I did not try to verify that behavior in the code). The real issue is
that when the pps refclock is disabled (so there should only be one code
path tracking the event in any case) and the nmea refclock is set flag1 1
(pps on), the persistent offset holds at ~500us and there is a * next to the
legacy server, implying that the nmea stream itself is being ignored, and is
a different reaction than legacy ntpd. 

Current x86 system w/RS232 feed
# uname -v
FreeBSD 8.1-RELEASE #0: Sun Jan 30 17:56:29 PST 2011   
#
# ntpd --version
ntpd - NTP daemon program - Ver. 4.2.4p5
server 127.127.22.1 minpoll 4 maxpoll 4
fudge 127.127.22.1 flag2 1 time1 0.000001906304 stratum 0 refid PPS
server 127.127.20.1 mode 8 minpoll 4 maxpoll 4 prefer
fudge  127.127.20.1 flag1 1 flag2 1 flag3 1 time1 0.000001906304 time2
0.079166667 stratum 0 refid GPS
# ntpq -p
     remote           refid      st t when poll reach   delay   offset
jitter
============================================================================
==
xPPS(1)          .PPS.            0 l    5   16  377    0.000    0.001
0.002
oGPS_NMEA(1)     .GPS.            0 l    2   16  377    0.000    0.001
0.002
 2001:470:e930:1 .STEP.          16 u 962d 1024    0    0.000    0.000
0.000
x2610:20:6f15:15 .ACTS.           1 u  165   64  344  147.007   37.798
0.685
+montpelier.ilan .GPS.            1 u   48   64  377   35.377    1.904
3.026
+saturn6.es.net  .CDMA.           1 u   12   64  377   34.013    0.409
2.157
-clock.fmt.he.ne .CDMA.           1 u   21   64  377   30.133    2.025
3.870
+clock.isc.org   .SHM.            1 u    1   64  233   26.328    0.116
2.924
-time0.apple.com 17.253.4.125     2 u    1   64  377   25.051    1.830
3.601


BBB system w/gpio feed from the same nmea/pps stream (differences in time1
are due to 232 driver slew rate, and cable length).
# uname -v
FreeBSD 12.0-CURRENT #0 r314118M: Wed Feb 22 22:49:19 PST 2017
# ntpd -V
ntpd ntpsec-0.9.6+536 2017-02-22T20:26:50Z
# grep ^refclock /etc/ntp.conf
refclock pps stratum 0 refid PPS minpoll 3 maxpoll 6 prefer time1
0.000000337160
refclock nmea refid GPS baud 4800 mode 8 minpoll 3 maxpoll 6 prefer flag1 0
flag4 1 time1 0.000000337160 time2 0.442916667
# ntpmon
     remote           refid      st t when poll reach   delay   offset
jitter
oPPS(0)          .PPS.            0 l    7    8  377   0.0000   0.0001
0.0001
xNMEA(0)         .GPS.            0 l    6    8  377   0.0000 -52.1062
1.4493
+2603:3023:102:1 .PPS.            1 u   12   32  377   1.4255  -0.8452
0.1852
+clock.fmt.he.ne .CDMA.           1 u   38   64  377  30.0244   0.9289
1.1089
*2001:470:e930:7 .GPS.            1 u   58   64  377   0.8173  -0.9772
1.9614
-dwarfs.linocomm 80.127.147.170   2 u   50   64  377 151.6870   1.8655
2.6363
 2610:20:6f15:15 .ACTS.           1 u  900  256  110 147.6037  37.8246
0.5268
-clock.isc.org   .SHM.            1 u   36   64  177  30.6215   1.3876
1.6505
-seiko.s.uw.edu  172.22.16.38     2 u   46   64  377  11.8203   1.4284
1.4327
-time0.apple.com 17.253.4.125     2 u   49   64  377  29.4985   1.3072
1.1987
ntpd ntpsec-0.9.6+536 2017-02-22T20:26:50Z  Last update: 2017-03-02T10:09:28


# grep ^refclock /etc/ntp.conf
refclock pps stratum 0 refid PPS minpoll 3 maxpoll 6 prefer time1
0.000000337160
refclock nmea refid GPS baud 4800 mode 8 minpoll 3 maxpoll 6 prefer flag1 1
flag4 1 time1 0.000000337160 time2 0.442916667
# ntpmon
     remote           refid      st t when poll reach   delay   offset
jitter
xPPS(0)          .PPS.            0 l    2    8  377   0.0000   0.1417
0.0442
oNMEA(0)         .GPS.            0 l   25   64  377   0.0000   0.1840
0.7804
+2603:3023:102:1 .PPS.            1 u   18   32  377   1.5210   0.3795
0.5683
-clock.fmt.he.ne .CDMA.           1 u   20   64  377  26.9020   0.4571
2.2441
*2001:470:e930:7 .GPS.            1 u   21   64  377   0.9341   0.2050
15.6855
-45.63.71.165.vu 216.239.35.0     3 u   18   64  377  56.7574   3.4654
0.6586
 2610:20:6f15:15 .ACTS.           1 u  365  256    2 149.8027  40.0820
0.0957
-clock.isc.org   .SHM.            1 u   15   64   47  30.7195   3.1562
1.6428
+seiko.s.uw.edu  172.22.16.38     2 u   36   64  377   8.6944   0.8224
3.4109
-time0.apple.com 17.253.4.253     2 u   29   32  377  25.6556   2.5733
2.5038
ntpd ntpsec-0.9.6+536 2017-02-22T20:26:50Z  Last update: 2017-03-02T11:09:57


#refclock pps stratum 0 refid PPS minpoll 3 maxpoll 6 prefer time1
0.000000337160
refclock nmea refid GPS baud 4800 mode 8 minpoll 3 maxpoll 6 prefer flag1 1
flag4 1 time1 0.000000337160 time2 0.442916667
# ntpmon
     remote           refid      st t when poll reach   delay   offset
jitter
oNMEA(0)         .GPS.            0 l   28   64  377   0.0000   0.5225
0.0012
+2603:3023:102:1 .PPS.            1 u    3   32  377   1.3732   0.5526
0.0520
+clock.fmt.he.ne .CDMA.           1 u   43   64  377  28.6010   1.5155
1.7587
*2001:470:e930:7 .GPS.            1 u   43   64  377   0.9389   0.4567
0.0807
-104.156.99.226  192.12.19.20     2 u   50   64  377  10.3058   2.5364
1.6114
 2610:20:6f15:15 .ACTS.           1 u  827  256  230 144.6754  36.3677
2.1870
-clock.isc.org   .SHM.            1 u   39   64  267  30.5930   2.5590
1.3781
-rolex.s.uw.edu  172.22.16.38     2 u   38   64  377   7.0322   0.5489
3.8470
-time0.apple.com 17.150.231.5     2 u   46   64  377  27.3320   1.0669
4.0991
ntpd ntpsec-0.9.6+536 2017-02-22T20:26:50Z Last update: 2017-03-02T12:00:06


Finally, ~legacy ntpd on the BBB
# uname -v
FreeBSD 12.0-CURRENT #0 r314118M: Wed Feb 22 22:49:19 PST 2017  
# ntpd --version
ntpd 4.2.8p9-a (1)
#grep 127.127 /etc/ntp.conf
peer 127.127.22.0 minpoll 3 maxpoll 5
fudge 127.127.22.0 refid PPS stratum 0 time1 0.000000337160
peer 127.127.20.0 mode 8 minpoll 3 maxpoll 5 prefer
fudge 127.127.20.0 refid GPS stratum 0 flag1 1 time1 0.000000337160 time2
0.072916667
# ntpmon
     remote           refid      st t when poll reach   delay   offset
jitter
o127.127.20.0    .GPS.            0 s    4    8  377    0.000    0.023
0.002
+2603:3023:102:1 .PPS.            1 u    2    8  377    1.371    0.047
0.185
*2001:470:e930:7 .GPS.            1 u   11   64  377    0.810   -0.075
0.385
-service1-eth3.d 228.143.95.23    2 u   29   64  377  185.392    0.521
0.901
-2610:20:6f15:15 .ACTS.           1 u   17   64  363  146.466   37.979
1.220
-clock.isc.org   .SHM.            1 u  153   64  314   28.338    1.259
1.572
-seiko.s.uw.edu  172.22.16.38     2 u   15   64  377   10.271    1.909
0.672
+time0.apple.com 17.253.4.125     2 u   14   64  377   27.418    1.285
1.792
ntpd 4.2.8p9-a (1)                          Last update: 2017-03-03T00:52:20





More information about the bugs mailing list