[LinuxPPS] Problems using Garmin 18x LVC, Debian src ntp_4.2.6.p2, NMEA driver, linuxpps and 2.6.34.1 pristine kernel

TomK forensic at milwpc.com
Wed Sep 15 07:14:00 CEST 2010


Hi Rodolfo,

Congratulations on inclusion in the kernel. Great work! I'm having a
problem with the pristine 2.6.34.1 kernel source configured for PPS
combined with Garmin 18x LVC with PPS on RS232 DCD pin 1, and the Debian
src ntp package using the NMEA driver.


This is a laptop using PCMCIA CardBus Quad Serial Adapter:

lspci -vvv

04:00.0 Serial controller: Oxford Semiconductor Ltd OX16PCI954 (Quad
16950 UART) function 0 (Uart) (rev 01) (prog- if 06 [16950])
Subsystem: Oxford Semiconductor Ltd Device 0000

Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-Status: Cap+ 66MHz- UDF- FastB2B+
ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-

Interrupt: pin A routed to IRQ 17

Region 0: I/O ports at c000 [size=32]
Region 1: Memory at c4000000 (32-bit, non-prefetchable) [size=4K]
Region 2: I/O ports at c020 [size=32]
Region 3: Memory at c4001000 (32-bit, non-prefetchable) [size=4K]

Capabilities: [40] Power Management version 2 Flags: PMEClk- DSI- D1- D2
+ AuxCurrent=0mA PME(D0+,D1-,D2+,D3hot+,D3cold-)

Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-

Kernel driver in use: serial


04:00.1 Bridge: Oxford Semiconductor Ltd OX16PCI954 (Quad 16950 UART)
function 1 (8bit bus) (rev 01)
Subsystem: Oxford Semiconductor Ltd Device 0000

Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-

Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-

Interrupt: pin A routed to IRQ 17

Region 0: I/O ports at c040 [size=32]
Region 1: Memory at c4002000 (32-bit, non-prefetchable) [size=4K]
Region 2: I/O ports at c060 [size=32]
Region 3: Memory at c4003000 (32-bit, non-prefetchable) [size=4K]

Capabilities: [40] Power Management version 2
Flags: PMEClk- DSI- D1- D2+ AuxCurrent=0mA PME(D0+,D1-,D2+,D3hot
+,D3cold-)

Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-

Kernel driver in use: serial

setserial -g -a /dev/ttyS4

/dev/ttyS4, Line 4, UART: 16950/954, Port: 0xc000, IRQ: 17
	Baud_base: 115200, close_delay: 50, divisor: 0
	closing_wait: 3000
	Flags: spd_normal skip_test

setserial -g -a /dev/ttyS5

/dev/ttyS5, Line 5, UART: 16950/954, Port: 0xc008, IRQ: 17
	Baud_base: 115200, close_delay: 50, divisor: 0
	closing_wait: 3000
	Flags: spd_normal skip_test


I run this script:

#!/bin/bash

sudo /etc/init.d/ntp stop

sudo ldattach 18 /dev/ttyS4
sudo ldattach 18 /dev/ttyS5

sudo ln -s /dev/ttyS4 /dev/gps0
sudo ln -s /dev/ttyS5 /dev/gps1

sudo ln -s /dev/pps0 /dev/gpspps0
sudo ln -s /dev/pps1 /dev/gpspps1

sudo /usr/bin/ntpd -g

tail -f /var/log/messages

new PPS source serial4 at ID 
PPS source #0 "/dev/ttyS4" added
new PPS source serial5 at ID 1
PPS source #0 "/dev/ttyS5" added

tail -f /var/log/ntpd.log

