How to get ntp to use gpsd to update system date/time with a large offset

I decided to go for a work-around... I used chrony.

Here is what I have in the config file at /etc/chrony/chrony.conf to use the GPS as the reference clock (source):

refclock SHM 0

Then, to actually get chrony to do large offset adjustments, instead of the normal gradual ones, I added this to the same config file:

makestep 1000 -1

That means that the step adjustment will happen when the hardware clock is off by at least a 1000 seconds. -1 means try as many times as it takes to get to match the reference clock.

I left the other settings intact, as provided by Debian Wheezy.


4 hours limit checking is implemented in ntpd/refclock_shm.c (ntp-4.2.8p7) and setting value '1' to flag1 in /etc/ntp.conf seems to stop this checking.

 server 127.127.28.0 minpoll 4 maxpoll 4 prefer
 fudge 127.127.28.0 refid GPS stratum 4
 fudge 127.127.28.0 time1 0.113  # coarse processing delay offset
 fudge 127.127.28.0 flag1 1      # ignore difference limit

I am running ntpd 4.2.8p3 on a RaspberryPi.

Tags:

Gpsd

Ntpd