gpsd-dev
[Top][All Lists]
Advanced

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

Re: [gpsd-dev] U-Blox M8, PPS and NTPsec - GPSd logic enhancement


From: Martin Boissonneault
Subject: Re: [gpsd-dev] U-Blox M8, PPS and NTPsec - GPSd logic enhancement
Date: Fri, 5 Apr 2019 18:52:23 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Hi!

I'm getting used to a new email program on my machine. My quotes are not the best, I'll try to make them more readable.

On 2019-04-05 18:05, Gary E. Miller wrote:
Yo Martin!

On Fri, 5 Apr 2019 17:48:14 -0400
Martin Boissonneault <address@hidden> wrote:

While writing this reply and applying your recommendations, my
issues with GPSd being offset by one second continued.
It would be helpful if you said what you changed, and what the
results were.  You had a lot to change, yet you say nothing about
your new ntp.conf, or where SHM(2) is coming from.
So, in the future, be sure you answer all questions asked before
adding extra info.

So: what is your current ntp.conf,

--- Begin ntp.conf:
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help


# --- You do need to talk to an NTP server or two (or three).
#  server ntp.your-provider.example

# LAN servers:
server 192.168.10.10 iburst maxpoll 5
server 192.168.10.11 iburst maxpoll 5 prefer

# Official Canadian gov NTP servers (Stratum 2)
server time.nrc.ca iburst
server time.chu.nrc.ca iburst

# Pool:
pool ca.pool.ntp.org iburst
pool us.pool.ntp.org iburst
pool north-america.pool.ntp.org iburst
#pool pool.ntp.org iburst

#pool debian.pool.ntp.org iburst
pool planefinder.pool.ntp.org iburst


# --- Kernel-mode PPS reference-clock for the precise seconds
#       time1 time - Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
#       time2 time - Not used by this driver.
#       stratum number - Specifies the driver stratum, in decimal from 0 to 15, with default 0. #       refid string - Specifies the driver reference identifier, an ASCII string from one to four characters, with default PPS.
#       flag1 0 | 1 - Not used by this driver.
#       flag2 0 | 1 - Specifies PPS capture on the rising (assert) pulse edge if 0 (default) or falling (clear) pulse edge if 1. #       flag3 0 | 1 - Controls the kernel PPS discipline: 0 for disable (default), 1 for enable. #       flag4 0 | 1 - Record a timestamp once for each second if 1. Useful for constructing Allan deviation plots.
#refclock pps unit 0 flag2 0 flag3 0 refid kPPS minpoll 0

# --- Shared memory reference-clock
# Starting with ntp-4.2.5p138, don't use minpoll 4/maxpoll 4
#       time1 time - Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. #       time2 time - Maximum allowed difference between remote and local clock, in seconds. Values <1.0 or >86400.0 are ignored, and the default value of 4hrs (14400s) is used instead. See also flag 1. #       stratum number - Specifies the driver stratum, in decimal from 0 to 15, with default 0. #       refid string - Specifies the driver reference identifier, an ASCII string from one to four characters, with default SHM. #       flag1 0 | 1 - Skip the difference limit check if set. Useful for systems where the RTC backup cannot keep the time over long periods without power and the SHM clock must be able to force long-distance initial jumps. Check the difference limit if cleared (default).
#       flag2 0 | 1 - Not used by this driver.
#       flag3 0 | 1 - Not used by this driver.
#       flag4 0 | 1 - If flag4 is set, clockstats records will be written when the driver is polled.

# GPS PPS reference (Only one will be present)
#refclock shm unit 1 refid gPPS minpoll 0 maxpoll 8 prefer
#refclock shm unit 2 refid gPPS minpoll 0 maxpoll 8 prefer
refclock shm unit 1 refid gPPS prefer
refclock shm unit 2 refid gPPS prefer

# GPS Serial data reference (NTP0)
#refclock shm unit 0 refid GNSS flag1 0 time1 0.0 minpoll 0 maxpoll 8 stratum 10 noselect #refclock shm unit 0 refid GNSS flag1 0 time1 0.025 minpoll 0 maxpoll 8 stratum 10 noselect
# stratum 10


# --- GPSD Coarse time reference-clock - nearest second
#refclock gpsd unit 0 refid GPSd time1 0 time2 0.0 minpoll 0 maxpoll 8 stratum 10 noselect #refclock gpsd unit 0 refid GPSd time1 0 time2 0.025 minpoll 0 maxpoll 8 stratum 10 noselect

# ----------------------------------------------------------------------------- # Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for # details.  The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration # that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.

# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery limited
restrict -6 default kod notrap nomodify nopeer noquery limited

# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1

# Needed for adding pool entries
restrict source notrap nomodify noquery

# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust
restrict 192.168.10.0 mask 255.255.255.0 nomodify
restrict 192.168.10.10
restrict 192.168.10.11

# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255
#broadcast 192.168.10.255

# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines.  Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient


driftfile /var/lib/ntp/ntp.drift
leapfile /var/lib/ntp/leap-seconds.list
logfile /var/log/ntpd.log

# Enable this if you want statistics to be logged.
statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats protostats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
filegen protostats file protostats type day enable
--- End of ntp.conf

