[LinuxPPS] Fwd: Attaching PPS to kernel

Igor Plyatov plyatov at gmail.com
Sat Apr 2 09:09:00 CEST 2011


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