[LinuxPPS] Status Update

clemens at dwf.com clemens at dwf.com
Thu May 3 20:16:40 CEST 2007


OK, here is an update of my testing of linuxpps.
I started with linux 2.6.21.1 and ntp-pps-2.6.21.diff
I used the change deck from a recent Fedora release,
namely 2.6.20-1.2948.fc6-i586, and then turned on linuxpps
with xconfig.

No problems with that part.
I had to start ntpd with my own /etc/rc.d/init.d/ntpd startup
file,- Ill look at that problem later.

I used a version of ntp that I had previously compiled, but
compiled anew ppsctl and ppstest which I no longer had copies
of.

First question:  there is a change deck for 'setserial' but no source
for it.  Is there an assumption that I am to use the sources from
my linux distribution?  If so, this should probably be stated more
clearly.  In any case, I ended up NOT using setserial since 
     1) I had no way to build it.
     2) It wasnt clear what options I should set.  seems that 
          ppsctl does what is needed.

I was able to turn on /dev/ttyS0 with ppsctl.

OK, I see /dev/lp0 and /dev/ttyS0 down in /sys/class/pps, but I thought
there also was supposed to be an entry in /proc.  I dont see anything there.

There is an entry in /sys/class/pps/01/name of 'serial0' what is this?
the actual name of the device is in 'path'.

I do NOT like having timepps.h in the USER includes refering to pps.h
which is over in the SYSTEM includes.  This USER compile should work
whether there are system includes on the system or not.  So from my
point of view, a copy of pps.h needs to come over to the USER side too.

My copy of ntpd reached out and grabbed /dev/lp0 even tho it was told to
use /dev/ttyS0.  So, my code in ntpd/refclock_oncore.c is wrong.  I had to
/sbin/rmmod the lp related modules to get ntpd to actually use ttyS0.

I need to fix that code, BUT I still cant find any documentation for 
time_pps_findsource and time_pps_findpath and would like to see that
(either as a man page or just inline comments) before I modify the
ntp code.

OK, finally, how did it work.
My recollection here is clouded since Ulrich Windl's original PPS patch
(for the 2.4 kernel) also included changing the Linux timekeeping to use
a nanosecond clock.  For the 2.6 kernel, he left out the nanosecond clock.

With that patch, the xntpd reported dispersion of the time 'hacks' was
very small.  Currently, ntpd is reporting a disperison of 0.015 which 
seems large, but must be ok, since looking at the individual time hacks
as they stream by in a window (tail -f of clockstats) I see the time hacks
changing in the 1us column.  Thats as good as you can do with a us clock.
(Damn I liked that ns clock).

Here are a few lines from that log file (the time hack is the 4th item)

54223 65618.283 127.127.30.0 3387204817.999993734 2007 123 18 13 38 37 rstat 
8406 dop  0.0 nsat  9,9 traim 1,0,0 sigma 36 neg-sawtooth   8 sat 888888088008
54223 65619.283 127.127.30.0 3387204818.999994433 2007 123 18 13 39 38 rstat 
8406 dop  0.0 nsat  9,9 traim 1,0,0 sigma 36 neg-sawtooth  -6 sat 888888088008
54223 65620.283 127.127.30.0 3387204819.999995157 2007 123 18 13 40 39 rstat 
8406 dop  0.0 nsat  9,9 traim 1,0,0 sigma 36 neg-sawtooth   9 sat 888888088008
54223 65621.283 127.127.30.0 3387204820.999994793 2007 123 18 13 41 40 rstat 
8406 dop  0.0 nsat  9,9 traim 1,0,0 sigma 36 neg-sawtooth  -3 sat 888888088008
54223 65622.284 127.127.30.0 3387204821.999995848 2007 123 18 13 42 41 rstat 
8406 dop  0.0 nsat  9,9 traim 1,0,0 sigma 36 neg-sawtooth  11 sat 888888088008

So, it seems that linuxpps is working fine from the serial port.
Ill change my cable and try the parallel port, but expect the same result.

I would like to resolve the two or three things mentioned above tho:
    1) A comment should be made in the documentation (pps.txt) that 
        pps MUST be turned on for a serial line with ppsctl or setserial
        otherwise folks are going to try it, and say 'why isnt it working'.
    1a) probably, where to get these routines, and timepps.h and ppstest.c
        should also be listed in pps.txt, since it will be a while before they
       get into all Linux distributions.
    2) I think that BOTH timepps.h *and* pps.h should exist in the USER
        include files, so a user can compile user programs without having
        SYSTEM files available.  
    3) We need documentation of time_pps_findsource and time_pps_findpath
        somewhere in some format.
    4)  Ill fix ntpd when I see the above documentation and understand what
        I am doing :-)

Another short note after I change the cable and try the parallel port.

-- 
                                        Reg.Clemens
                                        reg at dwf.com





More information about the LinuxPPS mailing list