[ntp:questions] How to debug GPS PPS?
Richard B. Gilbert
rgilbert88 at comcast.net
Wed Dec 30 23:34:04 UTC 2009
xyz-2041 wrote:
> Plugged in the GPS unit's serial cable into a Windows
> computer running WinOncore12 v1.0 (Build 37):
>
> http://www.google.com/#q=WinOncore12Installation.exe
>
> Seemed to work without any problems. Generated
> all sort of graphs and charts. Let it run and it
> told me exact latitude, longitude and height above
> sea level.
>
> Used an analog volt meter and from pin 5 (supposed
> to be ground), I only noticed voltage on pins 2 and 3.
> Pin 2 was going erratically negative once a second.
> I believe that this must be received data as per
> standards. Pin 3 was +5 volts, but dropping to
> -5 volts once per second.
>
> I've changed my configs a bit, /var/log/ntp.log and
> /var/log/ntpd.log don't show any errors.
>
> However, "ntpq -c pe" still doesn't show any response:
>
> GPS_NMEA(0) .GPS. 0 l - 16 0 0.000
> 0.000 0.001
> PPS(0) .GPS. 0 l - 16 0 0.000
> 0.000 0.001
> GPS_ONCORE(0) .GPS-. 0 l - 16 0 0.000
> 0.000 0.001
>
> Also:
>
> ntpdc -c kerninfo
> pll offset: -0.00539973 s
> pll frequency: -46.079 ppm
> maximum error: 0.097522 s
> estimated error: 0.003708 s
> status: 2201 pll ppsjitter nano
> pll time constant: 8
> precision: 1e-09 s
> frequency tolerance: 496 ppm
> pps frequency: -9.224 ppm
> pps stability: 0.000 ppm
> pps jitter: 0 s
> calibration interval: 4 s
> calibration cycles: 0
> jitter exceeded: 0
> stability exceeded: 0
> calibration errors: 0
>
>
> Here is what I have done so far:
>
> - Edit new kernel config file:
>
> cd /usr/src/sys/i386/conf/
> nano PPS-Generic
>
> # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> # Generic kernel configuration with PPS_SYNC option
> #
> include GENERIC
>
> ident PPS-GENERIC
>
> # Enable support for the kernel PLL to use an external PPS signal,
> # under supervision of [x]ntpd(8)
> # More info in ftp://ftp.udel.edu/pub/ntp/kernel.tar.Z
> options PPS_SYNC
> # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> - Build and compile the new kernel:
>
> cd /usr/src
> ls -lt /usr/src/sys/i386/conf
> make buildkernel KERNCONF=PPS-GENERIC
>
> This should take 10 mins to 2 hours depending
> on the speed of your computer.
>
> Check to see that it was created:
>
> cd /usr/obj/usr/src/sys/PPS-GENERIC
> ls -lta | more
>
> - Install the new kernel:
>
> cd /usr/src
> make installkernel KERNCONF=PPS-GENERIC
>
> Check that the new kernel is installed:
>
> cd /boot
> ls -lta
>
> These directories should be there:
>
> kernel
> kernel.old
>
> Go into each directory and notice
> the time stamps of the "kernel"
> files:
>
> cd /boot/kernel
> ls -lta | grep kernel
>
> -r-xr-xr-x 1 root wheel 10204732 Dec 19 13:44 kernel
> -r-xr-xr-x 1 root wheel 31172114 Dec 19 13:44 kernel.symbols
>
>
> cd /boot/kernel.old
> ls -lta | grep kernel
>
> -r-xr-xr-x 1 root wheel 10201628 May 1 2009 kernel
> -r-xr-xr-x 1 root wheel 31167198 May 1 2009 kernel.symbols
>
> Reboot:
>
> shutdown -r now
>
> - Check if new kernel running
>
> After rebooting and logging in:
>
> uname -a | grep PPS
>
> You should get a readout of the kernel
> name which should include "PPS"
>
>
> - Create Oncore config file
>
> cd /etc
> nano ntp.oncore0
>
> MODE 1
> LON -75.7479
> LAT 39.6632
> HTGPS 67 FT
> DELAY 30 NS
>
>
> - Create symbolic links:
>
> ln -s /dev/cuad0 /dev/oncore.pps.0
> ln -s /dev/cuad0 /dev/oncore.serial.0
> ln -s /dev/cuad0 /dev/gps0
> ln -s /dev/cuad0 /dev/pps0d
>
> - Create /etc/devfs.conf links:
>
> link cuad0 pps0
> link cuad0 gps0
> link cuad0 oncore.pps.0
> link cuad0 oncore.serial.0
>
> - Check them:
>
> ls -lta /dev | more
>
> - Edit /etc/ntp.conf:
>
> # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> # This is the configuration file for NTP
> # (Network Time Protocol). More info at
> # www.NTP.org
> #
> # /etc/ntp.conf
>
> # This computer will act as a stratum 2 time
> # server, by referencing the following 4 or
> # more stratum 1 time servers:
>
> server ntp2.netwrx1.com iburst # WI
> server otc1.psu.edu iburst # PA
> server t2.timegps.net iburst # CA
> server tick.usask.ca iburst # CAN
>
>
> # GPS NMEA (numbers seconds only)
> # server 127.127.20.0 prefer minpoll 4 maxpoll 4
> server 127.127.20.0 minpoll 4 maxpoll 4
>
> #flag3 Controls the kernel PPS discipline: 0 for disable (default), 1
> for enable.
> # fudge 127.127.20.0 flag3 1
> fudge 127.127.20.0 flag3 0
>
>
> # GPS PPS
> server 127.127.22.0 prefer minpoll 4 maxpoll 4
>
> #flag3 Controls the kernel PPS discipline: 0 for disable (default), 1
> for enable.
> fudge 127.127.22.0 flag3 1
> fudge 127.127.22.0 refid GPS
>
>
> # GPS Oncore driver
> server 127.127.30.0
> fudge 127.127.30.0 refid GPS-Oncore
>
>
> # Since the clock on most PCs drifts around
> # significantly, let's use a file to
> # keep track of that drift and compensate
> # for it:
> driftfile /etc/ntp.drift
>
> # This server will broadcast NTP timing signals
> # over the Local Area Network (LAN):
> broadcast 192.168.1.255
>
> # Let's setup a log file for NTP:
> logfile /var/log/ntp.log
>
> # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> Does anyone have any idea what I might check next?
This is the first I've heard of "Winoncore 12" "Oncore" used to be a
Motorola trademark for a GPS receiver. IIRC it was a Motorola Oncore
M12+T. Motorola got out of the GPS business years ago; they sold the
business to (I think) SiRF.
Your ntp.conf file mentions being a Stratum 2 server. If you are using
GPS your stratum is 1 because you are getting your time from an atomic
clock on one of the Navstar satellites!
How to "debug" it depends on what sort of a bug it is. If you said why
you think you have a bug, I missed it!
Your biggest problem may be that Windows is not exactly the world's
greatest time keeper! The clock "ticks" every 17 milliseconds!
More information about the questions
mailing list