[LinuxPPS] pps stops when ntpd starts?

William S. Brasher billb958 at door.net
Wed Jun 10 16:14:21 CEST 2009


On Wed, 10 Jun 2009, Rodolfo Giometti wrote:

> 
> Ok, they are calling the same functions... so the only differences
> should be into ioctl() FLAGS parameters. Can you check them into
> ldattach sourc code? You may also disable the ioctl() calls and then
> retry setting ldisc.
> 
> Ciao,
> 
> Rodolfo
> 


OK:  ldattach does not set the flags like ntpd would them set, it seems.  
I have no idea what this does to other users of ldattach, but it does let 
ntpd sync to pps on my box.

The following patch to ldattach will "fix" the problem and with ppstest 
hanging and ntpd never seeing the pps signal after ntpd is started:


--- ldattach.c.org      2009-06-10 06:46:50.000000000 -0500
+++ ldattach.c  2009-06-10 08:57:12.000000000 -0500
@@ -237,6 +237,9 @@
        ts.c_cflag |= (PARENB|PARODD);
        break;
     }
+
+    ts.c_iflag |= (IGNBRK|ICRNL);
+
     ts.c_cflag |= CREAD;       /* just to be on the safe side */
     if (tcsetattr(tty_fd, TCSAFLUSH, &ts) < 0)
        err(EXIT_FAILURE, _("cannot set terminal attributes for %s"), 
dev);




It took just a few minutes to sync:

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+GPS_NMEA(0)     .GPS.            0 l   11   16  377    0.000    0.001   0.002
oPPS(0)          .PPS.            0 l   12   16  377    0.000    0.001   0.002



More information about the LinuxPPS mailing list