gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NTPsec reports excessive jitter from GPSD/KPPS SHM


From: Nick Burkitt
Subject: NTPsec reports excessive jitter from GPSD/KPPS SHM
Date: Wed, 04 Mar 2020 22:17:25 +0000
User-agent: eM_Client/7.2.37929.0

Hi Gary.

It's not clear if this is a GPSD question, or an NTPsec question, but I have to start somewhere. :-)
I'm running GPSD and NTPsec (details below). NPTsec reports wild numbers for PPS jitter, and eventually marks PPS as a falseticker and ignores it. Here's my setup:

Xilinx Znyq Soc (FPGA + ARM Cortex A9 x 2)
Linux kernel 4.19.101
Ubuntu 18.04 LTS distro
GPSD 3.20
NTPsec 1.1.8+
U-blox NEO-M8T GNSS module
KPPS from u-blox timepulse output through custom driver as (rising edge only)
gpsd is invoked with "/usr/local/sbin/gpsd -n /dev/pps0 /dev/core100/gnss /dev/ttyS0" where /dev/pps0 is /dev/core100/gnss symlinks to /dev/ttyACM1 (u-blox), and /dev/ttyS0 is unconnected.
ntpd is invoked with "/usr/sbin/ntpd -g -N -u ntp:ntp -p /var/run/ntpd.pid"

ppstest shows a jitter of <500 microseconds.
gpsmon shows a jitter of < 500 us.
FPGA-based hardware counter shows a jitter of < 1 us.
ntpmon shows jitter of up to tens of milliseconds, and never less than 2 ms.

No doubt I've got something configured wrong. 

Thanks,

-Nick

================================================
Too much information follows:

ntp.conf:

root@MPM-4006:~# cat /etc/ntp.d/ntp.conf
# This is a complete, usable ntp.conf file assembled from use snippets.

# To configure as a Stratum 1 using GPSD, uncomment the first line.

includefile use-gpsd-shm        # GPSD via SHM as a local clock source
includefile use-country-pool        # Check servers from the US pool
includefile use-no-remote-configuration # Normal security
includefile use-minimal-logging     # Declare a drift file and that's it

# end
================================================
use-gpsd-shm:

root@MPM-4006:~# cat /etc/ntp.d/use-gpsd-shm
# Simplest possible refclock configuration for sites with a GPS primary source.
#
# Uses the shared-memory driver, accepting fixes from a running gpsd
# instance watching one PPS-capable GPS. Accepts in-band GPS time (not
# very good, likely to have jitter in the 100s of milliseconds) on one
# unit, and PPS time (almost certainly good to 1 ms or less) on
# another.  Prefers the latter.

# GPS Serial data reference (NTP0)
refclock shm unit 0 refid GPS noselect

# GPS PPS reference (NTP1)
refclock shm unit 1 prefer refid PPS

# The following sets edit modes for GNU EMACS
# Local Variables:
# mode:conf
# End:
================================================
Representative ppstest output (after PPS has been marked as a falseticker):

root@MPM-4006:~# 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 1583357777.950557839, sequence: 15337 - clear  0.000000000, sequence: 0
source 0 - assert 1583357778.950736721, sequence: 15338 - clear  0.000000000, sequence: 0
source 0 - assert 1583357779.950914746, sequence: 15339 - clear  0.000000000, sequence: 0
source 0 - assert 1583357780.951092690, sequence: 15340 - clear  0.000000000, sequence: 0
source 0 - assert 1583357781.951268595, sequence: 15341 - clear  0.000000000, sequence: 0
source 0 - assert 1583357782.951445806, sequence: 15342 - clear  0.000000000, sequence: 0
source 0 - assert 1583357783.951619914, sequence: 15343 - clear  0.000000000, sequence: 0
source 0 - assert 1583357784.951797746, sequence: 15344 - clear  0.000000000, sequence: 0
source 0 - assert 1583357785.951969307, sequence: 15345 - clear  0.000000000, sequence: 0
source 0 - assert 1583357786.952142023, sequence: 15346 - clear  0.000000000, sequence: 0
source 0 - assert 1583357787.952315649, sequence: 15347 - clear  0.000000000, sequence: 0
source 0 - assert 1583357788.952488299, sequence: 15348 - clear  0.000000000, sequence: 0
source 0 - assert 1583357789.952659621, sequence: 15349 - clear  0.000000000, sequence: 0
source 0 - assert 1583357790.952830566, sequence: 15350 - clear  0.000000000, sequence: 0
source 0 - assert 1583357791.953000905, sequence: 15351 - clear  0.000000000, sequence: 0
source 0 - assert 1583357792.953169464, sequence: 15352 - clear  0.000000000, sequence: 0
source 0 - assert 1583357793.953338722, sequence: 15353 - clear  0.000000000, sequence: 0
source 0 - assert 1583357794.953506553, sequence: 15354 - clear  0.000000000, sequence: 0
source 0 - assert 1583357795.953676350, sequence: 15355 - clear  0.000000000, sequence: 0
source 0 - assert 1583357796.953840831, sequence: 15356 - clear  0.000000000, sequence: 0

