[LinuxPPS] kernel does not see PPS on serial port

Rodolfo Giometti giometti at enneenne.com
Fri Mar 7 14:46:28 CET 2008


On Fri, Mar 07, 2008 at 01:56:34PM +0100, LICHTENBERGER Janos wrote:
> >
> > *This* could be the problem! Please, check if the driver supports the
> alternate PPS source.
> >
> 
> I'm a bit slow, now understand what do you mean with nmea patch, the new
> refclock has to use /dev/ppsN instead of /dev/gpsN.
> In the case of old kernel, /dev/gps0 was just a symbolic link to
> /dev/ttyS0 - but it does not work with pps0-gps0 pair ;-), it would have
> been an easy solution..

The solution is much easier than aspect. The current LinuxPPS
implementation implements each PPS source as a independent device so
your NTPD driver must use both /dev/ttySN (or the sym link /dev/gpsN)
*and* /dev/ppsN.

The driver should first check the main PPS device and, if something
goes wrong, should try the alternate one. See the nmea patch:

       msyslog(LOG_ERR, "refclock_nmea: found GPS source \"%s\"", device);
       if (time_pps_create(pp->io.fd, &up->handle) < 0) {
               /* Try the alternate PPS device */
                (void) sprintf(device, DEVICEPPS, unit);
               msyslog(LOG_ERR, "refclock_nmea: try alternate PPS device \"%s\"", device);
                fd = open(device, O_RDWR);
                if (fd < 0)
                       goto pps_error;
               if (time_pps_create(fd, &up->handle) < 0)
                               goto pps_error;

in pp->io.fd you find the fd of the main PPS device, if
time_pps_create() fails the code try opening DEVICEPPS (the alternate
PPS device) and the doing time_pps_create() on it.

That's all! :)

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