Hi again,
phc2sys has an automatic mode. See the man page for details.
I have some follow up question as I still can not see that I get this
correct. I hope some experienced linuxptp users can help out. I can not
get sync between CLOCK_REALTIME and PHC as I expect.
I have two devices connected through a AVB Switch running gPTP config
like the example from the repo. Only changed priority to 246 in order to
become master instead of the AVB Switch. Both devices runnin glinuxptp
version 3.1.1. Here is the config file used for ptp4l:
#
# 802.1AS example configuration containing those attributes which
# differ from the defaults. See the file, default.cfg, for the
# complete list of available options.
#
[global]
gmCapable 1
priority1 246
priority2 246
logAnnounceInterval 0
logSyncInterval -3
syncReceiptTimeout 3
neighborPropDelayThresh 800
min_neighbor_prop_delay -20000000
assume_two_step 1
path_trace_enabled 1
follow_up_info 1
transportSpecific 0x1
ptp_dst_mac 01:80:C2:00:00:0E
network_transport L2
delay_mechanism P2P
On the first device I start and configure the linuxptp applications like
this:
$ ptp4l -i eth1 -f gPTP.cfg
$ pmc -u -b 0 -t 1 "SET GRANDMASTER_SETTINGS_NP clockClass 246 \
clockAccuracy 0xfe offsetScaledLogVariance 0xffff \
currentUtcOffset 37 leap61 0 leap59 0 currentUtcOffsetValid 1 \
ptpTimescale 1 timeTraceable 1 frequencyTraceable 0 \
timeSource 0xa0"
$ phc2sys -a -r -r --transportSpecific=1 -E ntpshm
With this configuration this PTP device becomes master on the network.
phc2sys starts to sync PHC from CLOCK_REALTIME. What I now expect is
that CLOCK_REALTIME (in UTC) will be exactly 37 seconds behind PHC (in
TAI) but I can not see this happen.
$ date;phc_ctl eth1 get;phc_ctl eth1 cmp
Thu Oct 14 08:56:37 UTC 2021
phc_ctl[573.296]: clock time is 1634201797.174712670 or Thu Oct 14
08:56:37 2021
phc_ctl[573.303]: offset from CLOCK_REALTIME is 1472ns
The log file from phc2sys output like this:
phc2sys[524]: [599.261] eth1 sys offset -37000001462 s0 freq +0
delay 875
phc2sys[524]: [600.262] eth1 sys offset -37000001467 s0 freq +0
delay 875
As phc_ctl does not compensate for UTC-TAI as I interpret the code I
expected to see the 37 sec diff in the output from that utility and in
the log file I expect something close to 0 offset. I think I have some
bad configuration in my setup. Can someone help me understand how to
proper setup this in order to get a good sync on the master side between
the clocks? And I assume that I can use the same setting on the slave
device to get it correct in that end to? I also think it is strange I
can not get better precision than around 1.4 ms between the clocks.
Thanks,
/Peter
_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users