【问题标题】:ptp4l High Values of Master offset, freq and path delayptp4l 主偏移、频率和路径延迟的高值
【发布时间】:2021-05-03 02:02:58
【问题描述】:

我有以下测试台

大师

TQMLS1028A-IND

它只有 硬件 时间戳 操作系统,

ID="poky"
NAME="Poky (Yocto Project Reference Distro)"
VERSION="3.0.4 (zeus)"
VERSION_ID="3.0.4"
PRETTY_NAME="Poky (Yocto Project Reference Distro) 3.0.4 (zeus)"

它有ptp4l 2.0版

从属

电脑 它只有 软件 时间戳 操作系统:

NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

我正在为master使用这个命令

taskset -c 1 chrt 99 ptp4l -i eno1 -mq

这个命令用于从站

sudo taskset -c 1 chrt 99 ptp4l -S -i enp3s0f1 -mq -s

它给了我非常高的主偏移、频率和路径延迟值,它在 MASTER_CLOCK_SELECTED 上进入状态 s2 SLAVE,但只有几秒钟。它给出了以下错误

ptp4l[7632.725]: master offset 1611850007215613701 s2 freq +100000000 path delay  17013783
ptp4l[7633.625]: master offset 1611850007110097044 s2 freq +100000000 path delay  22519248
ptp4l[7634.525]: clockcheck: clock jumped forward or running faster than expected!
ptp4l[7634.525]: master offset 1611850010370484934 s0 freq +100000000 path delay  22519248
ptp4l[7634.525]: port 1: SLAVE to UNCALIBRATED on SYNCHRONIZATION_FAULT
ptp4l[7635.425]: master offset 1611850010270476347 s0 freq +100000000 path delay  22519248
ptp4l[7636.325]: master offset 1611850010167504974 s0 freq +100000000 path delay  25493617

git的linuxptp仓库里有一些配置文件,我试过用gPTP.cfg文件toc配置ptpt4l,用命令 给大师

taskset -c 1 chrt 99 ptp4l -f gPTP.cfg -i eno1 -mq

为奴隶

sudo taskset -c 1 chrt 99 ptp4l -S -f gPTP.cfg -i enp3s0f1 -mq -s

但这是最糟糕的,因为 SLAVE 根本不尝试同步

ptp4l[8748.087]: selected local clock b82a72.fffe.9ac430 as best master
ptp4l[8751.360]: selected local clock b82a72.fffe.9ac430 as best master
ptp4l[8754.814]: selected local clock b82a72.fffe.9ac430 as best master

我不确定问题是因为它们具有不同的时间戳,还是我必须提供任何配置文件或参数。

你能帮忙吗?

提前谢谢你

【问题讨论】:

    标签: linux ubuntu yocto clock ptp


    【解决方案1】:

    通过以下方式解决了这个问题

    1. 关闭两个系统中的 NTP 服务
           timedatectl set-ntp false
           sudo systemctl stop systemd-timedated.service
           sudo systemctl stop systemd-timesyncd
    
    
    1. 使用如下命令同步网卡中的时间,eno1为接口。请注意这一点,因为 NIC 的时间可能与系统时钟的时间不同,并且可能会产生问题。考虑到 eno1 是您进行同步的界面
            phc2sys -c eno1 -O 0 -w -m -s CLOCK_REALTIME
    
    1. 打开 phc2sys,使其系统时钟与接口的 ptp 时钟同步
             phc2sys -s eno1 -m -w
    
    1. 在master中开启ptp4l
              ptp4l -i eno1 -mq -2
    
    1. 在slave端开启ptp4l
               ptp4l -S -i enp3s0f1 -mq -s -2
    
    

    ptp4l中的选项-2(IEEE 802.3或以太网),可以改为-4(UDP IPV4)或-6(UDP IPV6)

    【讨论】:

      猜你喜欢
      • 2018-01-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-30
      • 2017-02-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多