[LinuxPPS] Fwd: Attaching PPS to kernel

Alvarez, Ralph ralph.alvarez at windriver.com
Tue Apr 5 03:30:56 CEST 2011


Hi Igor,

Thanks again for help. Other then working out the NTP build changes, I think all is working as expected. Here's are my latest results:

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*CLN1-A19        GPS_NMEA(0)      2 u  161  256  377    0.044   -0.004   0.091

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*CLN1-A19        GPS_NMEA(0)      2 u  185  256  377    0.044   -0.433   0.083

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*CLN1-A19        GPS_NMEA(0)      2 u 1037 1024  377    0.043    0.055   0.095

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*CLN1-A19        GPS_NMEA(0)      2 u  453 1024  377    0.039    0.354   0.100

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*CLN1-A19        GPS_NMEA(0)      2 u   56  256  377    0.044   -0.079   0.060

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*CLN1-A19        GPS_NMEA(0)      2 u   11   16  377    0.041    0.031   0.001

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*CLN1-A19        GPS_NMEA(0)      2 u    9  128  377    0.035    0.082   0.007

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
oGPS_NMEA(0)     .NMEA.           1 l   13   16  377    0.000    0.011   0.001


-Ralph

-----Original Message-----
From: Igor Plyatov [mailto:plyatov at gmail.com] 
Sent: Saturday, April 02, 2011 12:09 AM
To: Alvarez, Ralph
Cc: linuxpps at ml.enneenne.com
Subject: RE: [LinuxPPS] Fwd: Attaching PPS to kernel

Hello Ralph!

> Hey Guys,
> 
> Thanks for the assistance. I think I have my setup working now. Here's a summary of what I did:
> 
> I probably should of mentioned that I'm using an older kernel (2.6.27) with the PPS patch applied. I tried NTP DEV version ntp-4.2.7p7xx but quickly reverted back to the most stable version (ntp-4.2.6p3) after Igor's comments that ntp-4.2.7p7xx wasn't stable with PPS. 
> 
> My NTP GPS/PPS setup is for an embedded system that has 8 networked hosts. One of the hosts acts as the NTP server while the others act as clients. Here's what I did to get things going:
> 
> 1. Applied PPS patch (ntp-pps-2.6.27-rc3-bis-diff) to 2.6.27 kernel.

You should install timepps.h BEFORE ntp configuration and compilation!
Otherwise you will need to hack config.h.

> 2. Built latest stable NTP (ntp-4.2.6p3) as follows:
>      a. ./configure --without-ntpsnmpd --disable-all-clocks --disable-parse-clocks --enable-ATOM --enable-NMEA --enable-LOCAL-CLOCK
>      b. Modified config.h.in to include these macros: HAVE_PPSAPI, HAVE_TIMEPPS_Hand CLOCK_ATOM.
>      c. Copied over timepps.h file to ntp/include folder (from pps-tools tarball).
> 3. Verified that kernel PPS was working as expected (see my notes below)
> 4. Setup for NMEA driver:
>      a. "ln -s /dev/ttyS0 /dev/gps0"
>      b. "ln -s /dev/pps0 /dev/gpspps0"
> 5. Setup NTP config file with this line:
>      a. server 127.127.20.0 mode 1 minpoll 4  prefer fudge 127.127.20.0 time1 0.0 flag1 1 flag2 0 flag3 0 stratum 1 refid NMEA
> 6. Restarted all hosts in sync.
> 
> Questions: 
> 1. Should I be worried that I'm not getting the PPSSIGNAL status from the ntptime output below?

This is normal to have only one NMEA reference clock. You will get
around hundred milliseconds jitter if PPS does not operate and some
microseconds with PPS operational.

> 2. is it possible to build NTP with the macros above without having to modify config.h.in ?

AGAIN: You should install timepps.h BEFORE ntp configuration and
compilation! Otherwise you will need to hack config.h.

> 3. What command do I use in udev.conf to auto-create /dev/gps0 and dev/gpspps0 links

Just create "/etc/udev/rules.d/96-linux_pps.rules" file which contains
two lines:
KERNEL=="pps0", SYMLINK+="gpspps0"
KERNEL=="ttyS0", SYMLINK+="gps0"

> After running my setup overnight, I came up with the following sync times between NTP clients and server:
>      remote           refid      st t when poll reach   delay   offset  jitter
> ==============================================================================
> *CLN1-A19        GPS_NMEA(0)      2 u    5   16  377    0.039    0.029   0.001

Good results.

Best regards!
--
Igor Plyatov



More information about the LinuxPPS mailing list