Re: [chrony-users] Chrony source selection algorithm documentation

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]


Hi Henrik,

On Thu, Mar 10, 2016 at 6:15 PM, Henrik Bieler <henrik.bieler@xxxxxx> wrote:
Hey,

I am running chrony on a raspberry Pi2. It is a mobile unit with 3G
Internet and GPS (Non PPS).

The Raspberry has no RTC, sometimes there is no Internet connection, and
sometimes there is no GPS Fix.

I want to use chrony to keep a more or less accurate time across reboots.

Sometimes when the GPS has no fix the GPS-Time received by chrony
through SHM is off by several years.
I have stopped the systemclock from beeing affected by using

maxchange 31536000 0 -1    #A year in sec

this works. But in such a case I would like chrony to switch to the
ntp-servers (if they are online), which does not happen. Chrony keeps
the GPS as selected source.

What I want is the following:

1) If ntp-servers are online (or come online) use them
2) If ntp-servers are offline (or go offline) use gps, but reject
changes larger than a year

Sounds not too difficult, but I cant get it to work. Chrony seemingly
sticks with the initially selected source, even if it is an offline ntp,
or a gps with huge time error.

I tried reading through docs and google to no avail.

Please help give me some hints on how to configure this or point me to a
piece of documentation on how chrony selects and reselects sources.
And how to tweak this behaviour.

Thank you!

Henrik

chronyd --version
chronyd (chrony) version 1.30
gpsd -V
gpsd: 3.11 (revision 3.11-3)


chrony.conf:

server 0.debian.pool.ntp.org offline prefer minpoll 8
server 1.debian.pool.ntp.org offline prefer minpoll 8
server 2.debian.pool.ntp.org offline prefer minpoll 8
server 3.debian.pool.ntp.org offline prefer minpoll 8

refclock SHM 0 refid GPS precision 1e2 offset 0.9999 delay 0.2

makestep 30 -1
maxchange 31536000 0 -1

keyfile /etc/chrony/chrony.keys
commandkey 1

log tracking measurements statistics
logdir /var/log/chrony

local stratum 10

allow 10/8
allow 192.168/16
allow 172.16/12

logchange 0.5


I'm just a chrony user, but I would say that, in your case, you should address the root cause of the problem :
>> Sometimes when the GPS has no fix the GPS-Time received by chrony through SHM is off by several years.

GPS-sensors normally do not behave like that. They either don't provide a time, or provide a correct one. You should probably fix the software that provides that erroneous GPS time (if possible).

Best regards,

Olivier




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/