[LinuxPPS] 1PPS Atom Ref Clock Not being Polled?

K. Connolly hbar at u.washington.edu
Wed Jul 22 03:21:12 CEST 2009


Hello All,

After much effort, reading, and trial and error I am, I think, quite close 
to finally getting my NTP setup working with a local 1PPS signal from my 
GPS unit (TrueTime/Symmetricom XL-DC). The one sentence description of my 
current problem is: Everything appears to be setup OK, things run as they 
should, with the exception that my PPS source is never polled (even with 
multiple ntp pool servers and waiting a long time). I'll give a quick 
overview of my procedure below with the detailed info at the bottom. 
Thanks in advance for any suggestions!

1. Verified 1PPS signal with scope, setup serial connection as many 
hardware guides suggest, connected to computer. (Is 20us width really too 
short?)

2. Followed LinuxPPS install wiki exactly, got good results (disabled 
ktimer). ppstest shows signal with asserts at 0.00 and clears at ###.###, 
perhaps due to rising edge?

3. procured ldattach from util-linux-ng-2.16-rc2, applied patch from wiki 
(necessary, even though I'm not using NMEA?). Appears to work fine, though 
I am not sure how to get minicom to read/verify any port activity (changed 
port to /dev/ttyS0 but not sure beyond that...)

4. procured ntp-4.2.4p7, used patched timex.h file, had compile errors 
using LinuxPPS headers. Reverted to using prior system files (i.e. skip 
creating symbolic links to linuxpps modules as suggested in wiki), 
compiled fine, but cannot get "NANO" status in ntp.

5. Read that ntp-4.2.4p6 causes issues, despite using p7 i decide to try 
4.2.4p5. Have identical errors as step#4, but this time compiles using 
with old system files and "NANO" mode DOES exist.

6. I run "ldattach 18 /dev/ttyS0", start "ntpd -g" and wait. The PPS 
signal never polls. Now I am stuck.

****** Further Details ******:

1. Only comment here is that I've read some claims that 20us pulse width 
is too short, but I have also found forum posts of getting 20us pulse 
width to work fine (perhaps with hardpps or some other settings...). 
Thoughts? Suggestions?

2. Here is an example of what my ppstest results look like.
# ./ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 0.000000000, sequence: 0 - clear  1248162516.998840147, 
sequence: 21
source 0 - assert 0.000000000, sequence: 0 - clear  1248162517.998967408, 
sequence: 22
source 0 - assert 0.000000000, sequence: 0 - clear  1248162518.999094677, 
sequence: 23
source 0 - assert 0.000000000, sequence: 0 - clear  1248162519.999222066, 
sequence: 24
source 0 - assert 0.000000000, sequence: 0 - clear  1248162520.999348869, 
sequence: 25
source 0 - assert 0.000000000, sequence: 0 - clear  1248162521.999477948, 
sequence: 26
source 0 - assert 0.000000000, sequence: 0 - clear  1248162522.999603776, 
sequence: 27
source 0 - assert 0.000000000, sequence: 0 - clear  1248162523.999732151, 
sequence: 28

3. No comments on ldattach, though a quick pointer as to how to use 
minicom correctly would be helpful. Thanks!

4. 5. and 6.:

I feel like this is the bulk of detail/concern here. As mentioned above, 
when I follow the wiki instructions to "update the header files" using the 
symbolic links, I get the follow warnings (which result in errors) when 
trying to compile ntp 4.2.4p5 AND 4.2.4p7:

configure: WARNING: sys/capability.h: present but cannot be compiled
configure: WARNING: sys/capability.h:     check for missing prerequisite 
headers?
configure: WARNING: sys/capability.h: see the Autoconf documentation
configure: WARNING: sys/capability.h:     section "Present But Cannot Be 
Compiled"
configure: WARNING: sys/capability.h: proceeding with the preprocessor's 
result
configure: WARNING: sys/capability.h: in the future, the compiler will 
take precedence
configure: WARNING:     ## ------------------------------ ##
configure: WARNING:     ## Report this to the ntp lists.  ##
configure: WARNING:     ## ------------------------------ ##
configure: WARNING: *** But clock_settime() would be better (if we had it) 
***
configure: WARNING: linux/serial.h: present but cannot be compiled
configure: WARNING: linux/serial.h:     check for missing prerequisite 
headers?
configure: WARNING: linux/serial.h: see the Autoconf documentation
configure: WARNING: linux/serial.h:     section "Present But Cannot Be 
Compiled"
configure: WARNING: linux/serial.h: proceeding with the preprocessor's 
result
configure: WARNING: linux/serial.h: in the future, the compiler will take 
precedence
configure: WARNING:     ## ------------------------------ ##
configure: WARNING:     ## Report this to the ntp lists.  ##
configure: WARNING:     ## ------------------------------ ##
configure: WARNING: Can't read kmem

Example of compile error:
In file included from /usr/include/sys/capability.h:34,
                  from ntpd.c:115:
/usr/include/linux/capability.h:74: error: syntax error before "__le32"
/usr/include/linux/capability.h:76: error: syntax error before "__le32"
/usr/include/linux/capability.h:79: error: syntax error before '}' token


However, if I skip updating the header files (but copy over timepps.h as 
suggested) the configuration/compilation goes smoothly (needed the header 
files to compile ppstest tools though). When configured with "configure 
--enable-parse-clocks --enable-ATOM" I cannot get ntp 4.2.4p7 to display 
"NANO" status, but 4.2.4p5 seems to work. Unfortunately, the "when" status 
of ntpq always stays at "-" for my PPS source. Below is all information I 
thought may be pertinent (sorry for the possible overload):

******
ntp.conf file:

server ntp01.internal-server.com prefer
fudge   127.127.1.0 stratum 10

server 1.jp.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.pool.ntp.org

server 127.127.22.0 minpoll 4 maxpoll 4
fudge 127.127.22.0 flag3 1 flag2 0 time1 0.000 stratum 0


driftfile /var/lib/ntp/drift

keys /etc/ntp/keys

logfile /var/log/ntpd.log

statsdir /var/lib/ntp/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

*******

Example of ntpq:
[root at nu1vme02 ntp-4.2.4p5]# ntpq/ntpq -c rv -p
assID=0 status=0644 leap_none, sync_ntp, 4 events, event_peer/strat_chg,
version="ntpd 4.2.4p5 at 1.1541-o Tue Jul 21 06:07:43 UTC 2009 (1)",
processor="i686",
system="Linux/2.6.28-rc6", leap=00,
stratum=3, precision=-20, rootdelay=18.587, rootdispersion=26.380,
peer=47487, refid=192.153.107.22,
reftime=ce0fdfdd.e9b9a58d  Tue, Jul 21 2009 15:34:05.912, poll=7,
clock=ce0fe085.d9486659  Tue, Jul 21 2009 15:36:53.848, state=4,
offset=-0.229, frequency=4.910, jitter=0.711, noise=0.584,
stability=0.020, tai=0
      remote           refid      st t when poll reach   delay   offset 
jitter
==============================================================================
*ntp01.internal-server.com 192.157.107.25   2 u   41  128  377   10.988 
-0.229   0.571
+7c29477b.i-revo 61.114.187.55    2 u   44  128  377   38.643    5.483 
1.856
-81.91.129.95    192.43.244.18    2 u   42  128  377  378.375  -46.625 
12.834
+114.80.81.69    216.218.192.202  2 u   42  128  377  354.678   23.169 
2.420
  PPS(0)          .PPS.            0 l    -   16    0    0.000    0.000 
0.001

*********
Listed Associations (not PPS rejection):
[root at nu1vme02 ntp-4.2.4p5]# ntpq/ntpq
ntpq> associations

ind assID status  conf reach auth condition  last_event cnt
===========================================================
   1 47487  9614   yes   yes  none  sys.peer   reachable  1
   2 47488  9414   yes   yes  none  candidat   reachable  1
   3 47489  9314   yes   yes  none   outlyer   reachable  1
   4 47490  9414   yes   yes  none  candidat   reachable  1
   5 47491  8015   yes   yes  none    reject  clock expt  1

*****
ntpdc information:

# ntpdc/ntpdc
ntpdc> kern
pll offset:           -0.000198989 s
pll frequency:        4.910 ppm
maximum error:        0.178699 s
estimated error:      0.000583 s
status:               2001  pll nano
pll time constant:    7
precision:            1e-09 s
frequency tolerance:  500 ppm

ntpdc> sysinfo
system peer:          ntp01.internal-server.com
system peer mode:     client
leap indicator:       00
stratum:              3
precision:            -20
root distance:        0.01859 s
root dispersion:      0.02859 s
reference ID:         [192.153.107.22]
reference time:       ce0fdfdd.e9b9a58d  Tue, Jul 21 2009 15:34:05.912
system flags:         auth monitor ntp kernel stats
jitter:               0.000702 s
stability:            0.000 ppm
broadcastdelay:       0.003998 s
authdelay:            0.000000 s

******
ntptime information:

]# util/ntptime
ntp_gettime() returns code 0 (OK)
   time ce0fe136.dc3f3db0  Tue, Jul 21 2009 15:39:50.860, (.860340692),
   maximum error 206199 us, estimated error 583 us, TAI offset 0
