PPS timing investigation

View: New views
3 Messages — Rating Filter:   Alert me  

PPS timing investigation

by Håkan Johansson-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

In order to figure out how the ntpshm.c PPS and serial handling can be
improved, data on the behaviour of various module models is needed.  By
slight extension of the existing log messages (attachment
gpsd_pps_timing_log.diff), the necessary data can be collected.

The following almost does the trick:

gpsd -n -N /dev/ttyXXX -D6 2>&1 | \
   egrep "pps-detect|ntpshm_put|driver|speed" | \
   head -n 100 > ~/pps_log_YYY.txt

(except that head does not stop the execution when done, so a Ctrl-C is
needed, other variations may be needed...)

I've tried it on the two types I have at hand, with the following results
(see attached files):

motorola oncore UT+ with the oncore binary format (@ 9600 bps):
PPS pulse is 200 ms long
ntpshm_put gets called @~180 ms after the second, with the time of the
preceding pulse (first edge).  Note that 160 ms of the time stamp are due
to the magic shift in the ntpshm_put call)  (the remaining sub-second
information seems to be wrong)
(the initial missing ntpshm_put calls and the bad pulses are due to a hard
reset at program startup to position hold mode - it takes some time before
it finds a satellite again)

garmin 18 lvc with nmea output format (@ 4800 bps) (1 pps):
PPS pulse is 40 ms long
ntpshm_put gets called @~175 ms after the second, with time of preceding
pulse.  no ntpshm_put magic
(the offset in the times is due to the machine's ntpd tracking a network
reference - I'm not in charge of that ntpd.conf...)

Further notes:

The effect of running gpsd at -D6 is with a 1.6 GHz machine approximately
a delay of 1 ms in the @ timing of the ntpshm_put information due to
previous log message production.  The PPS pulse @ timing has no such
effects.

It would be nice if other developers/users also could provide similar
data, so we can get to the bottom of this issue.  I'm not aware of this
information already existing.  I'm sure someone will correct me...

Cheers, and thanks in advance
Håkan
[gpsd_pps_timing_log.diff]

Index: libgpsd_core.c
===================================================================
--- libgpsd_core.c (revision 6426)
+++ libgpsd_core.c (arbetskopia)
@@ -148,9 +148,10 @@
  break;
     }
  } else {
-    gpsd_report(LOG_RAW, "pps-detect (%s) on %s changed to %d\n",
+    gpsd_report(LOG_RAW, "pps-detect (%s) on %s changed to %d @ %lu.%06lu\n",
  ((pps_device==TIOCM_CAR) ? "DCD" : "CTS"),
-  session->gpsdata.dev.path, state);
+  session->gpsdata.dev.path, state,
+ (unsigned long)tv.tv_sec, (unsigned long)tv.tv_usec);
     laststate = state;
     unchanged = 0;
  }
Index: ntpshm.c
===================================================================
--- ntpshm.c (revision 6426)
+++ ntpshm.c (arbetskopia)
@@ -141,9 +141,10 @@
     shmTime->count++;
     shmTime->valid = 1;
 
-    gpsd_report(LOG_RAW, "ntpshm_put: Clock: %lu @ %lu.%06lu\n"
- , (unsigned long)seconds, (unsigned long)tv.tv_sec
-        , (unsigned long)tv.tv_usec);
+    gpsd_report(LOG_RAW, "ntpshm_put: Clock: %lu.%06lu @ %lu.%06lu (pktlen %d)\n"
+ , (unsigned long)seconds, (unsigned long)microseconds
+ , (unsigned long)tv.tv_sec, (unsigned long)tv.tv_usec
+ , session->packet.outbuflen);
 
     return 1;
 }


