AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

    • 主页
    • 系统&网络
    • Ubuntu
    • Unix
    • DBA
    • Computer
    • Coding
    • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-271228

Elshan's questions

Martin Hope
Elshan
Asked: 2024-04-05 07:15:53 +0800 CST

PTP 时间同步不起作用,为什么它总是选择最好的主时钟作为本地时钟?

  • 7

我正在尝试与 PTP 同步时间;我已使用 PTP 配置 Trimble 设备。但是,当我使用具有以下配置的 LinuxPTP 时,本地时钟始终被选为最佳主时钟。

ptp4l[892.103]: selected local clock 00032d.fffe.55bd3b as best master

我想知道为什么它不选择 Trimble 设备作为主时钟。

设备通过 SFP/光纤电缆连接。

  • PTP 配置文件 -/etc/linuxptp/ptpv2.conf
    [global]
    verbose         1  
    domainNumber    24
    clockClass      6
    priority1       128
    priority2       128
    [enp11s0]
    
  • 像这样运行sudo并控制台此输出。
    $ sudo ptp4l -f /etc/linuxptp/ptpv2.conf 
    ptp4l[886.038]: selected /dev/ptp7 as PTP clock
    ptp4l[886.039]: port 1 (enp11s0): INITIALIZING to LISTENING on INIT_COMPLETE
    ptp4l[886.039]: port 0 (/var/run/ptp4l): INITIALIZING to LISTENING on INIT_COMPLETE
    ptp4l[886.039]: port 0 (/var/run/ptp4lro): INITIALIZING to LISTENING on INIT_COMPLETE
    ptp4l[892.103]: port 1 (enp11s0): LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
    ptp4l[892.103]: selected local clock 00032d.fffe.55bd3b as best master
    ptp4l[892.103]: port 1 (enp11s0): assuming the grand master role
    
  • 我还捕获了 Wireshark 公告消息,看看是否有助于调试此消息。
    Frame 9466: 78 bytes on wire (624 bits), 78 bytes captured (624 bits) on interface enp11s0, id 0
    Ethernet II, Src: Trimble_70:07:6a (00:17:47:70:07:6a), Dst: IEEEI&MS_00:00:00 (01:1b:19:00:00:00)
    Precision Time Protocol (IEEE1588)
        0000 .... = majorSdoId: Unknown (0x0)
        .... 1011 = messageType: Announce Message (0xb)
        0000 .... = minorVersionPTP: 0
        .... 0010 = versionPTP: 2
        messageLength: 64
        domainNumber: 24
        minorSdoId: 0
        flags: 0x003c
            0... .... .... .... = PTP_SECURITY: False
            .0.. .... .... .... = PTP profile Specific 2: False
            ..0. .... .... .... = PTP profile Specific 1: False
            .... .0.. .... .... = PTP_UNICAST: False
            .... ..0. .... .... = PTP_TWO_STEP: False
            .... ...0 .... .... = PTP_ALTERNATE_MASTER: False
            .... .... .0.. .... = SYNCHRONIZATION_UNCERTAIN: False
            .... .... ..1. .... = FREQUENCY_TRACEABLE: True
            .... .... ...1 .... = TIME_TRACEABLE: True
            .... .... .... 1... = PTP_TIMESCALE: True
            .... .... .... .1.. = PTP_UTC_REASONABLE: True
            .... .... .... ..0. = PTP_LI_59: False
            .... .... .... ...0 = PTP_LI_61: False
        correctionField: 0.000000 nanoseconds
            correction: Ns: 0 nanoseconds
            correctionSubNs: 0 nanoseconds
        messageTypeSpecific: 0
        ClockIdentity: 0x001747fffe70076a
            MAC Vendor: Trimble
        SourcePortID: 1
        sequenceId: 28828
        controlField: Other Message (5)
        logMessagePeriod: -3
        originTimestamp (seconds): 0
        originTimestamp (nanoseconds): 0
        originCurrentUTCOffset: 37
        priority1: 128
        grandmasterClockClass: 6
        grandmasterClockAccuracy: The time is accurate to within 100 ns (0x21)
        grandmasterClockVariance: 20061
        priority2: 128
        grandmasterClockIdentity: 0x001747fffe70076a
        localStepsRemoved: 0
        TimeSource: GPS (0x20)
    
  • 同步命令
    phc2sys -w -m -s enp11s0 -c CLOCK_REALTIME
    

当我在互联网上检查其他一些配置时,他们的日志显示正确的时钟选择,但我的总是选择最好的主时钟作为本地时钟,并且它不会同步主/边界时钟的时间(现在,我我使用的是带有 GPS 的 Trimble 1570001820 设备)。

其他注意事项:

  • NTP 已禁用
  • 硬件能够处理 PTP,并且安装了最新的驱动程序。
synchronization
  • 1 个回答
  • 33 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助
subwaysurfers
my femboy roommate

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve