[ntp:questions] PPS without a peer

Jeff Mock jeff-ml at mock.com
Tue Jul 29 03:30:29 UTC 2003


I am working on an application using NTP where a  machine sits in
an environment without access to the Internet (cable TV head end).
The machine does not need to be synchronized to absolute time, but
it does need to be synchronized an external PPS source so that the 
passing of time happens at the precision of the PPS source.

The PPS source is good to better than 1ppm, the internal clock on the 
machine might be 100ppm or worse.

I would like to use NTP to synchronize the computer clock to the PPS
signal, but I'm having some problems.  I'm using a Linux machine
with a 2.4.20 kernel patched with the ppskit.  I have the PPS signal
working properly on the DCD pin of a serial port.

The problem seems to be that the PPS driver needs a "prefer" driver to 
lock before enabling the PPS driver.  I was initially hoping the 
the guts of my ntp.conf file might by as simple as:

    # PPS on DCD serial port pin
    server 127.127.22.0 minpoll 4 maxpoll 4

This doesn't work, ntpd never uses the PPS information because there
isn't a peer driver to lock to first

My second clever idea is to use the local clock discipline as the 
peer.  ntpd will lock to itself and then switch to the PPS driver.
Something like:
    
    # local clock
    server 127.127.1.1 prefer minpoll 4   

    # PPS on DCD serial port pin
    server 127.127.22.0 minpoll 4 maxpoll 4

This doesn't really work either.  It seems there is some prioritization
of clock sources going on inside ntpd and it always seems to prefer
the local clock and doesn't switch over to the pps clock.

This situation might be complicated since the epoch of a second for
the local clock is probably unrelated to the epoch of a second of the 
PPS signal.  The PPS signal might be +/- 0.5s relative to the computer
clock when ntpd starts.

So, I'm looking for some help.  Maybe some clever configuration wisdom
or maybe some insight on how to hack ntpd so that it will lock up to
a PPS source without requiring a peer.

thanks,
jeff












More information about the questions mailing list