[LinuxPPS] PPS/ntpd fails on fresh startup

William S. Brasher billb958 at door.net
Tue Oct 14 21:00:38 CEST 2008


On Tue, 14 Oct 2008, Rodolfo Giometti wrote:

> On Tue, Oct 14, 2008 at 10:09:40AM -0500, William S. Brasher wrote:
> > On Tue, 14 Oct 2008, Rodolfo Giometti wrote:
> > 
> > > On Mon, Oct 13, 2008 at 03:47:23PM +0200, Luca Bertagnolio wrote:
> > > > Rodolfo, when you have a minute can you comment on my issue?
> > > 
> > > Hi. If you wish I replay sooner, please put my e-mail address in
> > > Cc. :)
> > > 
> > > > Why would LinuxPPS fail at the first startup, and work the second time?
> > > 
> > 
> > 
> > I have the same problem starting ntp:  it fails to start the first time 
> > after booting the system.  The reason, for me, has been ppsldisc:
> > 
> > tara: # ppstest /dev/pps0 
> > trying PPS source "/dev/pps0"
> > found PPS source "/dev/pps0"
> > ok, found 1 source(s), now start fetching data...
> > time_pps_fetch() error -1 (Connection timed out)
> > time_pps_fetch() error -1 (Connection timed out)
> > ^C
> 
> This mean that LinuxPPS as registered a new source but you are getting
> no IRQs from serial line. Can you please check your /proc/interrupts?

/proc/interrupts shows interrupts are coming in.

cat < /dev/ttyS0 returns the NMEA sentence at once per second.



> 
> > Since it starts on the second try, I've been logging in and manually 
> > running the startup script after the machine boots.  I suspect the problem 
> > is somewhere in the swamp called udev and the time required for a kernel 
> > process to start, but so far I haven't found a fix.
> 
> Remember that LinuxPPS doesn't configure the serial port. It just
> define a PPS source and waits for IRQs from the DCD line.



Hmmmm.  I let ntpd configure the serial port after starting ppsldisc, 
which seems to squash the pps input.

Since I can receive the NMEA sentence from the port, and can in fact send 
serial data to the clock through the port, I assumed the port to be 
minimally configured.  Which says nothing about what ntpd may do to that 
port when it starts...


SO:  If I start ntpd in the startup script before I start ppsldisc,
everything works.   That is, I inserted the ntpd -gqx into the following 
script: 

case "$1" in
        start)
                boot_mesg "Starting ntpd..."
                /bin/setserial -v /dev/ttyS0 low_latency
                sleep 2
                ntpd -gqx 
                sleep 2
                /usr/bin/ppsldisc /dev/ttyS0 &
                sleep 2
                loadproc /usr/sbin/ntpd -g
                sleep 2
                killall ppsldisc
                ;;





> 
> Ciao,
> 
> Rodolfo
> 
> -- 
> 
> GNU/Linux Solutions                  e-mail: giometti at enneenne.com
> Linux Device Driver                          giometti at linux.it
> Embedded Systems                     phone:  +39 349 2432127
> UNIX programming                     skype:  rodolfo.giometti
> 
> 



More information about the LinuxPPS mailing list