LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-16-2009, 03:10 AM   #1
wintercarver
LQ Newbie
 
Registered: Mar 2005
Location: san francisco/portland
Posts: 12

Rep: Reputation: 0
NTPd sees my 1PPS signal, but doesn't do much with it... Help?


Dear All,

I am in the process of configuring a local GPS 1PPS signal to work with NTP. This IS a software question, but a summary of my hardware endeavors is: I have setup the hardware successfully, as far as I know, mostly following the LinuxPPS wiki[1]. The LinuxPPS software comes with a "ppstest" utility that I have used to verify my computer's recognition of the 1PPS signal coming in via a serial port. So now it's on to the software configuration. The details of getting all that to work can be found in another post of mine [2].

As the 1PPS signal alone cannot tell the absolute time, it must be used in conjunction with another NTP reference clock/server. This is not a problem. The computer I am working with is already configured and running with an NTP server. So, effectively, all I want to do is add my local 1PPS signal into the mix. The LinuxPPS NTPd support page for setting up such a system was a helpful starting point, but a bit minimal. I found this post, which doesn't do exactly what I'm trying but close enough, quite informative too.

My problem is the 1PPS signal, though it shows up in ntpq, has the maximum jitter and is, effectively, not being processed (info below). So, in hopes that someone can point out the obvious to me, I'll post all the info I can think of being useful.

Some points to note: I'm using ntpd 4.2.0a. As far as I know this was installed/configured before I setup the LinuxPPS kernel and what not, so I'm afraid some configuration options for PPS support may be missing. However, I downloaded the latest code for NTP and compiled it with the suggestion options (in ref above). When I run that version of ntpd the PPS source doesn't even show up...
Also, as the NTP documentation here suggests, in going over the status mesage of ntptime "status 0x1 (PLL)", I should see some acknowledgment of PPS, which I clearly don't. As obvious as it is that I've got -some- things wrong, I still don't know exactly where to go...

Anyway, we'll start from here:


ls -l /dev/pps*
Code:
# ls -l /dev/pps*
crw-------  1 root root 253, 0 Jul 15 11:28 /dev/pps
crw-------  1 root root 253, 0 Jul 15 16:04 /dev/pps0
/etc/ntp.conf
Code:
server 127.127.22.0 minpoll 4 maxpoll 4
fudge 127.127.22.0 flag3 1 flag2 0

server ntp01.so-and-so.com prefer

driftfile /var/lib/ntp/drift

keys /etc/ntp/keys

logconfig = +syncall +clockall +sysall +peerall
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
ntpq -c rv -p (PPS source apparently detected, but dead...?)
Code:
# ntpq -c rv -p
assID=0 status=0644 leap_none, sync_ntp, 4 events, event_peer/strat_chg,
version="ntpd 4.2.0a@1.1190-r Thu May 21 20:40:24 CDT 2009 (1)"?,
processor="i686",
system="Linux/2.6.28-rc6-20450-gace6faa-dirty", leap=00,
stratum=3, precision=-20, rootdelay=18.916, rootdispersion=29.375,
peer=19805, refid=192.153.107.22,
reftime=ce095bf3.cfd9dba9  Thu, Jul 16 2009 16:57:39.811, poll=6,
clock=0xce095c04.5631c64b, state=4, offset=-1.400, frequency=5.170,
noise=0.700, jitter=0.523, stability=1.210
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 PPS(0)          .PPS.           16 l    -   16    0    0.000    0.000 4000.00
*ntp01.so-and-so.com XXX.XX.XX.XXX   2 u   17   64  377   11.271   -1.400   0.523
ntptime
Code:
# ntptime
ntp_gettime() returns code 0 (OK)
  time ce095c76.26073000  Thu, Jul 16 2009 16:59:50.148, (.148547),
  maximum error 42497 us, estimated error 606 us
ntp_adjtime() returns code 0 (OK)
  modes 0x0 (),
  offset -1354.000 us, frequency 5.160 ppm, interval 1 s,
  maximum error 42497 us, estimated error 606 us,
  status 0x1 (PLL),
  time constant 6, precision 1.000 us, tolerance 500 ppm,
ntpdc>sysinfo
Code:
ntpdc> sysinfo
system peer:          ntp01.so-and-so.com
system peer mode:     client
leap indicator:       00
stratum:              3
precision:            -20
root distance:        0.01868 s
root dispersion:      0.03159 s
reference ID:         [XXX.XXX.XXX.XXX]
reference time:       ce095c72.cf8c5436  Thu, Jul 16 2009 16:59:46.810
system flags:         auth monitor ntp kernel stats
jitter:               0.000549 s
stability:            1.099 ppm
broadcastdelay:       0.003998 s
authdelay:            0.000000 s
Cheers and many thanks in advance to any comments!

-Kevin
 
Old 07-30-2009, 09:19 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Any new status to report?
 
Old 07-30-2009, 09:40 PM   #3
wintercarver
LQ Newbie
 
Registered: Mar 2005
Location: san francisco/portland
Posts: 12

Original Poster
Rep: Reputation: 0
Yep. I've done a lot lately. But, if I had gotten everything working I would have definitely posted my solution(s) here. Unfortunately, things are still a bit finicky, though I'm much closer to making it work (I think).

I don't want to re-post everything, but I started a thread on the official LinuxPPS mailing list, archived here: http://ml.enneenne.com/pipermail/lin...ly/003180.html

There's a lot of good information in that thread, so I highly recommend it. The redux is this: Everything seems setup/patched and good to go, but my PPS signal is not being polled. The most likely candidate is that my PPS signal is 20us in width, whereas standard signals are on the order of 10ms in width. There is evidence that assert signals are being missed every now and then (variable, but every couple minutes to once and hour), for which an undetected signal (i.e. too narrow a width) is a likely candidate. On Monday (Japan time, Sunday in the US) I'm meeting with my boss to setup electronics to widen the signal, so we'll see.

I've tried a variety of kernels, a variety of NTP versions, ldattach versions, etc. If you have any questions let me know.

As always, suggestions always welcome!

Cheers,

-Kevin
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
user-define signal handler & coredump for signal 11(SIGSEGV) Alexlun Linux - Software 2 05-24-2009 06:37 AM
How to reinstall a signal handler after exec ( Strange behaviour in signal handling ) lali.p Programming 0 09-20-2008 12:11 PM
ndiswrapper: Sees wlan card, gets signal, doesn't go online Baryn Linux - Laptop and Netbook 8 03-03-2006 05:12 AM
Linux sees 2003 Domain, windows sees Linux ..but.... Stealthy_C Linux - Networking 4 06-14-2005 03:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration