Hi and thanks for a great open-source project. I am trying to setup a
grandmaster based on a BeagleBone Black which synchronizes its system clock to
a uBlox F9P GNSS receiver through ntpd. I am using phc2sys to synchronize the
PTP clock to the system clock. It mostly works great except that it announces
"currentUtcOffsetValid:0" even though an offset is applied to the UTC time,. At
the bottom of the email I have added the ptp4l config file and the phc2sys
service file. If I understand it correctly phc2sys is waiting for ptp4l to
start and then applies the utcOffset desired by ptp4l to the system clock when
synchronizing. I can verify the currentUtcOffsetValid:0 on both slave and gm
side:
erling@ubuntu-ntnu ~> sudo pmc -u -b 0 'GET TIME_PROPERTIES_DATA_SET'
sending: GET TIME_PROPERTIES_DATA_SET
a4bb6d.fffe.b27ab3-0 seq 0 RESPONSE MANAGEMENT TIME_PROPERTIES_DATA_SET
currentUtcOffset 37
leap61 0
leap59 0
currentUtcOffsetValid 0
ptpTimescale 1
timeTraceable 0
frequencyTraceable 0
timeSource 0xa0
and at the grandmaster side:
debian@beaglebone:~$ sudo pmc -u -b 0 'GET GRANDMASTER_SETTINGS_NP'
sending: GET GRANDMASTER_SETTINGS_NP
78a504.fffe.caf7d4-0 seq 0 RESPONSE MANAGEMENT GRANDMASTER_SETTINGS_NP
clockClass 128
clockAccuracy 0xfe
offsetScaledLogVariance 0xffff
currentUtcOffset 37
leap61 0
leap59 0
currentUtcOffsetValid 0
ptpTimescale 1
timeTraceable 0
frequencyTraceable 0
timeSource 0x20
I have taken a look at the source code but it seemed like the
currentUtcOffsetValid only was modified through the pmc utility. I have
verified that I can in fact manually set the currentUtcOffset by using pmc 'SET
GRANDMASTER_SETTINGS_NP', this would have to be done at each boot. My question
for you is twofold
1. Is there another perferred way of getting the grandmaster to announce
currentUtcOffsetVaid: 1?
2. As far as I understand the UTC-TAI offset is changing so by hardcoding an
offset (which I have done) in the ptp4l config will at some point in the
future make it outdated (wrt TAI)
A) Is there a way to have phc2sys and ptp4l update the utcOffset in the future
when a new leap second is added?
B) What are the practical consequences of having an outdated UtcOffset? We are
using it in a robotics system and timestamp events in UTC. I would assume that
in this case I could use an arbitrary UtcOffset as long as it is announced and
currentUtcOffsetValid:1
I have a feeling that I am failing to understand something fundamental about
how these tools work and I gladly take pointers are links to
documents/blogs/etc describing it.
Thanks for your time,
Erling R. Jellum
--------------------------------------
### phc2sys service file: ###
debian@beaglebone:~$ cat /lib/systemd/system/phc2sys.service
[Unit]
Description=Synchronize system clock or PTP hardware clock (PHC)
Documentation=man:phc2sys
# I have added ntp.service here to try to make sure that the system clock is
synced to GPS before phc2sys runs
After=ntp.service
After=ntpdate.service
Requires=ptp4l.service
After=ptp4l.service
[Service]
Type=simple
ExecStart=/usr/sbin/phc2sys -a -rr
[Install]
WantedBy=multi-user.target
### ptp4l ###
debian@beaglebone:~$ cat /lib/systemd/system/ptp4l.service
[Unit]
Description=Precision Time Protocol (PTP) service
Documentation=man:ptp4l
[Service]
Type=simple
ExecStart=/usr/sbin/ptp4l -f /etc/linuxptp/ptp4l.conf -i eth0
[Install]
WantedBy=multi-user.target
debian@beaglebone:~$ cat /etc/linuxptp/ptp4l.conf
[global]
#
# Default Data Set
#
twoStepFlag 1
slaveOnly 0
priority1 128
priority2 128
domainNumber 0
utc_offset 37
clockClass 128
clockAccuracy 0xFE
offsetScaledLogVariance 0xFFFF
free_running 0
freq_est_interval 1
dscp_event 0
dscp_general 0
#
# Port Data Set
#
logAnnounceInterval 1
logSyncInterval 0
logMinDelayReqInterval 0
logMinPdelayReqInterval 0
announceReceiptTimeout 3
syncReceiptTimeout 0
delayAsymmetry 0
fault_reset_interval 4
neighborPropDelayThresh 20000000
#
# Run time options
#
assume_two_step 0
logging_level 6
path_trace_enabled 0
follow_up_info 0
hybrid_e2e 0
net_sync_monitor 0
tx_timestamp_timeout 1
use_syslog 1
verbose 0
summary_interval 1
kernel_leap 1
check_fup_sync 0
#
# Servo Options
#
pi_proportional_const 0.0
pi_integral_const 0.0
pi_proportional_scale 0.0
pi_proportional_exponent -0.3
pi_proportional_norm_max 0.7
pi_integral_scale 0.0
pi_integral_exponent 0.4
pi_integral_norm_max 0.3
step_threshold 0.0
first_step_threshold 0.00002
max_frequency 900000000
clock_servo pi
sanity_freq_limit 200000000
ntpshm_segment 0
#
# Transport options
#
transportSpecific 0x0
ptp_dst_mac 01:1B:19:00:00:00
p2p_dst_mac 01:80:C2:00:00:0E
udp_ttl 1
udp6_scope 0x0E
uds_address /var/run/ptp4l
#
# Default interface options
#
network_transport UDPv4
delay_mechanism E2E
time_stamping hardware
tsproc_mode filter
delay_filter moving_median
delay_filter_length 10
egressLatency 0
ingressLatency 0
boundary_clock_jbod 0
#
# Clock description
#
productDescription ;;
revisionData ;;
manufacturerIdentity 00:00:00
userDescription ;
timeSource 0x20
_______________________________________________
Linuxptp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-users