[ntp:questions] Fwd: Re: NetBSD GPS/PPS using 4.2.6p3

A C agcarver+ntp at acarver.net
Wed Aug 24 07:52:40 UTC 2011

First, I want to thank everyone that participated thus far in the thread 
for a lot of help.  I don't think this is quite the end because there's 
still some strange things going on but...

I DID (FINALLY) get PPS to work.  However, I discovered many interesting 
things that I'm going to describe and see if it makes sense to all of 
you.  I welcome your comments on this new data.

On my system, GPS_NMEA and PPS_ATOM do not work together at all.  On the 
contrary they seem to interfere with each other.

For the system configuration, the GPS receiver is physically attached to 
serial port B and available via /dev/ttyb.  I have two symlinks to 
/dev/ttyb, one is /dev/gps1 and the other is /dev/pps1.

It turns out that PPS_ATOM is transmitting something (I don't know what 
yet, I'll have to make a splitter cable and monitor the serial data) TO 
the GPS every second.  I left the configuration without GPS_NMEA and 
only turned on PPS_ATOM with flag2 1 flag3 1 and it actually found the 
PPS clock and synchronized.  Until now I had been using GPS_NMEA all the 
time with no luck at all.  I think I tried PPS_ATOM once but may not 
have set flag2 so that would be my fault.  I was trying to combine GPS 
and PPS and overlooked PPS only when it failed the first time thinking I 
needed GPS, too (in fact I had the GPS set to "prefer" during some of 
that PPS_ATOM testing and then gave up on it).

On the box that holds the GPS receiver board, I actually have installed 
a PPS LED plus two additional LEDs for TX and RX activity.  When I 
removed GPS_NMEA completely and left only the PPS_ATOM driver I could 
see the RX (meaning data flowing INTO the GPS receiver) was pulsing once 
per second (even before kernel PPS had been activated the PPS_ATOM 
driver was still transmitting something).

When I turned on GPS_NMEA using no flags and also using 'noselect', the 
transmissions by PPS_ATOM stopped completely and the PPS refclock 
failed.  Instead, the RX LED flickered once in a while each time 
GPS_NMEA sent a message (presumably the $PMOTG,RMC,0000*1D sentence). 
PPS_ATOM didn't work at all in this case (always reported as unreachable 
and in the logs it says "kern PPS no signal").

Additionally, GPS_NMEA with flag3 enabled shows the same behavior as the 
combination of GPS_NMEA and PPS_ATOM.  Specifically, there is no RX 
activity at the GPS receiver every second, only once in a while, and 
again I get the error "kern PPS no signal".

So it seems like a port contention issue though I don't understand why 
given documentation that says I should be able to run both or run the 
PPS code on the GPS_NMEA driver.  If GPS_NMEA has control of the port, 
any PPS code is getting locked out of the transition data.  However, if 
only PPS_ATOM is enabled and GPS_NMEA is left off, then PPS_ATOM is 
controlling the whole port and also sending data to it on a regular basis.

Here's the config with both clocks enabled:
server  minpoll 4 mode 1 noselect
fudge  time2 0.245 refid GPS

fudge  flag2 1 flag3 1 refid PPS

Here's the log with both clocks enabled:
24 Aug 07:08:48 ntpd[9415]: PPS(1) 802b 8b clock_event clk_no_reply
24 Aug 07:09:51 ntpd[9415]: 963a 8a sys_peer
24 Aug 07:09:51 ntpd[9415]: 061d 0d kern PPS enabled
24 Aug 07:09:51 ntpd[9415]: 062d 0d kern PPS no signal
24 Aug 07:10:04 ntpd[9415]: ntpd exiting on signal 2

ntpq shows that the PPS clock is never reached in this configuration.

And here is only PPS_ATOM enabled (GPS_NMEA commented out):
24 Aug 07:13:53 ntpd[21285]: c615 05 clock_sync
24 Aug 07:14:56 ntpd[21285]: PPS(1) 8024 84 reachable
24 Aug 07:14:56 ntpd[21285]: PPS(1) 973a 8a sys_peer
24 Aug 07:14:56 ntpd[21285]: 011d 0d kern PPS enabled

And the output from ntpq -p (other network clocks trimmed):
remote           refid   st t when poll reach   delay   offset  jitter
o127.127.22.1    .PPS.    0 l   64   64  377    0.000    0.019   0.061

The 'o' symbol is there and the PPS is reachable.

I haven't included the logs for GPS_NMEA only (without PPS_ATOM) and 
flag3 enabled but they look the same as GPS_NMEA with PPS_ATOM.

Any thoughts about all of this?  I certainly have a little less hair 
than I did when I started.  However, I'd still like to get GPS_NMEA 
working or at least understand why GPS_NMEA and PPS_ATOM kill each other.

More information about the questions mailing list