[LinuxPPS] Need help with setting up LinuxPPS/NTP server

Hal V. Engel hvengel at astound.net
Wed Oct 8 21:17:21 CEST 2008


On Wednesday 08 October 2008 10:57:11 Richard Abbott wrote:
>  Hal,
>
>  Thanks for the quick response.
>
>  I did a search on my system and the ppsldisc and ppstest commands were not
> compiled with the rest of the sources. So to answer your first question, no
> I wasn't running ppsldisc.
>
>  I found their sources in the Documentation/pps/ directories of both the
> ntp and kernel sources. With some finagling I was able to get both ppsldisc
> and ppstest to compile from the kernel sources area. After running
> ./ppsldisc /dev/ttyS0 here is a sample output from ppstest /dev/pps0
>
>  trying PPS source "/dev/pps0"
>  found PPS source "/dev/pps0"
>  ok, found 1 source(s), now start fetching data...
>  source 0 - assert 1223487531.497205940, sequence: 10262 - clear 
> 0.000000000, sequence: 0 source 0 - assert 1223487532.497206563, sequence:
> 10263 - clear  0.000000000, sequence: 0 source 0 - assert
> 1223487533.497206496, sequence: 10264 - clear  0.000000000, sequence: 0
> source 0 - assert 1223487534.497211739, sequence: 10265 - clear 
> 0.000000000, sequence: 0 source 0 - assert 1223487535.497206593, sequence:
> 10266 - clear  0.000000000, sequence: 0 source 0 - assert
> 1223487536.497211575, sequence: 10267 - clear  0.000000000, sequence: 0
> .......

This looks like ktimer output.  Notice how there are no clear events.  For a 
real refclock there will be both assert and clear events and both will have 
sequence numbers and time stamps that increment over time.  This output always 
has the clear event as sequence 0 and time stamp 0 which is not correct.

>
>  Besides the sound device I do not see any modules related to timers
> loaded. This however does not mean that I didn't build it directly into the
> kernel by mistake. Do you know what lines in the .config file should be
> disabled?

I should have said ktimer.  Sorry if this caused confusion.  This is located 
in the PPS section of the kernel config and is named CONFIG_PPS_CLIENT_KTIMER.  
The ktimer module is used to generate fake pps events for testing without 
needing a real refclock.   If the ktimer module is loaded you will have two 
pps devices listed if you do tree /sys/class/pps at least of you also have 
ppsldisc running.  If you have two pps entries located in /sys./class/pps then 
you have the ktimer module loaded.  There is also the possibility that you 
might be using the ktimer generated events rather than the events from the 
real pps source and this is why you need to confirm that it is not loaded.    

