![精确时间协议 (PTP) 软件模式设置,以主计算机作为主时钟](https://linux22.com/image/1027638/%E7%B2%BE%E7%A1%AE%E6%97%B6%E9%97%B4%E5%8D%8F%E8%AE%AE%20(PTP)%20%E8%BD%AF%E4%BB%B6%E6%A8%A1%E5%BC%8F%E8%AE%BE%E7%BD%AE%EF%BC%8C%E4%BB%A5%E4%B8%BB%E8%AE%A1%E7%AE%97%E6%9C%BA%E4%BD%9C%E4%B8%BA%E4%B8%BB%E6%97%B6%E9%92%9F.png)
我有一台 Jetson Nano 和一个以太网连接的传感器(具体来说,是一个支持 PTP 的 LiDAR),我想在它们之间设置 PTP 同步,但我对文档有点困惑(我主要想遵循https://static.ouster.dev/sensor-docs/image_route1/image_route2/appendix/ptp-quickstart.html)。我想强制 Jetson Nano 系统时钟为“主”时钟。在 Jetson Nano 上,传感器所连接的以太网端口似乎不支持硬件时间戳:
$ sudo ethtool -T eth0
Time stamping parameters for eth0:
Capabilities:
software-transmit (SOF_TIMESTAMPING_TX_SOFTWARE)
software-receive (SOF_TIMESTAMPING_RX_SOFTWARE)
software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
PTP Hardware Clock: none
Hardware Transmit Timestamp Modes: none
Hardware Receive Filter Modes: none
所以我尝试以软件模式设置 PTP 服务器。
我的设置步骤是:
sudo apt install linuxptp chrony ethtool
sudo nano /etc/linuxptp/ptp4l.conf
# set `priority1` and `priority2` to `0` so that the Jetson Nano system clock is always the master? Is this correct?
# set `time_stamping` to `software`
# set `free_running` to `1` so that the Jetson system clock is not modified
sudo systemctl daemon-reload
sudo systemctl restart ptp4l
这是设置 PTP 服务器以使用 Jetson 系统时钟作为主时钟的正确方法吗?phc2sys 有什么用?