首页 > 解决方案 > 我不明白为什么我在从时钟上看不到输出偏移?如何检查时钟同步?

问题描述

所以,我阅读了很多关于 PTP 的文档,但我不明白为什么它不起作用。我有 2 台设备(带有软件时间戳的笔记本电脑和带有支持硬件时间戳的网卡的 PC)

我通过以下命令在笔记本电脑上运行 ptp4l: sudo ptp4l -i enx503eaab76d25 -S -m -A -m -q -l 7 -f path/to/ptp4l.conf

在此处输入图像描述

我们可以看到我笔记本电脑上的 ptp4l 正确地找到了主时钟(在 PC 上运行的 ptp4l 守护进程,硬件支持时间戳)。但是!您也只能在输出中看到延迟超时。老实说,我不明白这是什么意思。我期望的输出是什么?就像在每个专门用于配置 ptp4l 的教程中一样。例如:

在此处输入图像描述

(在有网卡的PC上)通过命令启动主时钟:sudo ptp4l -i eth1 -m -A -l 7 -q -f path/to/ptp4l.conf -m 在此处输入图像描述

上面提到了PC上带有硬件时间戳的端口 在此处输入图像描述

两台计算机都有相同的 ptp4l.conf 文件:

[global]
#
# Default Data Set
#
twoStepFlag             1
slaveOnly               0
priority1               128
priority2               128
domainNumber            0
#utc_offset             37
clockClass              248
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
tx_timestamp_timeout    1
use_syslog              1
verbose                 0
summary_interval        0
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              0xA0

简而言之,我如何确保时钟同步?

标签: linuxtimestampembedded-linuxptp

解决方案


推荐阅读