gpsd: speed 4800, 8N1
gpsd: switch_driver(Generic NMEA) called...
gpsd: selecting Generic NMEA driver...
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637878.999640
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637879.039657
gpsd: ntpshm_put: Clock: 1257637879.000000 @ 1257637879.200069 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637879.999645
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637880.039648
gpsd: ntpshm_put: Clock: 1257637880.000000 @ 1257637880.176019 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637880.999655
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637881.039654
gpsd: ntpshm_put: Clock: 1257637881.000000 @ 1257637881.176013 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637881.999647
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637882.039644
gpsd: ntpshm_put: Clock: 1257637882.000000 @ 1257637882.196006 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637882.999644
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637883.039647
gpsd: ntpshm_put: Clock: 1257637883.000000 @ 1257637883.176010 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637883.999645
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637884.039672
gpsd: ntpshm_put: Clock: 1257637884.000000 @ 1257637884.176015 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637884.999640
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637885.039656
gpsd: ntpshm_put: Clock: 1257637885.000000 @ 1257637885.176006 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637885.999641
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637886.039680
gpsd: ntpshm_put: Clock: 1257637886.000000 @ 1257637886.175998 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637886.999642
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637887.039651
gpsd: ntpshm_put: Clock: 1257637887.000000 @ 1257637887.176011 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637887.999647
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637888.039656
gpsd: ntpshm_put: Clock: 1257637888.000000 @ 1257637888.176000 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637888.999641
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637889.039654
gpsd: ntpshm_put: Clock: 1257637889.000000 @ 1257637889.176007 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637889.999646
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637890.039646
gpsd: ntpshm_put: Clock: 1257637890.000000 @ 1257637890.176022 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637890.999640
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637891.039650
gpsd: ntpshm_put: Clock: 1257637891.000000 @ 1257637891.176884 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637891.999641
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637892.039647
gpsd: ntpshm_put: Clock: 1257637892.000000 @ 1257637892.175977 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637892.999641
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637893.039667
gpsd: ntpshm_put: Clock: 1257637893.000000 @ 1257637893.175998 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637893.999642
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637894.039649
gpsd: ntpshm_put: Clock: 1257637894.000000 @ 1257637894.176008 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637894.999643
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637895.039650
gpsd: ntpshm_put: Clock: 1257637895.000000 @ 1257637895.179992 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637895.999642
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637896.039645
gpsd: ntpshm_put: Clock: 1257637896.000000 @ 1257637896.175997 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637896.999645
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637897.039659
gpsd: ntpshm_put: Clock: 1257637897.000000 @ 1257637897.176002 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637897.999644
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637898.039646
gpsd: ntpshm_put: Clock: 1257637898.000000 @ 1257637898.183994 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637898.999659
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637899.039648
gpsd: ntpshm_put: Clock: 1257637899.000000 @ 1257637899.175969 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637899.999645
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637900.039649
gpsd: ntpshm_put: Clock: 1257637900.000000 @ 1257637900.183994 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637900.999641
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637901.039645
gpsd: ntpshm_put: Clock: 1257637901.000000 @ 1257637901.175997 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637901.999658
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637902.039656
gpsd: ntpshm_put: Clock: 1257637902.000000 @ 1257637902.176003 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637902.999659
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637903.039647
gpsd: ntpshm_put: Clock: 1257637903.000000 @ 1257637903.175995 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637903.999643
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637904.039648
gpsd: ntpshm_put: Clock: 1257637904.000000 @ 1257637904.184008 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637904.999646
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637905.039645
gpsd: ntpshm_put: Clock: 1257637905.000000 @ 1257637905.175990 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637905.999642
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637906.039646
gpsd: ntpshm_put: Clock: 1257637906.000000 @ 1257637906.176007 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637906.999640
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637907.039652
gpsd: ntpshm_put: Clock: 1257637907.000000 @ 1257637907.176005 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637907.999645
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637908.039649
gpsd: ntpshm_put: Clock: 1257637908.000000 @ 1257637908.175993 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637908.999652
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637909.039651
gpsd: ntpshm_put: Clock: 1257637909.000000 @ 1257637909.175991 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637909.999642
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257637910.039652
gpsd: ntpshm_put: Clock: 1257637910.000000 @ 1257637910.175988 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257637910.999641

