[LinuxPPS] New LinuxPPS user intro

Luca Bertagnolio lucaberta at yahoo.com
Thu Sep 18 00:32:30 CEST 2008


Hello all,

another italian experimenting with LinuxPPS on this list!

Rodolfo and I crossed a few emails over the weekend, and finally here I am with an intro and a request for help.

I've been using Linux since circa 1990 or so (first kernel was 0.99.17 if I recall...) and precise timing has always been one of my hobbies, being a ham radio interested in digital protocols.  Tom Clark of AMSAT inspired me many years ago, when he worked with Trimble first (on the SV6) and Motorola later (on the original OnCore) to fix the timing issues in the firmware.  And so the original TAC (Totally Accurate Clock) by Tom A. Clark was born.  It was used to sync VLBI radiotelescopes around the world, an ham radio project at the base of the timing on a multi-million dollars project... ;-)

Some notes on Tom's TAC:
http://www.setileague.org/hardware/clock.htm

The original TAPR kit, which I still have in a drawer somewhere... :-)
http://www.tapr.org/kits_tac2.html

Years go by, a few more experiments with PPSkit in 2.2 or 2.4 kernel times, then not much until last month, when I bumped into my friend David Taylor's website that describes his experiences with a Garmin GPS 18 LVC.  Lukring here and there I discovered Rodolfo's work on LinuxPPS, so I dug out of the drawer a GPS 18 LVC unit I had bought  a couple of years back, reinstalled Gentoo on my headless converted Cisco PIX 506 mini-server (sporting a Pentium MMX 200 CPU with a whopping 128M of RAM, compiled a fresh 2.6.26-gentoo kernel with Rodolfo's patches, and I was back in the game!  :-)

Here is where I am, and the problem I am facing:

1- LinuxPPS patches to 2.6.26-gentoo-r1 with PPSAPI 5.3.1 pulled from the web working OK, ppstest confirms the 200ms long pulse on the DCD

2- GPS 18 LVC with latest firmware, only sentence selected is GPRMC, minicom displays the NMEA data coming in on /dev/ttyS1

3- using Gentoo, so I modified the current portage ebuild of nptd 4.2.4p4 to include the patch to driver 20, and rebuilt ntpd OK

4- using /dev/ttyS1 for the NMEA data and /dev/pps0 for PPS, so I lined /dev/gps1 and /dev/gpspps1 to those devices.  I did not bother to fiddle with udev at this stage, so I hacked the /etc/init.d/ntpd startup script adding the following:

        if [ ! -L /dev/gpspps1 ] ; then
                /usr/local/sbin/ppsldisc /dev/ttyS1 &
                ln -s /dev/ttyS1 /dev/gps1
                ln -s /dev/pps0 /dev/gpspps1
        fi
5- my /etc/ntp.conf file has the following line to define my refclock:

server  127.127.20.1 prefer minpoll 4
fudge   127.127.20.1 flag3 1 flag2 0 time1 0.000 stratum 0 refid PPS

When I fire up ntpd, everything seems to be working fine *except* that I see my GPS consistently about 170ms behind UTC... :-(

Logs that verify ntpd listening to GPS and PPS:

Sep 18 00:24:51 tix ntpd[6380]: refclock_nmea: found GPS source "/dev/gps1"
Sep 18 00:24:51 tix ntpd[6380]: refclock_nmea: try "/dev/gpspps1" for PPS
Sep 18 00:24:51 tix ntpd[6380]: refclock_nmea: found PPS source "/dev/gpspps1"

More details with the refclock showing the offset on the last line:

tix ~ # ntpq -c rv -p
assID=0 status=06f4 leap_none, sync_ntp, 15 events, event_peer/strat_chg,
version="ntpd 4.2.4p4 at 1.1520-o Sun Sep 14 15:03:57 UTC 2008 (1)",
processor="i586", system="Linux/2.6.26-gentoo-r1", leap=00, stratum=2,
precision=-17, rootdelay=7.287, rootdispersion=36.130, peer=8612,
refid=193.204.114.105,
reftime=cc7bf9ea.c085c7f4  Wed, Sep 17 2008 23:49:30.752, poll=10,
clock=cc7bfe0f.2fe07b65  Thu, Sep 18 2008  0:07:11.187, state=4,
offset=-1.773, frequency=-290.080, jitter=4.598, noise=1.390,
stability=0.134, tai=0
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*ntp.inrim.it    .UTCI.           1 u   38 1024  377    7.287   -1.100   0.410
-endor.ordrejedi 91.121.83.98     3 u  817 1024  377   31.596  -48.911   2.367
+zbasel.fortytwo 129.132.2.21     3 u   21 1024  377   31.391  -10.337   0.412
 chronos.duth.gr .PPS.            1 u   7h 1024    0   88.622   -6.660   0.000
+www.lecad.uni-l 193.2.1.92       2 u   34 1024  377   40.510    4.636   0.325
 GPS_NMEA(1)     .PPS.            0 l 1014   16    0    0.000  -171.29   1.010

Bear with me on this example in which the GPS is "unreachable", but I don't have a full view of the sky, but even with a full constellation things don't change.

I of course browsed the mailing list archives and found a very similar scenario in early August 2008:
http://ml.enneenne.com/pipermail/linuxpps/2008-August/002179.html

It doesn't look like there has been any updates from Nicholas Ritter as to whether he has been successful in tracking what caused his offset which is similar to mine.

Can anyone here give me some advice on how to track what causes this snafu on my system?  Things seem to reasonably in place to my eyes, and that's why I'd need someone else's point of view!

Many thanks for reading this looong message, promise I'll be shorter next time!  ;-)

Ciao, Luca IK2OVV / K2OVV
Milan, Italy



More information about the LinuxPPS mailing list