[ntp:questions] Help: fudge time2 value for NMEA driver

ogre up orgeup at gmail.com
Sun Oct 30 17:29:09 UTC 2016


Hello everyone, I've setup a NMEA+PPS ntp server, but both ref clock have
strange offset value reported by ntpq -p.

Some basic infomation about my setup:
OS: CentOS 6.5 + 2.6.34.10 kernel (compiled with pps support)
NTP: 4.2.8 at p8 (with NEMA and ATOM clock driver enabled)
Time ref: Garmin gps 18 (outputs GPRMC + GPGGA @ 4800bps)
signal of pps and NMEA data from gps module capture by an osc looks like
this:
[see osc.jpg in attachments]

/etc/ntp.conf:
# use GPRMC sentence only
server 127.127.20.0 mode 1 minpoll 3 maxpoll 4 iburst prefer
fudge  127.127.20.0 fudge flag1 0 time2 0.213
server 127.127.22.0
fudge  127.127.22.0 fudge flag2 1 flag3 1
tos mindist 0.10 # required, or both peer will be falseticker

"time2 0.216" calculated as follows:
pps pulse width is set to 100ms, so the leading edge marks the valid
second.
GPRMC (69 bytes) came before GPGGA (80 bytes) in NMEA data burst, so time
span from pps to end of GPRMC = 380 - (1/4800 * 10 * 1000 * 80) = 213 ms.

However, output of ntpq -pn shows 127.127.20.0 still got a large offset
value:
     remote           refid      st t when poll reach   delay   offset
 jitter
==============================================================================
*127.127.20.0    .GPS.            0 l    1    8  377    0.000  -115.02
1.120
o127.127.22.0    .PPS.            0 l   56   64  377    0.000    0.040
0.020

Besides, ppstest command does not always got same output:
$ sudo ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1477817715.999952604, sequence: 31470 - clear
1477781599.834058655, sequence: 24
source 0 - assert 1477817716.999974467, sequence: 31471 - clear
1477781599.834058655, sequence: 24
source 0 - assert 1477817717.999958504, sequence: 31472 - clear
1477781599.834058655, sequence: 24
source 0 - assert 1477817718.999981812, sequence: 31473 - clear
1477781599.834058655, sequence: 24

$ sudo ppswatch /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
timestamp: 1477817756, sequence: 25, offset: -100040731
timestamp: 1477817756, sequence: 25, offset: -100040731
timestamp: 1477817757, sequence: 26, offset: -100039236
timestamp: 1477817757, sequence: 26, offset: -100039236
timestamp: 1477817758, sequence: 27, offset: -100039364
timestamp: 1477817758, sequence: 27, offset: -100039364

$ sudo ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1477818059.999997871, sequence: 31814 - clear
1477818060.899947568, sequence: 330
source 0 - assert 1477818060.999980293, sequence: 31815 - clear
1477818060.899947568, sequence: 330
source 0 - assert 1477818060.999980293, sequence: 31815 - clear
1477818061.899953546, sequence: 331
source 0 - assert 1477818061.999888506, sequence: 31816 - clear
1477818061.899953546, sequence: 331
source 0 - assert 1477818061.999888506, sequence: 31816 - clear
1477818062.899951101, sequence: 332
source 0 - assert 1477818062.999954442, sequence: 31817 - clear
1477818062.899951101, sequence: 332

Are these normal? Should I use "fudge flag 2" for 127.20.22.0?

Sorry for my English and any suggestion will be appreciated.

Paul
Best Regards


More information about the questions mailing list