gpsd: speed 9600, 8N1
gpsd: switch_driver(oncore binary) called...
gpsd: selecting oncore binary driver...
gpsd: ntpshm_put: Clock: 1257638185.160882 @ 1257638185.386469 (pktlen 76)
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638186.000001
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638186.046939
gpsd: ntpshm_put: Clock: 1257638186.160941 @ 1257638186.193690 (pktlen 76)
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638192.334584
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638192.532729
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638193.334582
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638193.532791
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638194.334590
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638194.532853
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638195.334599
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638195.532934
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638196.334584
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638196.532959
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638197.334583
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638197.533029
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638198.334583
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638198.533093
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638199.334582
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638199.533152
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638200.334583
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638200.533212
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638201.334583
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638201.533257
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638202.334583
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638202.533335
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638203.334582
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638203.533386
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638204.334581
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638204.533448
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638205.334583
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638205.533655
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638206.334583
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638206.533570
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638207.334585
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638207.532623
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638208.334583
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638208.532670
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638209.078857
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638209.277714
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638211.078857
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638211.277854
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638212.078855
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638212.276913
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638213.078858
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638213.276957
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638214.078856
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638214.277017
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638215.078856
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638215.277093
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638216.078855
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638216.277152
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638217.078856
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638217.277209
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638218.078857
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638218.277268
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638219.078857
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638219.277331
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638220.078856
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638220.277388
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638221.078859
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638221.277448
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638222.078859
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638222.277507
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638223.078857
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638223.277571
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638224.078858
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638224.277628
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638225.078857
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638225.277685
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638226.078858
gpsd: ntpshm_put: Clock: 1257638226.239719 @ 1257638226.261710 (pktlen 76)
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638226.277749
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638227.000001
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638227.198785
gpsd: ntpshm_put: Clock: 1257638228.160834 @ 1257638228.181678 (pktlen 76)
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638229.000001
gpsd: ntpshm_put: Clock: 1257638229.160894 @ 1257638229.193662 (pktlen 76)
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638229.198913
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638230.000000
gpsd: ntpshm_put: Clock: 1257638230.160953 @ 1257638230.181893 (pktlen 76)
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638230.198960
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638231.000001
gpsd: ntpshm_put: Clock: 1257638231.160013 @ 1257638231.181903 (pktlen 76)
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638231.198040
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638232.000001
gpsd: ntpshm_put: Clock: 1257638232.160073 @ 1257638232.181892 (pktlen 76)
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638232.198101
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638233.000000
gpsd: ntpshm_put: Clock: 1257638233.160132 @ 1257638233.189943 (pktlen 76)
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638233.198166
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638234.000001
gpsd: ntpshm_put: Clock: 1257638234.160192 @ 1257638234.181892 (pktlen 76)
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638234.198220
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638235.000000
gpsd: ntpshm_put: Clock: 1257638235.160252 @ 1257638235.181890 (pktlen 76)
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638235.198279
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638236.000002
gpsd: ntpshm_put: Clock: 1257638236.160312 @ 1257638236.181892 (pktlen 76)
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638236.198340
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638237.000003
gpsd: ntpshm_put: Clock: 1257638237.160371 @ 1257638237.181889 (pktlen 76)
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638237.198404
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638238.000002
gpsd: ntpshm_put: Clock: 1257638238.160431 @ 1257638238.189951 (pktlen 76)
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 1 @ 1257638238.198435
gpsd: pps-detect (CTS) on /dev/ttyS0 changed to 0 @ 1257638239.000001

_______________________________________________
Gpsd-dev mailing list
Gpsd-dev@...
https://lists.berlios.de/mailman/listinfo/gpsd-dev

Re: PPS timing investigation

by Miroslav Lichvar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Nov 08, 2009 at 01:28:33AM +0100, Håkan Johansson wrote:
> In order to figure out how the ntpshm.c PPS and serial handling can
> be improved, data on the behaviour of various module models is
> needed.  By slight extension of the existing log messages
> (attachment gpsd_pps_timing_log.diff), the necessary data can be
> collected.

Here is my log from GPS 18x LVC in NMEA mode.

Note that most of the GPRMC message don't make the 0.5 second locking
limit in ntpshm_pps(), so they are ignored.

Also, the pulse width is only 40 ms by default, which makes gpsd
report both edges and ntpd is most likely (96% chance) syncing to the
wrong edge.

--
Miroslav Lichvar

