[LinuxPPS] LinuxPPS for kernel 2.6.26
Hal V. Engel
hvengel at astound.net
Fri Jul 18 04:49:12 CEST 2008
On Tuesday 15 July 2008 01:11:41 pm Rodolfo Giometti wrote:
snip
> > So the simplest solution is to run 'ppsldisc' from the ntp startup
> > script (pretend it's another daemon) and also stop it from the ntp
> > script. The challenge here: how does 'ppsldisc' know which ports to
> > open? It's annoying to always edit the ntpd script. Well, we can
> > propose these sorts of changes to the ntpd script:
> >
> > - check for a file /etc/pps/has_serial_ldisc
> > - if the file exists, run 'ppsldisc'
> > - ppsldisc should read the file /etc/pps/ppsldisc.conf (or alternative
> > specified on command line) which contains a list of serial ports to
> > open; ppsldisc can even create the 'gps*' symlink, for example:
> >
> > #ppsldisc.conf
> > ttyS3
> > ttyS0
>
> Let me suggest something like:
>
> #ppsldisc.conf
> /dev/gps0 = /dev/ttyS3
> /dev/gps1 = /dev/ttyS0
I think it is a liitle more involved than this. Some of the reference clock
drivers are expecting to find specific device names. The OnCore driver
expects to find devices with names like:
/dev/oncore.serial or /dev/oncore.serial.x
/dev/oncore.pps or /dev/oncore.pps.x
Where x is 0, 1, 2, 3... And these do not need to be symlinked to the same
physical port even though that is how this is almost always handled.
At least that is my understanding. If I am not mistaken then we need to have
enough configuration information available to handle this. I suppose that it
could be something like:
#ppsldisc.conf
/dev/oncore.serial.0 = /dev/ttyS3
/dev/oncore.pps.0 = /dev/ttyS3
/dev/gps1 = /dev/ttyS0
/dev/pps1 = /dev/ttyS0
But even the above might be too simplistic. This would actually allow for a
reference clock to use a serial port for communications and a different
physical device such as a GIO pin, parallel port or a different serial port
for the PPS signal. In fact it seems to me that this should be generalized so
that USB devices with an available PPS signal line would also work (does the
NMEA). If we are going to create a specification for this then we should
generalize it so that it covers all of the known posibiliities even if not all
of them are currently supported.
For example it might also be possible to have something like:
#ppsldisc.conf
/dev/oncore.serial.0 = /dev/ttyS3
/dev/oncore.pps.0 = /dev/par0
Assuming that there is a PPS driver available for the parallel port.
Or for a USB GPS:
#ppsldisc.conf
/dev/gps0 = usb # the driver needs to handle finding the port for usb devices
/dev/pps0 = /dev/ttyS0
In other words this needs to be able to specify:
1. The reference clock IO device which can be serial or USB and the name for
the symlink that the driver expects for this IO device.
2. The physical device for the PPS signal (serial, parallel or GIO pin) and
the name of the symlink that is used by the driver for finding this device.
Also I think the configuration file should be named something like:
ntp.pps.conf
or
refclock.pps.conf
or
pps.conf
Since it is more general than setting up ppsldisc.
>
> > The response of ppsldisc:
> > 1. open ttyS3, set the pps line discipline, create the symlink
> > gps0->ttyS3 2. open ttyS0, set the pps line discipline, create the
> > symlink gps1->ttyS0
>
> 1. open /dev/ttyS3, set the pps line discipline, create the symlink
> /dev/gps0->/dev/ttyS3 2. open /dev/ttyS0, set the pps line discipline,
> create the symlink /dev/gps1->/dev/ttyS0
>
> > Of course if there are other non-ttyS* GPS devices or other PPS
> > devices, things can get weird - but that's the exception rather than
> > the rule, and in such cases the admin can always arrange for those
> > strange PPS or GPS devices to have their drivers loaded later so that
> > the relation of gpsN to ppsN remains sensible.
>
> I agree. Even if the ppsldisc fails there should be no problems at
> all!
Other than the reference clock not working.
>
> Ciao,
>
> Rodolfo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ml.enneenne.com/pipermail/linuxpps/attachments/20080717/fc213ee1/attachment-0001.htm
More information about the LinuxPPS
mailing list