>
>  After getting ppsldisc running I restarted the ntp server. Here is the
> output I got from ntpq soon after restarting ntp
>
>  > ntpq -p
>
>       remote           refid      st t when poll reach   delay   offset 
> jitter
> ===========================================================================
>=== *GPS_NMEA(0)     .GPS.            0 l    8   16  377    0.000  483.336 
> 85.501 ntp2.your.org   216.218.254.202  2 u   11   64   17   30.433 
> 1243.75   0.371 time.nist.gov   .ACTS.           1 u    5   64    7  
> 41.591  1235.97   0.489 mirror          210.138.109.164  3 u    8   64  
> 17   27.716  1240.88   1.032 LOCAL(0)        .LOCL.          10 l   48  
> 64    7    0.000    0.000   0.001
>
>
>  Then after it finished syncing up with the remote timeservers it went back
> to how it looked before.
>
>  > ntpq -p
>
>       remote           refid      st t when poll reach   delay   offset 
> jitter
> ===========================================================================
>=== xGPS_NMEA(0)     .GPS.            0 l    8   16  377    0.000  637.591
> 739.522 +ntp2.your.org   216.218.254.202  2 u   46   64  377   30.562 
> 1245.10   1.322 *time.nist.gov   .ACTS.           1 u   41   64  177  
> 41.275  1237.31   1.642 +mirror          210.138.109.164  3 u   39   64 
> 377   27.608  1241.07   0.739 LOCAL(0)        .LOCL.          10 l   14  
> 64  377    0.000    0.000   0.001
>
>
> --
> Richard Abbott <rabbott at ticom-geo.com>
> TICOM Geomatics, Inc.
> 9130 Jollyville Rd, Ste 300
> Austin, TX 78759
> Office : (512)610-8340
> Fax : (512)345-9992
> Cell : (512)422-2352
>
>
>  Hal V. Engel wrote:
> On Wednesday 08 October 2008 09:52:54 Richard Abbott wrote:
>
> Hello all. I am having a bit of trouble getting a system configured to
> pull time and PPS from my GPS unit. I think I am close but I'm not sure
> where the disconnect in my system or configuration is and am hoping that
> y'all will be able to help me.
>
> I have followed the instructions on these sites as best I could and am
> seeing (more or less) what they say I am supposed to be seeing.
>
> http://time.qnan.org/
> and
> http://wiki.enneenne.com/index.php/LinuxPPS_support
>
> I am using a Garmin 35LVC for my OEM GPS unit. I have patched and
> compiled the 2.6.26 kernel with the appropriate LinuxPPS patch and have
> patched and compiled ntp-4.2.4p2 with the NMEA patch. For the kernel I
> have built in the 8250 serial and PPS directly into the kernel instead
> of as modules. RHEL4 update 5 AS standard install is the rest of the
> platform.
>
> The ntpd server is communicating with the GPS device but I suspect that
> it is not receiving the PPS signals. When ntpq is run it shows very
> large offset and jitter values when compared to servers it is connected
> to over the internet for comparison.
>
> Here are the config files as they are running on my machine and output
> from logs. Please let me know if there is other info that you would like.
>
> After booting I have to manually create symlinks /dev/gps0 -->
> /dev/ttyS0 and /dev/ppsgps0 --> /dev/pps0
>
>  > dmesg | grep 8250
>
> Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
> serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
> serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
>
>  > dmesg
>
> .......
> PPS event at 56274
> PPS event on source 0 at 1223477791.159246144
> PPS event at 56524
> PPS event on source 0 at 1223477792.159245962
> PPS event at 56774
> PPS event on source 0 at 1223477793.159244902
>
>  > cu -l /dev/ttyS0 -s 4800
>
> .......
> $GPRMC,145903,A,3022.9421,N,09744.6923,W,000.0,340.9,081008,005.8,E*61
> $GPGGA,145903,3022.9421,N,09744.6923,W,1,10,1.9,275.3,M,-23.1,M,,*70
> $GPGSA,A,3,03,,07,13,16,19,20,23,25,27,32,,3.3,1.9,2.6*37
> $GPGSV,3,1,11,03,48,100,36,06,40,080,30,07,34,304,38,13,62,325,36*72
> $GPGSV,3,2,11,16,24,041,30,19,36,142,33,20,19,200,31,23,85,133,40*76
> $GPGSV,3,3,11,25,48,325,35,27,26,300,33,32,09,181,31,,,,*40
>
>  > cat /sys/class/pps/pps0/assert
>
> 1223478098.159245740#827
>
>  > cat /sys/class/pps/pps0/assert
>
> 1223478100.159250016#829
>
>  > tail /var/log/messages
>
> Oct  8 15:02:57 localhost kernel: PPS event at 153024
> Oct  8 15:02:58 localhost kernel: PPS event at 153274
> Oct  8 15:02:59 localhost kernel: PPS event at 153524
> Oct  8 15:03:00 localhost kernel: PPS event at 153774
> Oct  8 15:03:01 localhost kernel: PPS event at 154024
>
> ntp.conf
> --------------------
> restrict default nomodify notrap noquery
> restrict 127.0.0.1
>
> # LinuxPPS: GPS + PPS
> server 127.127.20.0 prefer minpoll 4
> fudge 127.127.20.0 flag3 1 flag2 0 time1 0.0
>
> server 0.us.pool.ntp.org
> server 1.us.pool.ntp.org
> server 2.us.pool.ntp.org
>
> server  127.127.1.0     # local clock
> fudge   127.127.1.0 stratum 10
>
> driftfile /var/lib/ntp/drift
> broadcastdelay  0.008
>
>  >ntpd -g
>  >ntpq -p
>
>      remote               refid                    st t when poll
> reach   delay   offset  jitter
> ===========================================================================
> === xGPS_NMEA(0)   .GPS.                  0 l   17   16  376    0.000
> -641.83  72.089
> +ntp2.your.org       64.202.112.65    3 u   48   64  377   29.920
> 8.623   0.722
> *rrcs-64-183-55- .GPS.                   1 u   63   64  377   66.258
> -2.181   1.880
> +mercury.element  128.252.19.1       2 u   33   64  377   42.065
> 6.104   1.858
>  LOCAL(0)           .LOCL.               10 l   40   64  377    0.000
> 0.000   0.001
>
>  > ntpdc -c kern
>
> pll offset:           0.005085 s
> pll frequency:        63.751 ppm
> maximum error:        0.239794 s
> estimated error:      0.000879 s
> status:               0001  pll
> pll time constant:    6
> precision:            1e-06 s
> frequency tolerance:  500 ppm
>
>  From the ntpq -p you can see that the ntp daemon says the GPS is being
> designated a flasticker and not being used. I do not know what is
> causing this.
>
> Any help you could provide or resources you could point me to would be
> appreciated.
>
> Thanks
>
>
>
> First some basics.  The first thing you need to do is make sure that the
> pps signals are actually working.
>
> You don't have anything about running ppsldisc.  Are you running it?
>
> Do you have the timer kernal module loaded?  If you do you should unload it
> to prevent confusion about your PPS signals.
>
> After unloading the timer kernel module and starting ppsldisc in a separate
> terminal session what results to you get when running ppstest against your
> pps device?
>
> Until the above is working correctly it makes no sense to try to get ntpd
> working.
>
> Hal
>
> _______________________________________________
> LinuxPPS mailing list
> LinuxPPS at ml.enneenne.com
> http://ml.enneenne.com/cgi-bin/mailman/listinfo/linuxpps
> Wiki: http://wiki.enneenne.com/index.php/LinuxPPS_support




More information about the LinuxPPS mailing list