================================================
Representative ntpmon output (afterPPS is marked as a falseticker):

     remote           refid      st t when poll reach   delay   offset   jitter
 SHM(0)          .GPS.            0 l   43   64  377   0.0000 -33.5071  17.3123
xSHM(1)          .PPS.            0 l   41   64  377   0.0000 -122.422  15.4372
 ntp2.sscgateway .DNS.           16 u    - 1024    0   0.0000   0.0000   0.0019
+ha81.smatwebdes 127.67.113.92    2 u   42  128  377  57.8299  19.3951  35.7520
-ntp2.wiktel.com .GPS.            1 u   35  128  377  80.3171 -37.5661  32.3464
-nu.binary.net   204.9.54.119     2 u  117  128  377  71.6982 -35.1534  36.6477
 pool.ntp.org    .POOL.          16 p    -  256    0   0.0000   0.0000   0.0019
*ntp2.wiktel.com .GPS.            1 u  114  128  377  78.7056  -8.1684  19.2080
+time.cloudflare 10.4.0.197       3 u   96  128  377  24.7144 -14.3229  20.2842
-triton.ellipse. 204.9.54.119     2 u  101  128  377  69.5353  23.8111  38.2074
-willprox.b3orio 206.108.0.131    2 u  107  128  377  37.3019  26.7657  38.4877
ntpd ntpsec-1.1.8+ 2020-03-04T20:55:58Z       Updated: 2020-03-04T21:54:13 (32)
 lstint avgint rstr r m v  count rport remote address
      0      5    0 . 6 2    548 36062 localhost
     36     74   d0 . 4 4     40   123 ntp2.wiktel.com
     43     74   d0 . 4 4     40   123 ha81.smatwebdesign.com
     97     72   d0 . 4 4     40   123 time.cloudflare.com
    102     74   d0 . 4 4     38   123 triton.ellipse.net
    108     74   d0 . 4 4     39   123 willprox.b3orion.com
    115     72   d0 . 4 4     40   123 ntp2.wiktel.com
    118     72   d0 . 4 4     40   123 nu.binary.net

================================================
Representative gpsmon output:

