[ntp:questions] PPS signal with default FreeBSD 9.2 kernel

Adrian Pascalau mailing-lists at pascalau.ro
Sat Jan 4 18:58:04 UTC 2014


I have a Garmin GPS 18x LVC connected to the serial port.

Default FreeBSD 9.2 kernel comes with a PPS module which I also loaded
using kldload, as could be seen from the output below.

[root at freebsd ~]# uname -a
FreeBSD freebsd 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Fri Sep 27
03:52:52 UTC 2013
root at bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC  i386
[root at freebsd ~]#
[root at freebsd ~]# ls -la /boot/kernel/pps.ko*
-r-xr-xr-x  1 root  wheel  16241 Sep 27 07:09 /boot/kernel/pps.ko
-r-xr-xr-x  1 root  wheel  30903 Sep 27 07:09 /boot/kernel/pps.ko.symbols
[root at freebsd ~]#
[root at freebsd ~]# kldstat
Id Refs Address    Size     Name
 1    4 0xc0400000 1205064  kernel
 2    1 0xc1606000 3a54     pps.ko
[root at freebsd ~]#

The NMEA driver is configured like this:

server mode 17 minpoll 4 maxpoll 4 prefer
fudge flag1 1 flag2 0 flag3 1 refid PPS

Now, if I let the system run for a while using this setup, the ntpq -p
shows the "o" tally code, which as far as I understand it means that
NTP is using the PPS signal, see below:

[root at freebsd ~]# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
oGPS_NMEA(0)     .PPS.            0 l    6   16  377    0.000    0.004   0.008
[root at freebsd ~]#

However the ntptime and ntpdc -c kerninfo commands does not show the
PPSSIGNAL in the status field, while they still show the PPSFREQ and
PPSTIME. Based on this
http://www.ntp.org/ntpfaq/NTP-s-config-adv.htm#AEN3748 if PPSSIGNAL
bit is missing, it means that the PPS signal was not detected by the
operating system. Furthermore, the ntp_gettime() and ntp_adjtime()
returns code 5 (ERROR). Even more, as expected the NTP log files tells
that PPS signal is not detected:

[root at freebsd ~]# ntptime
ntp_gettime() returns code 5 (ERROR)
  time d672d0b4.7bc6da18  Sat, Jan  4 2014 20:25:56.483, (.483503357),
  maximum error 3242 us, estimated error 0 us, TAI offset 35
ntp_adjtime() returns code 5 (ERROR)
  modes 0x0 (),
  offset 5.809 us, frequency 53.103 ppm, interval 1 s,
  maximum error 3242 us, estimated error 0 us,
  status 0x2007 (PLL,PPSFREQ,PPSTIME,NANO),
  time constant 4, precision 0.001 us, tolerance 496 ppm,
[root at freebsd ~]#
[root at freebsd ~]# ntpdc -c kerninfo
pll offset:           3.906e-06 s
pll frequency:        53.103 ppm
maximum error:        0.007246 s
estimated error:      0 s
status:               2007  pll ppsfreq ppstime nano
pll time constant:    4
precision:            1e-09 s
frequency tolerance:  496 ppm
[root at freebsd ~]#
[root at freebsd ~]# tail /var/log/ntp/ntpd.log
 4 Jan 19:48:50 ntpd[1806]: ntpd exiting on signal 15
 4 Jan 19:49:49 ntpd[997]: c01e 0e TAI 35 leap 201207010000
expire 201406010000
 4 Jan 19:49:49 ntpd[997]: GPS_NMEA(0) serial /dev/gps0 open at 9600 bps
 4 Jan 19:49:49 ntpd[997]: c016 06 restart
 4 Jan 19:49:49 ntpd[997]: c012 02 freq_set kernel 53.160 PPM
 4 Jan 19:50:06 ntpd[997]: c41c 0c clock_step -0.533426 s
 4 Jan 19:50:05 ntpd[997]: c414 04 freq_mode
 4 Jan 19:50:22 ntpd[997]: c418 08 no_sys_peer
 4 Jan 20:05:18 ntpd[997]: c412 02 freq_set kernel 53.115 PPM
 4 Jan 20:05:18 ntpd[997]: c415 05 clock_sync
 4 Jan 20:05:18 ntpd[997]: c41d 0d kern PPS enabled
 4 Jan 20:05:18 ntpd[997]: c42d 0d kern PPS no signal
 4 Jan 20:05:34 ntpd[997]: 043d 0d kern PPS no signal

Can anybody explain what does this mean?

Does my NTP use the PPS signal or not?

Why do I have the "o" tally code in the output of the ntpq -p command
if the PPS signal is not detected by the operating system?

I have to mention that the PPS signal is present, since if I recompile
the kernel using the PPS_SYNC option and use this new recompiled
kernel, everything works as expected:

* the "o" tally code is present in the output of the ntpq -p command
* the ntptime and ntpdc -c kerninfo commands shows the PPSSIGNAL in
the status field
* the ntp_gettime() and ntp_adjtime() returns code 0 (OK)
* there is no more message in NTP logs telling that there is no PPS signal

Many thanks,

More information about the questions mailing list