PTP
安装linuxptp
编译安装
1 | git clone http://git.code.sf.net/p/linuxptp/code linuxptp |
deb 安装
1 | apt install linuxptp |
检查网卡状态
1 | ethtool -T enp0s31f6 |

配置PTP时钟
设备端
禾赛雷达

Livox
不需要配置
服务端
1 | sudo ptp4l -i enp0s31f6 -m |
验证
如果网络中出现 Sync Message 数据,说明服务端ptp4l程序的master时钟功能正常运行,如果网络中出现 Delay_Req Message 数据,说明设备端slave时钟功能正常运行。

接入NTP
配置PTP硬件时间
让PTP硬件时钟和系统时间同步
1 | sudo phc2sys -c enp0s31f6 -s CLOCK_REALTIME -O 0 |
搭建NTP服务
安装
1 | sudo apt install ntp |
配置
1 | sudo vi /etc/ntp.conf |
1 | # For more information about this file, see the man pages |
启动NTP服务
1 | systemctl start ntp |
客户端配置
海康威视

验证

Chapter 23. Configuring PTP Using ptp4l Red Hat Enterprise Linux 6 | Red Hat Customer Portal
5. Livox设备时间同步 — Livox wiki 0.1 文档 (livox-wiki-cn.readthedocs.io)