15.8. Serving NTP Time with PTP
NTP
to
PTP
synchronization in the opposite direction is also possible. When
ntpd
is used to synchronize the system clock,
ptp4l can be configured with the
priority1
option (or other clock options included in the best master clock algorithm) to be the grandmaster clock and distribute the time from the system clock via
PTP
:
~]# cat /etc/ptp4l.conf
[global]
priority1 127
[em3]
# ptp4l -f /etc/ptp4l.conf
With hardware time stamping,
phc2sys needs to be used to synchronize the
PTP
hardware clock to the system clock:
~]# phc2sys -c em3 -s CLOCK_REALTIME -w
To prevent quick changes in the
PTP
clock's frequency, the synchronization to the system clock can be loosened by using smaller
P
(proportional) and
I
(integral) constants of the PI servo:
~]# phc2sys -c em3 -s CLOCK_REALTIME -w -P 0.01 -I 0.0001