1TS2PHC(8)                   System Manager's Manual                  TS2PHC(8)
2
3
4

NAME

6       ts2phc  -  Synchronizes  one or more PTP Hardware Clocks using external
7       time stamps.
8
9

SYNOPSIS

11       ts2phc [ -hmqv ] [ -c device|name ] [ -f config ] [ -l print-level ]  [
12       -s device|name ] [ long-options ] ...
13
14

DESCRIPTION

16       ts2phc  synchronizes  PTP  Hardware Clocks (PHC) to external time stamp
17       signals.  A single source may be used to distribute time to one or more
18       PHC devices.
19
20

OPTIONS

22       -c device|name
23              Specifies  a  PHC slave clock to be synchronized.  The clock may
24              be identified by its character device (like  /dev/ptp0)  or  its
25              associated  network  interface  (like eth0).  This option may be
26              given multiple times.
27
28       -f config
29              Read configuration from the specified  file.   No  configuration
30              file is read by default.
31
32       -h     Displays the command line help summary.
33
34       -l print-level
35              Sets  the  maximum  syslog  level  of  messages  which should be
36              printed  or  sent  to  the  system  logger.  The  default  is  6
37              (LOG_INFO).
38
39       -m     Prints log messages to the standard output.
40
41       -q     Prevents sending log messages to the system logger.
42
43       -s device|name
44              Specifies  the  source  of  the  PPS  signal.   Use the key word
45              "generic" for an external 1-PPS without ToD  information.   When
46              using a master PHC, the clock may be identified by its character
47              device (like /dev/ptp0)  or  its  associated  network  interface
48              (like eth0).  Use the key word "nmea" for an external 1-PPS from
49              a GPS providing ToD information via the RMC NMEA sentence.
50
51       -v     Prints the software version and exits.
52
53

LONG OPTIONS

55       Each and every configuration file option (see below) may also appear as
56       a  "long"  style  command  line  argument.  For example, the use_syslog
57       option may be set using either of these two forms.
58
59              --use_syslog 1   --use_syslog=1
60
61       Option values given on the command line override values in  the  global
62       section of the configuration file.
63
64

CONFIGURATION FILE

66       The  configuration  file  is divided into sections. Each section starts
67       with a line containing its name enclosed in  brackets  and  it  follows
68       with  settings.  Each setting is placed on a separate line, it contains
69       the name of the option and the value separated  by  whitespace  charac‐
70       ters. Empty lines and lines starting with # are ignored.
71
72       There are two different section types.
73
74
75       1.     The  global  section  (indicated  as  [global]) sets the program
76              options and default slave  clock  options.  Other  sections  are
77              clock specific sections, and they override the default options.
78
79       2.     Slave clock sections give the name of the configured slave (e.g.
80              [eth0]).  Slave clocks specified in the configuration file  need
81              not be specified with the -c command line option.
82
83

GLOBAL OPTIONS

