[LinuxPPS] Status Update

Rodolfo Giometti giometti at enneenne.com
Fri May 4 10:58:19 CEST 2007


On Thu, May 03, 2007 at 12:16:40PM -0600, clemens at dwf.com wrote:
> 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

LinuxPPS version 3.1.0 I suppose.

> 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 

Done.

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

ppsctl was added just to speed up this step.

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

No proc support for 2.6. It's deprecated!

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

Into 'name' there is the driver's name while into 'path' there is the
device's path name.

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

That's is not possible since into pps.h there are several kernel
structures and defines needed for LinuxPPS to work __only__ in
kernelland. Meanwhile into timepps.h there are the structures and
defines useful just for the userland. Of cource such structures and
defines need what defined into pps.h to work and communicate with the
kernel.

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

You have definitely right but I had still no time to write man pages
nor inline comments about these topic, sorry. However you can still refere to the wiki
here:

   http://wiki.enneenne.com/index.php/LinuxPPS_support#Modifing_a_reference_clock_to_work_with_LinuxPPS

where you can find useful examples on these functions. Alse you can
take a look at the atom patch:

   http://ftp.enneenne.com/pub/misc/linuxpps/refclocks/atom/atom.patch

who implements a smart trick to select the desired device.

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

Great! Thanks.

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

This is reported into the wiki but I'll add this info there also.

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

I agree.

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

This is _not_ possible. All programs _are compiled_ with kernel
include files. Each toolchain has inside the Linux include directories
'include/linux', 'include/asm' and for linux 2.6
'include/asm-generic'.

If this is not the case, please, see here:

   http://wiki.enneenne.com/index.php/LinuxPPS_support#The_userland_tools

>     3) We need documentation of time_pps_findsource and time_pps_findpath
>         somewhere in some format.

In the near future...

>     4)  Ill fix ntpd when I see the above documentation and understand what
>         I am doing :-)

Please, take a look at the wiki. I'm sure you can find whatever you
need to understand what you are doing, and provide your patch!
LinuxPPS users need your contribute too! :P

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

Thanks a lot.

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at gnudd.com
Embedded Systems                     		giometti at linux.it
UNIX programming                     phone:     +39 349 2432127



More information about the LinuxPPS mailing list