ntp_adjtime() returns code 0 (OK)
   modes 0x0 (),
   offset -193.715 us, frequency 4.910 ppm, interval 1 s,
   maximum error 206199 us, estimated error 583 us,
   status 0x2001 (PLL,NANO),
   time constant 7, precision 0.001 us, tolerance 500 ppm,

*******
var/messages at startup (seems OK):
Jul 21 16:48:16 nu1vme02 kernel: new PPS source serial0 at ID 0
Jul 21 16:48:16 nu1vme02 kernel: PPS source #0 "/dev/ttyS0" added
Jul 21 17:03:57 nu1vme02 ntpd[7307]: ntpd 4.2.4p5 at 1.1541-o Tue Jul 21 
08:02:16 UTC 2009 (2)
Jul 21 17:03:57 nu1vme02 ntpd[7308]: precision = 1.000 usec
Jul 21 17:03:57 nu1vme02 ntpd[7308]: Listening on interface #0 wildcard, 
0.0.0.0#123 Disabled
Jul 21 17:03:57 nu1vme02 ntpd[7308]: Listening on interface #1 wildcard, 
::#123 Disabled
Jul 21 17:03:57 nu1vme02 ntpd[7308]: Listening on interface #2 lo, ::1#123 
Enabled
Jul 21 17:03:57 nu1vme02 ntpd[7308]: Listening on interface #3 eth0, 
fe80::2e0:ff:fe13:282a#123 Enabled
Jul 21 17:03:57 nu1vme02 ntpd[7308]: Listening on interface #4 lo, 
127.0.0.1#123 Enabled
Jul 21 17:03:57 nu1vme02 ntpd[7308]: Listening on interface #5 eth0, 
10.128.1.192#123 Enabled
Jul 21 17:03:57 nu1vme02 ntpd[7308]: kernel time sync status 2040
Jul 21 17:03:59 nu1vme02 ntpd[7308]: frequency initialized 4.958 PPM from 
/var/lib/ntp/drift

**********
Somewhat weird ntp.log message:

21 Jul 17:07:12 ntpd[7308]: kernel time sync status change 6001
21 Jul 17:11:30 ntpd[7308]: kernel time sync status change 2001
21 Jul 23:08:19 ntpd[7308]: kernel time sync status change 6001
21 Jul 23:25:24 ntpd[7308]: kernel time sync status change 2001
22 Jul 00:50:44 ntpd[7308]: kernel time sync status change 6001
22 Jul 01:07:48 ntpd[7308]: kernel time sync status change 2001
22 Jul 01:59:05 ntpd[7308]: kernel time sync status change 6001
22 Jul 04:32:46 ntpd[7308]: kernel time sync status change 2001
22 Jul 05:58:11 ntpd[7308]: kernel time sync status change 6001
22 Jul 06:49:25 ntpd[7308]: kernel time sync status change 2001
22 Jul 07:23:36 ntpd[7308]: kernel time sync status change 6001

********

OK, that's all for now. My apologies for making this so lengthy!

Cheers,

-Kevin



More information about the LinuxPPS mailing list