what is conencted to SHM(2) and SHM(2)?
Both SHM(1) and SHM(2) are from GPSd. They are the SHM related to the GNSS PPS from the offsets I see. Both are the same PPS from the GNSS attached. Only one shows up, usually SHM(2). While testing, it happened that SHM(1) would appear instead of SHM(2). For that reason, I configured both in ntp.conf, knowing only one was active at a time.

I also have SHM(0) from GPSd, and that one jumps ~100ms every 45 minutes. I assume SHM(0) is from the serial messages. It's disabled.

I found that
adding NAV-TIMEGPS was fixing the 1 second offset. I've tried it many
times, and disabling NAV-TIMEGPS and stop/start GPSd gets SHM(2) off
by one second. Enabling back the message and stop/start GPSd and time
is good! Odd...
All you are doing is moving the sentences around.  That can be good or
bad as it affects the parser trying to unroll things.
Just trying to get it not marked as a falseticker :-/

I wrote the following reply to reflect the state of my configuration
after testing. GPSd + NTPsec are currently working properly.

The currently enabled messages + sequence:
21:16:31  R -> UBX NAV-SOL,  Size  60,  'Navigation Solution'
21:16:31  R -> UBX NAV-TIMEGPS,  Size  24,  'GPS System Time'
21:16:32  R -> UBX NAV-SOL,  Size  60,  'Navigation Solution'
21:16:32  R -> UBX NAV-SAT,  Size 388,  'Satellite Status and
Information'_*EVERY 5 SECONDS*_
21:16:32  R -> UBX NAV-TIMEGPS,  Size  24,  'GPS System Time'
21:16:33  R -> UBX NAV-SOL,  Size  60,  'Navigation Solution'
21:16:33  R -> UBX NAV-TIMEGPS,  Size  24,  'GPS System Time'
And how did you set that configuration?  With gpsctl, or ubxtool,
defaults, or?

I configured the u-Blox M8 manually using u-Center on Windows. I monitored the output from cgps while doing so to see if the message was decoded or not and how GPSd reacted to it.

When GPSd was first installed, it was disabling Galileo and Glonass after a while. I now use a jumper to prevent GPSd from reconfiguring the GNSS. To change the configuration, I connect my serial-USB adapter and change what I want with u-Center. GPSd can't modify my settings without me putting the jumper back. I'm just trying to keep the minimum messages while having Galileo and Glonass active.

That is certainly not what gpsd expects, and thus
untested and likely suboptimal.

OK, then I must ask what does GPSd expect?

We can't really support configurations that are not well tested
and part of our regressions.
I don't mind giving full GNSS control back to GPSd, but then, why was it disabling Galileo and Glonass?


ntpmon:
       remote           refid      st t when poll reach delay
offset jitter
Too early to look at ntpmon, your pool servers not running yet.

Well, they where up, and after a while, they where released. NTPd picks the best and drops the unneeded extras? The server ntp3.torix.ca is from the pool.

Right now:
     remote           refid      st t when poll reach   delay offset   jitter
 win7mbt-lt_eth. .INIT.          16 u    -   32    0 0ns      0ns    954ns
 lenovowin7-pc_e 192.168.10.101   2 u   30   32  377 437.94us -371.7us 401.35us +time13.nrc.ca   132.246.11.233   2 u   61   64  377 6.4964ms 211.12us 925.66us -time1.chu.nrc.c 209.87.233.50    2 u   11   64  377 29.326ms 994.86us 10.630ms
 ca.pool.ntp.org .POOL.          16 p    -  256    0 0ns      0ns    954ns
 us.pool.ntp.org .POOL.          16 p    -  256    0 0ns      0ns    954ns
 north-america.p .POOL.          16 p    -  256    0 0ns      0ns    954ns
 planefinder.poo .POOL.          16 p    -   64    0 0ns      0ns    954ns
 SHM(1)          .gPPS.           0 l    -   64    0 0ns      0ns    954ns
*SHM(2)          .gPPS.           0 l   57   64  377 0ns     14ns    139ns
+ntp3.torix.ca   .PTP0.           1 u    4   64  377 10.198ms 144.95us 613.39us ntpd ntpsec-1.1.3+ 2019-04-02T18:41:39Z        Updated: 2019-04-05T17:18:54 (1)
 lstint avgint rstr r m v  count rport remote address
      0  0.072    0 . 6 2  83744 53354 localhost
      4     63  1c0 . 4 4     96   123 ntp3.torix.ca
     11     26    0 . 3 4    234   123 lenovowin7-pc_eth.ve2mrx
     11     63  1c0 . 4 4     96   123 time1.chu.nrc.ca
     61     63  1c0 . 4 4     95   123 time13.nrc.ca
   5333     45  1c0 . 4 4     16   123 69-165-173-93.dsl.teksavvy.com
   5337     45  1c0 . 4 4     16   123 atl0.jane.mattnordhoff.net
   5339     45  1c0 . 4 4     16   123 ns1.baxterit.net
   5341     45  1c0 . 4 4     16   123 207.34.49.172 (vm-baxter.racknine.net)
   5342     45  1c0 . 4 4     16   123 time.no-such-agency.net

Martin




reply via email to

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