gpsd: speed 9600, 8N1
gpsd: switch_driver(Generic NMEA) called...
gpsd: selecting Generic NMEA driver...
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853974.000039
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853974.040021
gpsd: ntpshm_put: Clock: 1257853974.000000 @ 1257853974.560483 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853975.000024
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853975.040023
gpsd: ntpshm_put: Clock: 1257853975.000000 @ 1257853975.546411 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853976.000023
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853976.040021
gpsd: ntpshm_put: Clock: 1257853976.000000 @ 1257853976.533423 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853977.000022
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853977.040023
gpsd: ntpshm_put: Clock: 1257853977.000000 @ 1257853977.519405 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853978.000025
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853978.040023
gpsd: ntpshm_put: Clock: 1257853978.000000 @ 1257853978.532420 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853979.000023
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853979.040022
gpsd: ntpshm_put: Clock: 1257853979.000000 @ 1257853979.525426 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853980.000024
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853980.040022
gpsd: ntpshm_put: Clock: 1257853980.000000 @ 1257853980.535420 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853981.000022
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853981.040024
gpsd: ntpshm_put: Clock: 1257853981.000000 @ 1257853981.544426 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853982.000025
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853982.040023
gpsd: ntpshm_put: Clock: 1257853982.000000 @ 1257853982.535420 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853983.000023
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853983.040022
gpsd: ntpshm_put: Clock: 1257853983.000000 @ 1257853983.536423 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853984.000023
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853984.040022
gpsd: ntpshm_put: Clock: 1257853984.000000 @ 1257853984.526422 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853985.000022
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853985.040024
gpsd: ntpshm_put: Clock: 1257853985.000000 @ 1257853985.490414 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853986.000024
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853986.040023
gpsd: ntpshm_put: Clock: 1257853986.000000 @ 1257853986.522422 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853987.000026
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853987.040023
gpsd: ntpshm_put: Clock: 1257853987.000000 @ 1257853987.489423 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853988.000023
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853988.040021
gpsd: ntpshm_put: Clock: 1257853988.000000 @ 1257853988.524381 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853989.000023
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853989.040023
gpsd: ntpshm_put: Clock: 1257853989.000000 @ 1257853989.522423 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853990.000025
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853990.040023
gpsd: ntpshm_put: Clock: 1257853990.000000 @ 1257853990.497423 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853991.000022
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853991.040022
gpsd: ntpshm_put: Clock: 1257853991.000000 @ 1257853991.525380 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853992.000023
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853992.040022
gpsd: ntpshm_put: Clock: 1257853992.000000 @ 1257853992.490412 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853993.000022
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853993.040024
gpsd: ntpshm_put: Clock: 1257853993.000000 @ 1257853993.499427 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853994.000024
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853994.040023
gpsd: ntpshm_put: Clock: 1257853994.000000 @ 1257853994.524423 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853995.000027
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853995.040032
gpsd: ntpshm_put: Clock: 1257853995.000000 @ 1257853995.502428 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853996.000024
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853996.040021
gpsd: ntpshm_put: Clock: 1257853996.000000 @ 1257853996.538379 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853997.000022
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853997.040024
gpsd: ntpshm_put: Clock: 1257853997.000000 @ 1257853997.501426 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853998.000025
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853998.040024
gpsd: ntpshm_put: Clock: 1257853998.000000 @ 1257853998.556427 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257853999.000023
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257853999.040022
gpsd: ntpshm_put: Clock: 1257853999.000000 @ 1257853999.518394 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257854000.000024
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257854000.040021
gpsd: ntpshm_put: Clock: 1257854000.000000 @ 1257854000.492342 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257854001.000023
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257854001.040023
gpsd: ntpshm_put: Clock: 1257854001.000000 @ 1257854001.498425 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257854002.000024
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257854002.040022
gpsd: ntpshm_put: Clock: 1257854002.000000 @ 1257854002.502424 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257854003.000026
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257854003.040022
gpsd: ntpshm_put: Clock: 1257854003.000000 @ 1257854003.505355 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257854004.000023
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257854004.040021
gpsd: ntpshm_put: Clock: 1257854004.000000 @ 1257854004.497425 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257854005.000023
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 0 @ 1257854005.040022
gpsd: ntpshm_put: Clock: 1257854005.000000 @ 1257854005.497353 (pktlen 74)
gpsd: pps-detect (DCD) on /dev/ttyS0 changed to 1 @ 1257854006.000025

_______________________________________________
Gpsd-dev mailing list
Gpsd-dev@...
https://lists.berlios.de/mailman/listinfo/gpsd-dev

Re: PPS timing investigation

by Håkan Johansson-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Some more partial information, scavenged from old posts:

--

http://developer.berlios.de/support/?func=detailsupport&support_id=102840&group_id=2116

GPS18xLVC, NMEA, DCD
@ 0   -> 1 dur (of 0): 960 ms
       -> 0 dur (of 1):  40 ms
                 _put + 430 ms, report after pulse
offset 420 ms supported by ntpd.conf entry

--

https://lists.berlios.de/pipermail/gpsd-users/2008-February/003161.html

unknown NMEA device, DCD
       -> 0 dur (of 1): 802 ms
       -> 1 dur (of 0): 198 ms
                 _put + 333 ms, report after pulse(?)
_put offset could be wrong - lock lost.

--

http://osdir.com/ml/hardware.gps.gpsd.user/2008-01/msg00033.html

Furuno Electric unit, NMEA, DCD
@0    -> 1 dur (of 0): 500 ms
                 _put + 200 ms, report after pulse
       -> 0 dur (of 1): 500 ms

--

http://old.nabble.com/Missing-PPS-signal-after-midnight-td16761435.html

Garmin HVS17, DCD
@0    -> 1 dur (of 0): 960 ms
       -> 0 dur (of 1):  40 ms
                 _put + 340 ms, report after pulse

--

Håkan
_______________________________________________
Gpsd-dev mailing list
Gpsd-dev@...
https://lists.berlios.de/mailman/listinfo/gpsd-dev