85       first_step_threshold
86              The  maximum  offset,  specified in seconds, that the servo will
87              correct by changing the clock frequency instead of stepping  the
88              clock.  This  is  only  applied on the first update. When set to
89              0.0, the servo will not step the clock on start.  The default is
90              0.00002 (20 microseconds).
91
92       free_running
93              When set to 1, no the slave clock will be adjusted.  This option
94              can be useful in test scenarios, for example  to  determine  how
95              well  synchronized  a  group  of local clocks are to each other.
96              The default is 0 (adjust the slave clocks).
97
98       leapfile
99              The path to the current leap  seconds  definition  file.   In  a
100              Debian  system  this  file is provided by the tzdata package and
101              can  be  found  at  /usr/share/zoneinfo/leap-seconds.list.   The
102              default  is  an  empty string, which causes the program to use a
103              hard coded table that reflects the known  leap  seconds  on  the
104              date of the software's release.
105
106       logging_level
107              The  maximum  logging level of messages which should be printed.
108              The default is 6 (LOG_INFO).
109
110       max_frequency
111              The maximum allowed frequency adjustment of the clock  in  parts
112              per billion.  This is an additional limit to the maximum allowed
113              by the hardware. When set to 0, the hardware limit will be used.
114              The default is 900000000 (90%).
115
116       message_tag
117              The  tag  which is added to all messages printed to the standard
118              output or system log.  The default is  an  empty  string  (which
119              cannot  be  set in the configuration file as the option requires
120              an argument).
121
122       step_threshold
123              The maximum offset, specified in seconds, that  the  servo  will
124              correct  by changing the clock frequency instead of stepping the
125              clock. When set to 0.0, the servo  will  never  step  the  clock
126              except on start.  The default is 0.0.
127
128       ts2phc.nmea_remote_host, ts2phc.nmea_remote_port
129              Specifies  the serial port character device providing ToD infor‐
130              mation when using the "nmea" PPS signal source.   Note  that  if
131              these two options are both specified, then the given remote con‐
132              nection will be used in  preference  to  the  configured  serial
133              port.   These  options default to the empty string, that is, not
134              specified.
135
136       ts2phc.nmea_serialport
137              Specifies the serial port character device providing ToD  infor‐
138              mation  when  using  the "nmea" PPS signal source.  Note that if
139              the         options,         ts2phc.nmea_remote_host         and
140              ts2phc.nmea_remote_port,  are  both  specified,  then  the given
141              remote connection will be used in preference to  the  configured
142              serial port.  The default is "/dev/ttyS0".
143
144       ts2phc.pulsewidth
145              The  expected pulse width of the external PPS signal in nanosec‐
146              onds.  When 'ts2phc.extts_polarity' is "both", the  given  pulse
147              width  is  used  to  detect  and  discard  the time stamp of the
148              unwanted edge.  The supported  range  is  1000000  to  990000000
149              nanoseconds.  The default is 500000000 nanoseconds.
150
151       use_syslog
152              Print  messages  to the system log if enabled.  The default is 1
153              (enabled).
154
155       verbose
156              Print messages to the standard output if enabled.   The  default
157              is 0 (disabled).
158
159

SLAVE CLOCK OPTIONS

161       ts2phc.channel
162              The  external  time  stamping  or  periodic output channel to be
163              used.  Some PHC devices feature programmable  pins  and  one  or
164              more  time  stamping  channels.   This option allows selecting a
165              particular channel to be used.  When using a PHC device  as  the
166              PPS  source,  this  option  selects the periodic output channel.
167              The default is channel 0.
168
169       ts2phc.extts_correction
170              The value, in nanoseconds, to be added to each PPS  time  stamp.
171              The default is 0 (no correction).
172
173       ts2phc.extts_polarity
174              The  polarity  of  the  external  PPS signal, either "rising" or
175              "falling".  Some PHC devices always time stamp both edges.  Set‐
176              ting this option to "both" will allow the ts2phc program to work
177              with such devices by detecting and ignoring the  unwanted  edge.
178              In  this  case be sure to set 'ts2phc.pulsewidth' to the correct
179              value.  The default is "rising".
180
181       ts2phc.master
182              Setting this option to 1 configures the given PHC device as  the
183              source of the PPS signal.  The default is 0 for the slave role.
184
185       ts2phc.pin_index
186              The pin index to be used.  Some PHC devices feature programmable
187              pins, and this option allows configuration of a  particular  pin
188              for the external time stamping or periodic output function.  The
189              default is pin index 0.
190
191

WARNING

193       Be cautious when sharing the same  configuration  file  between  ptp4l,
194       phc2sys, and ts2phc.  Keep in mind that values specified in the config‐
195       uration file take precedence over the default  values.   If  an  option
196       which is common to the other programs is set in the configuration file,
197       then the value will be applied to all the programs using the file,  and
198       this might not be what is expected.
199
200       It  is  recommended  to  use  separate  configuration  files for ptp4l,
201       phc2sys, and ts2phc in order to avoid any unexpected behavior.
202
203

SEE ALSO

205       phc2sys(8) ptp4l(8)
206
207
208
209linuxptp                         December 2019                       TS2PHC(8)
Impressum