With the recent patches I posted on this list it should be now
possible to run multiple ptp4l and phc2sys instances providing SHM
refclocks which can be used with other time sources (NTP or other
reference clocks) by chronyd or ntpd to synchronize the system clock.

In my testing it seems to be working well so far. A problem is that
preparing the configuration and starting the processes manually is
tedious and annoying, the uds paths must match between ptp4l and
phc2sys, the SHM segment number must match between ptp4l/phc2sys and
chronyd/ntpd, etc. I think there should be a better way to do this
than writing a custom script for each use case.

I've started working on a program that should make this easier. It
will read a configuration file describing all time sources, check
which interfaces have (and share) a PHC, generate configuration files
for ptp4l and chronyd/ntpd, and start the ptp4l, phc2sys, chronyd/ntpd
processes as necessary. Then, it will just wait for a signal to kill
the processes and remove the generated configuration files.

The configuration file could look like this:

[ptp-domain 0]
interfaces eth0 eth1

[ptp-domain 1]
interfaces eth2
delay_mechanism P2P

[ntp-server 10.1.1.1]
minpoll 3
maxpoll 3

[ntp-server 10.1.1.2]

I want to include support for PTP and NTP used as a slave/client
first. Server/master configuration and support for other time sources
could be added later if there is interest. Other sources could include
PHC specified directly, GPS without PPS (SHM refclock provided by
gpsd), GPS with PPS, PPS device specified directly, PPS of a PHC, or a
PPS over serial port (enabled by ldattach).

They could be configured like this:

[ptp-clock /dev/ptp2]
offset 35

[gps /dev/ttyS0]
[pps-gps /dev/ttyS1]
[pps-device /dev/pps0]
[pps-phc eth2]
[pps-serial /dev/ttyS2]

Would you be interested in including this program in linuxptp? Are
dependencies on external programs acceptable?

-- 
Miroslav Lichvar

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to