jclark / pc-ptp-ntp-guide Goto Github PK
View Code? Open in Web Editor NEWGuide to precision network time synchronization on PC hardware
Guide to precision network time synchronization on PC hardware
Why don’t you need to specify sdp?
cat /etc/linuxptp/ts2phc-generic.cfg
[global]
ts2phc.extts_polarity both
ts2phc.pulsewidth 100000000
leapfile /usr/share/zoneinfo/leap-seconds.list
step_threshold 0.1
ts2phc.nmea_serialport /dev/ttyS9
ts2phc.nmea_baudrate 9600
logging_level 7
[enp1s0]
I got an Intel i225-T1 and soldered a header into the board for SDP1. How do I verify that the card is getting a PPS signal?
I have a GT-U7 connected to a RS-232 driver module however the GPS PPS signal is split for testing: one goes to the serial and another goes to SDP1 on the i225-LM.
root@ptp2server:/# dmesg | grep tty
[ 0.195782] printk: console [tty0] enabled
[ 1.375377] 00:02: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 1.395456] 0000:00:03.3: ttyS1 at I/O 0xecd8 (irq = 17, base_baud = 115200) is a 16550A
Following the LinuxPTP as a Grandmaster, these are the configs I've attempted:
Refclock
OPTIONS="-f /etc/linuxptp/ts2phc.conf"
ts2phc service
[Unit]
Description=Synchronize PTP hardware clock from external timestamp
# -s generic uses system clock as source for ToD
# so we depend on time being in sync
# In order for this to have effect, you need to also enable chrony-wait.service (or something similar)
# Comment the next line out if you change to -s nmea below
##After=time-sync.target
# This is not ideal for -s nmea, but I'm not sure what's better.
After=network-online.target
[Service]
Type=simple
EnvironmentFile=-/etc/sysconfig/ts2phc
EnvironmentFile=-/etc/default/ts2phc
# If you change this to -s nmea, then comment out the ordering after time-sync.target above.
##ExecStart=/usr/sbin/ts2phc -s generic $OPTIONS
ExecStart=/usr/sbin/ts2phc -s nmea $OPTIONS
[Install]
WantedBy=multi-user.target
ts2phc.conf
# Configuration file for ts2phc
# For more information about this file, see the ts2phc(8) man page.
[global]
ts2phc.extts_polarity both
ts2phc.pulsewidth 100000000
leapfile /usr/share/zoneinfo/leap-seconds.list
step_threshold 0.1
# these are only used with -s nmea, and are ignored with -s generic
###ts2phc.nmea_serialport /dev/ttyS0
ts2phc.nmea_serialport /dev/ttyS0
# This is only supported with Linux PTP 4.x
# ts2phc.nmea_baudrate 9600
# In LinuxPTP 3.x, you need logging_level to be 7 in order to get messages showing the PPS-PHC offsets.
# With LinuxPTP 4.x, you get these messages at log level 6 (which is the default).
logging_level 7
[enp1s0]
Verify Time Stamping
root@ptp2server:/# cat /sys/class/ptp/ptp0/fifo
0 1708394388 16169995
Last 30 seconds of log messages
root@ptp2server:/# journalctl -u ts2phc -S -30s
-- No entries --
Offsets
root@ptp2server:/# phc_ctl enp1s0 cmp
phc_ctl[22958.066]: offset from CLOCK_REALTIME is 1082449982ns
root@ptp2server:/# systemctl restart ts2phc
root@ptp2server:/# journalctl -u ts2phc -S -30s
Feb 19 21:21:28 ptp2server systemd[1]: Started ts2phc.service - Synchronize PTP hardware clock from external timestamp.
Feb 19 21:21:28 ptp2server ts2phc[1035]: no slave clocks specified
Feb 19 21:21:28 ptp2server ts2phc[1035]: usage: ts2phc [options]
Feb 19 21:21:28 ptp2server ts2phc[1035]: -c [dev|name] phc slave clock (like /dev/ptp0 or eth0)
Feb 19 21:21:28 ptp2server ts2phc[1035]: (may be specified multiple times)
Feb 19 21:21:28 ptp2server ts2phc[1035]: -f [file] read configuration from 'file'
Feb 19 21:21:28 ptp2server ts2phc[1035]: -h prints this message and exits
Feb 19 21:21:28 ptp2server ts2phc[1035]: -l [num] set the logging level to 'num'
Feb 19 21:21:28 ptp2server ts2phc[1035]: -m print messages to stdout
Feb 19 21:21:28 ptp2server ts2phc[1035]: -q do not print messages to the syslog
Feb 19 21:21:28 ptp2server ts2phc[1035]: -s [dev|name] source of the PPS signal
Feb 19 21:21:28 ptp2server ts2phc[1035]: may take any of the following forms:
Feb 19 21:21:28 ptp2server ts2phc[1035]: generic - an external 1-PPS without ToD information
Feb 19 21:21:28 ptp2server ts2phc[1035]: /dev/ptp0 - a local PTP Hardware Clock (PHC)
Feb 19 21:21:28 ptp2server ts2phc[1035]: eth0 - a local PTP Hardware Clock (PHC)
Feb 19 21:21:28 ptp2server ts2phc[1035]: nmea - a gps device connected by serial port or network
Feb 19 21:21:28 ptp2server ts2phc[1035]: -v prints the software version and exits
Feb 19 21:21:28 ptp2server systemd[1]: ts2phc.service: Main process exited, code=exited, status=255/EXCEPTION
Feb 19 21:21:28 ptp2server systemd[1]: ts2phc.service: Failed with result 'exit-code'.
root@ptp2server:/# journalctl -u ts2phc -S /dev/ttyS0 -30s
Failed to parse timestamp: /dev/ttyS0
root@ptp2server:/#
root@ptp2server:/# journalctl -u ts2phc -S /dev/ttyS1 -30s
Failed to parse timestamp: /dev/ttyS1
root@ptp2server:/#
root@ptp2server:/# journalctl -u ts2phc -S /dev/ttyS1 -30s
Failed to parse timestamp: /dev/ttyS1
root@ptp2server:/#
root@ptp2server:/# journalctl -u ts2phc -S nmea -30s
Failed to parse timestamp: nmea
Have you ever encountered the gm clock following the falling edge, followed by the rising edge about 20 minutes later.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.