tcp://localhost:2947          JSON slave driver>
(82) {"class":"VERSION","release":"3.20","rev":"3.20","proto_major":3,"proto_minor":14}
(634) {"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/pps0","driver":"PPS","activated":"2020-03-04T22:01:54.033Z"},{"class":"DEVICE","path":"/dev/core100/gnss","driver":"u-blox","subtype":"S
W EXT CORE 3.01 (111141),HW 00080000","subtype1":",ROM BASE 2.01 (75331),FWVER=TIM 1.10,PROTVER=22.00,MOD=NEO-M8T-0,FIS=0xEF4015 (100111),GPS;GLO;GAL;BDS,SBAS;IMES;QZSS","activated":"2020-03-04T22:01:54.
130Z","flags":1,"native":1,"bps":9600,"parity":"N","stopbits":1,"cycle":1.00,"mincycle":0.25},{"class":"DEVICE","path":"/dev/ttyS0","activated":"2020-03-04T17:35:56.012Z","native":0,"bps":9600,"parity":"
N","stopbits":1,"cycle":1.00}]}
(122) {"class":"WATCH","enable":true,"json":false,"nmea":false,"raw":2,"scaled":false,"timing":false,"split24":false,"pps":true}

/dev/core100/gnss             u-blox>
┌──────────────────────────┐┌─────────────────────────────────────────────────┐
│Ch PRN  Az  El S/N Flag U ││ECEF Pos:  xxxxxxx.xxm  xxxxxxx.xxm  xxxxxxx.xxm │
│ 0   1  82  18  18 0404   ││ECEF Vel:     +0.01m/s     +0.01m/s     -0.01m/s │
│ 1   7 113  34  20 040d Y ││                                                 │
│ 2   8  37   0   9 040c   ││LTP Pos: xxx.xxxxxxxxx°  xxx.xxxxxxxx°   xxxx.xxm│
│ 3  11  50  17  13 0404   ││LTP Vel:    0.00m/s  83.1°  -0.02m/s             │
│ 4  13 287  52  16 040d Y ││                                                 │
│ 5  15 307  25  29 070d Y ││Time: 39 03:56:20.00                             │
│ 6  17 180  55  21 040d Y ││Time GPS: 2095+338378.000     Day: 3             │
│ 7  18 194  31   0 0014   ││                                                 │
│ 8  19 194  31  32 070d Y ││Est Pos Err   8.48m Est Vel Err   0.00m/s        │
│ 9  28 346  70  11 040d Y ││PRNs: 10 PDOP:  1.8 Fix 0x03 Flags 0xdd          │
│10  30  93  66  23 040d Y │└─────────────────── NAV_SOL ─────────────────────┘
│11 193 305   6  16 040d Y │┌─────────────────────────────────────────────────┐
│12  65 246  27  26 060d Y ││DOP [H]  1.1 [V]  1.5 [P]  1.8 [T]  1.1 [G]  2.1 │
│13  66 315  21  21 0404   │└─────────────────── NAV_DOP ─────────────────────┘
│14  72 206   8   0 0004   │┌─────────────────────────────────────────────────┐
│15  73  91   4   9 0404   ││TOFF:  0.141409385       PPS:  0.032935624       │
└────── NAV_SVINFO ────────┘└─────────────────────────────────────────────────┘
f121400001fc2000000000013130d07201fc200b3ffffff0f1c0d040b465a0160020000011e0d0417425d008200000008c10d041006310152fbffff00410d061a1bf600b10000000942040415153b0100000000ff4804000008ce0000000000024904040904
5b0000000000064a04010024440000000000034b0d0411345601e9ffffff124c04030b10290100000000ff540400002431000000000005550401002e830000000000ff5604000007b00000000000ff5a04000007b000000000005a20
(292) b56201351c01702d2b14011700000001121252000000141200000007142271009d001c190000000809002500ef0214190000000b0d113200000014120000000d10341f0111001c190000000f1d193301f5ff1f19000000111537b40016001c1900000
012001fc2000000201a00000013201fc200f8ff1f190000001c0b465a013d001c190000001e17425d000d001c19000005011006310188ff1c19000006011a1bf60012001e190000060215153b0100001412000006080008ce00000010120000060909045b00
000014120000060a00244400000011120000060b11345601feff1c190000060c0b1029010000131200000614002431000000101200000615002e830000001112000006160007b000000010120000061a0007b000000010120000d15d
(28) b56201011400702d2b14d94c0ef0439644e68fd1eb1651030000cd10
(26) b56201041200702d2b14d100b4006b009200690046004f007353
(28) b56201111400702d2b140100000001000000ffffffff0200000002d2
(24) b56201201000702d2b14fce7fdff2f0812070f0000004ba6
(20) b56201320c00702d2b1400000000000000001b37
------------------- PPS offset:  0.032960910 ------
(60) b5620106340058312b1420e7fdff2f0803ddde4c0ef0429644e68ed1eb16510300000100000001000000ffffffff02000000b400020a4a6403006c5e
(100) b56201075c0058312b14e4070304153b11370f00000023e7fdff0301ea0ab95a69b7c7463e16975500001aca000003120000d61b000001000000040000001700000004000000fa37a6011200000044131700b40000004a64230000000000000000002
a14
(28) b5620101140058312b14de4c0ef0429644e68ed1eb1651030000bcb8
(26) b5620104120058312b14d100b4006b009200690046004f005fe7
(28) b5620111140058312b140100000001000000ffffffff02000000ee3e
(24) b5620120100058312b1420e7fdff2f0812070f0000005b12
------------------- PPS offset:  0.032952623 ------
================================================
PPS driver code:

static irqreturn_t core100_pps_handler( int irq, void* data )
{
    struct core100_pdev_drvdata* p_pdev_info = ( struct core100_pdev_drvdata* ) data;
    struct pps_event_time ts;
    pps_get_ts( &ts );
    pps_event( p_pdev_info->pps_source, &ts, PPS_CAPTUREASSERT, NULL );
    return IRQ_HANDLED;
}

static int core100_register_pps( struct core100_pdev_drvdata* p_pdev_info )
{
    static struct pps_source_info core100_pps_info = {
        .name = "core100",
        .path = "",
        .mode = PPS_CAPTUREASSERT | PPS_OFFSETASSERT | PPS_ECHOASSERT | PPS_CANWAIT | PPS_TSFMT_TSPEC,
        .owner = THIS_MODULE,
    };
    int rv;
    p_pdev_info->pps_irq = platform_get_irq( p_pdev_info->pdev, 0 );
    p_pdev_info->pps_source = pps_register_source( &core100_pps_info, PPS_CAPTUREASSERT | PPS_OFFSETASSERT );
    rv = devm_request_irq( &p_pdev_info->pdev->dev, p_pdev_info->pps_irq, core100_pps_handler, IRQF_TRIGGER_RISING | IRQF_TIMER, p_pdev_info->name, p_pdev_info );
    if ( rv )
    {
        printk( KERN_ERR KBUILD_MODNAME ": %s(%s): devm_request_irq(%d) failed: %d\n", __func__, p_pdev_info->name, p_pdev_info->pps_irq, rv );
    }
    return rv;
}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]