0.0.0.0 c016 06 restart
14 Sep 20:00:47 ntpd[24461]: 0.0.0.0 c012 02 freq_set kernel -23.640 PPM
14 Sep 20:00:47 ntpd[24461]: GPS_NMEA(0) 802b 8b clock_event
clk_no_reply
14 Sep 20:00:48 ntpd[24461]: GPS_NMEA(1) 8024 84 reachable
14 Sep 20:00:48 ntpd[24461]: GPS_NMEA(1) 963a 8a sys_peer
14 Sep 20:00:48 ntpd[24461]: 0.0.0.0 c41c 0c clock_step -2.650454 s
14 Sep 20:00:45 ntpd[24461]: 0.0.0.0 c414 04 freq_mode
14 Sep 20:00:46 ntpd[24461]: 169.229.70.183 8024 84 reachable
14 Sep 20:00:46 ntpd[24461]: 0.0.0.0 c418 08 no_sys_peer
14 Sep 20:00:47 ntpd[24461]: GPS_NMEA(0) 8034 84 reachable
14 Sep 20:00:47 ntpd[24461]: GPS_NMEA(0) 964a 8a sys_peer
14 Sep 20:00:49 ntpd[24461]: 64.6.144.6 8024 84 reachable
14 Sep 20:01:49 ntpd[24461]: GPS_NMEA(1) 8044 84 reachable
14 Sep 20:07:24 ntpd[24461]: 0.0.0.0 c428 08 no_sys_peer
14 Sep 21:59:34 ntpd[24461]: GPS_NMEA(0) 961a 8a sys_peer
14 Sep 21:59:34 ntpd[24461]: 0.0.0.0 c412 02 freq_set kernel 280.645 PPM
14 Sep 21:59:34 ntpd[24461]: 0.0.0.0 c41c 0c clock_step +2.169246 s
14 Sep 21:59:36 ntpd[24461]: 0.0.0.0 c415 05 clock_sync
14 Sep 21:59:36 ntpd[24461]: 64.6.144.6 8033 83 unreachable
14 Sep 21:59:36 ntpd[24461]: GPS_NMEA(1) 8014 84 reachable
14 Sep 21:59:36 ntpd[24461]: GPS_NMEA(1) 962a 8a sys_peer
14 Sep 21:59:36 ntpd[24461]: 0.0.0.0 c413 03 spike_detect +2.167394 s
14 Sep 21:59:36 ntpd[24461]: 64.6.144.6 8044 84 reachable
14 Sep 21:59:37 ntpd[24461]: GPS_NMEA(0) 8024 84 reachable
14 Sep 21:59:37 ntpd[24461]: GPS_NMEA(0) 963a 8a sys_peer
14 Sep 21:59:39 ntpd[24461]: 169.229.70.183 8014 84 reachable
14 Sep 21:59:53 ntpd[24461]: 0.0.0.0 c415 05 clock_sync
14 Sep 22:08:08 ntpd[24461]: 0.0.0.0 0418 08 no_sys_peer


ntpq -c rv -p

associd=0 status=0018 leap_none, sync_unspec, 1 event, no_sys_peer,
version="ntpd 4.2.6p2 at 1.2194-o Tue Sep 14 06:45:53 UTC 2010 (2)",
processor="i686", system="Linux/2.6.34.1-pps", leap=00,
stratum=1, precision=-19, rootdelay=0.000, rootdisp=92.948, refid=GPS,
reftime=d03ab6d9.9290383e  Tue, Sep 14 2010 22:07:05.572,
clock=d03ac871.271d0684  Tue, Sep 14 2010 23:22:09.152, peer=0, tc=4,
mintc=3, offset=-9.443, frequency=171.048, sys_jitter=14.037,
clk_jitter=13.748, clk_wander=4.329

remote                  st t when poll reach   delay   offset  jitter
==============================================================================
xGPS_NMEA(0)            0 l    8   16  377    0.000  -856.17  15.785
xGPS_NMEA(1)            0 l   25   64  377    0.000  -856.62  25.490
xntp1                   3 u   25   64  377   72.080  -373.66  36.942
xtriangle               2 u   60   64  177   68.474  -385.83  40.975

Something is not right! 

/usr/src/pps/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 1284526310.758731631, sequence: 13871 - clear
1284512561.252409406, sequence: 124

source 0 - assert 1284526311.758926030, sequence: 13872 - clear
1284512561.252409406, sequence: 124

source 0 - assert 1284526312.759120902, sequence: 13873 - clear
1284512561.252409406, sequence: 124

source 0 - assert 1284526313.759315161, sequence: 13874 - clear
1284512561.252409406, sequence: 124

source 0 - assert 1284526314.759510793, sequence: 13875 - clear
1284512561.252409406, sequence: 124

source 0 - assert 1284526315.759706681, sequence: 13876 - clear
1284512561.252409406, sequence: 124

source 0 - assert 1284526316.759901095, sequence: 13877 - clear
1284512561.252409406, sequence: 124

source 0 - assert 1284526317.760095568, sequence: 13878 - clear
1284512561.252409406, sequence: 124

source 0 - assert 1284526318.760291499, sequence: 13879 - clear
1284512561.252409406, sequence: 124


Garmin 18x LVC are set to 200ms pps pulse width. The serial card is 8x,
so I must set the GPS units to 38400 baud in order to communicate with
them at 4800 baud. If I set them to 4800, programs communicate with them
at 600 baud.

Relevant server entries in /etc/ntp.conf

server 127.127.20.0 prefer minpoll 4
fudge 127.127.20.0 flag3 1 flag2 0 time1 0.0

server 127.127.20.1
fudge 127.127.20.1 flag3 1 flag2 0 time1 0.0


I don't really need microsecond accuracy on my laptop, but I post this
mostly to help perfect linuxpps. If anyone has any ideas, let me know.
The performance of this setup is clearly pretty bad, but I'm not sure
why.

-Tom

-- 
Those who exalt human understanding, make themselves laughing stock for
The Sons of God.






More information about the LinuxPPS mailing list