[LinuxPPS] New LinuxPPS user intro

Hal V. Engel hvengel at astound.net
Thu Sep 18 02:58:18 CEST 2008


On Wednesday 17 September 2008 03:32:30 pm Luca Bertagnolio wrote:
> Hello all,
snip
>
> 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.  

I suspect that many here are hams. 

snip
> 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

flag2 will allow you to change which edge of the pulse is used to trigger the 
interupt.  If you are seeing an offset that is about the same as the PPS pulse 
width (which you are) try using the other edge (IE. flag2 1 will use the clear 
event rather than the assert event).

snip
>
> 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.

I expect that he changed flag2 to fix the problem but I don't know that for 
sure since he could have also inverted the signal before it reached the serial 
port.

>
> 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!

There are likely other things you need to do to get things totally correct.  
But first you need to fix the 170 ms offset problem since the other stuff only 
really matters once you have the pss signal being correctly used.  

Among those things are installing a patched version of glibc.  See 
http://bugs.gentoo.org/show_bug.cgi?id=237974 (you might want to vote for this 
so that it gets fixed sooner).  Then rebuilding ntp against the patched 
version.

73,

Hal (AC6VZ)



More information about the LinuxPPS mailing list