[ntp:questions] GPS/PPS and "enable calibrate"

Horvath Bob-BHORVAT1 Bob.Horvath at motorolasolutions.com
Wed Sep 4 22:05:22 UTC 2013

I am trying to get a raspberry pi GPS-based stratum server functioning and I am confused how to use the "enable calibrate" function.  

I think I have figured out that to calibrate, you do the following:

1. Add "enable calibrate" to ntp.conf
2. "true" on "PPS" server line
3. "noselect" on the "GPS" reference clock to keep it from being used as a time source
4.  "prefer" on a legitimate good time server.  
5. "time1=0.0" on "GPS" fudge line

The calibration will take the PPS to be a good PPS signal, and will get the time of day from the "preferred" server.  

After a while, you can

1. Take out "enable calibrate"
2. Leave "true" there?
3. Take out "noselect"
4. Move "prefer" to the GPS line?
5. Change time1= ????

Or do I just leave it as I configured it the first time?

Here is my ntp.conf as it stands right now...

# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift

# Enable this if you want statistics to be logged.
statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details.  The web page <http://support.ntp.org/bin/view/Support/AccessRestrict
# might also be helpful.
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.

# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer
restrict -6 default kod notrap nomodify nopeer

# Local users may interrogate the ntp server more closely.
restrict ::1

# pps-gpio on /dev/pps0
server minpoll 4 maxpoll 4 true
fudge refid PPS
fudge flag3 1  # enable kernel PLL/FLL clock discipline

# gpsd shared memory clock
server minpoll 4 maxpoll 4 noselect # PPS requires at least one pre
ferred peer
fudge refid GPS
fudge time1 +0.0  # coarse processing delay offset

server iburst
server iburst prefer

enable calibrate

... and here is what my ntpq -pn looks like....

(Looking at it now, I am not sure how much this will tell since it hasn't been running very long)

pi at ntpi ~ $ ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
o127.127.22.0    .PPS.            0 l    2   16  377    0.000   -0.007   0.002    .GPS.            0 l    1   16  377    0.000  -82.005  56.615
+   2 u   15   64   37    1.400    2.213   0.321
*    .GPS.            1 u   15   64   37   27.184   -0.826   0.117
pi at ntpi ~ $

As you can tell from the reaches, I just recently rebooted, so it has only been running several minutes.  If I remove those lines, I get something like this....

pi at ntpi ~ $ ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================    .PPS.            0 l    -   16    0    0.000    0.000   0.000    .GPS.            0 l   14   16    1    0.000   50.397   0.002
+   2 u   15   64    1    1.394  509.349   0.197
*    .GPS.            1 u   16   64    1   27.503  506.499   0.188
pi at ntpi ~ $

The server is a raspberry pi with the Adafruit MTK339 GPS chipset.  It is running the image from here... http://ntpi.openchaos.org/downloads/

BTW, thanks to all the raspberry pi NTP guys out there that have gotten me this far!!


More information about the questions mailing list