widlokm Tux's lil' helper
Joined: 22 Sep 2007 Posts: 75 Location: Poland
|
Posted: Tue Mar 21, 2023 5:44 pm Post subject: chronyd with hardware timestamping |
|
|
Hello,
I would like to have machines on my local network synchronized with PTP using ptp4l and chrony. Basically the configuration is like this:
Machine 1 - connected to internet, takes time from world servers (pl.pool.ntp.org in my case). I want this one to be PTP master clock for my local network (192.168.70.xxx). It runs chrony, ptp4l, phc2sys:
chrony.conf
Code: | pool pl.pool.ntp.org iburst
driftfile /var/lib/chrony/dift
makestep 1.0 3
rtconutc
hwtimestamp *
allow 192.168.70 |
ptp4l and phc2sys are started as system services with options:
Code: | ptp4l -i enp0s25
phc2sys -a -r -r -u60 |
Machine 2 - connected to local network, gets time from machine 1, running chronyd and ptp4l:
chrony.conf:
Code: | server 192.168.70.10 iburst prefer xleave minpoll 0 maxpoll 3
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtconutc
hwtimestamp * |
ptp4l options:
The problem is that on machine 2 chronyd must be started after all network interfaces and machine 1 is up. If it is started before or if network is down for a while (disconnected cable for few seconds) it never gets full hardware timestamps. For example if I turn all machines off, then on "chronyc ntpdata" on machine 2 shows:
Code: | TX timestamping : Hardware
RX timestamping : Kernel |
However just after "rc-service chronyd restart" it is ok:
Code: | TX timestamping : Hardware
RX timestamping : Hardware |
Then disconnect network for a second, connect it, and it switches to "RX timestamping : Kernel". Again after "rc-service chronyd restart" I have full hardware timestamping back.
What I am missing here? It seems that chronyd has to be restarted after every network fail, is that a bug?
Thanks in advance,
Michael W. |
|