nmea refclock not locking to the pps

Gary E. Miller gem at rellim.com
Mon Mar 6 23:10:00 UTC 2017


Yo Tony!

On Sat, 4 Mar 2017 17:29:56 -0800
"Tony Hain" <tony at tndh.net> wrote:

> > Which sounds similar to the problem you now report on the nmea
> > driver. Just with fewer tools to use.  And by gpsd, I hope you mene
> > the SHM driver, not the flakey gpsd-ng driver.  
> 
> Flakey doesn't even begin to describe it:
> # gpsmon
> gpsmon:ERROR: SER: device open of tcp://localhost:2947 failed: No
> such file or directory - retrying read-only

Odd, something wrong with your setup.  My gpsd is working fine
on IPv6:

tcp6       0      0 ::1:2947                :::*                    LISTEN      25354/gpsd          

BTW, I never use gpsmon.  I much prefer cpgs.  Many tools in the gpsd
basket.  Try another one.  Or just tell gpsmon to use ipv4:
    gpsmon 127.0.0.1



> So, yes the SHM driver is the one I have been testing and it is not
> playing well with ntpd. 

Odd, I have been using that on large numbers of hosts for well over a
decade with no issues.  Many others as well.  Care to elaborate?

> > I doubt it is a driver issue, my guess is that it is a dice toss
> > thing. With your setup NTP, of either flavor will lock onto the
> > wrong source now and again.  
> 
> I would buy that if it weren't a consistent behavior where the
> ntp-sec nmea driver is off by > 10x the offset shown by the 4.2.8p9
> nmea driver, because other than  the refclock xxx / server
> 127.127.x.x syntax issues, the config is identical. 

Identically bad.

> > Your expectations do not match mine.  That looks bad to me and is
> > fixable.  
> 
> That is the flag1 0 configuration where the nmea stream has no
> reference to the top-of-second mark, so any variance in the start of
> transmission will show as an offset from ntp time.

Which is why 'prefer'ing it is a bad idea.

> > Looks fairly good.  My experiments on RasPi 3 shows that
> > minpoll=maxpoll=2 will give best results.  
> 
> I can't find anyplace in the code that actually specifies what the
> range is,

Lost me, range of what?  You mean poll?  It is documented as one
to I think 2048.  Anything past 8 is just wrong for PPS.


>  but for 15+ years the documentation has said that the
> minimum is 4,

Im pretty sure the RasPi is not that old.  minpoll is very
host specific.

> but my experimentation has always shown that the
> minimum is 3.

I did a series of experiments, documented on devel at ntpsec.org list. 
They showed poll =1 or poll =2 is clearly better, depending on what you
are optimizing.  Check the list archives.

The other reason to set poll low is so that ntpd will lock onto the
PPS before is has the chance to be mislead by other clocks.

> I understand that. The pps driver says it is disabled unless there is
> a preferred server in the surviving set, or when another driver is
> tracking pps. When I make the nmea driver the only preferred option,
> the pps driver drops out because when the nmea driver is flag1 0, its
> offset is so large that it becomes a false ticker so there are no
> preferred survivors, and with flag1 1 the nmea driver takes over the
> pps tracking. 

Right, so don't do that!

> Right now the configuration is SHM :::
> refclock shm unit 0 refid GPS time1 0.4429166667

If your offset is really 442 milli Sec than that is a really bad time1.

> refclock shm unit 1 refid PPS prefer minpoll 3 maxpoll 3 time1
> 0.000000337160

Close, minpoll and maxpoll will do better at 2.

Where is your 3rd chimer?  Having just 2 is bad.

> # ppsapitest  /dev/pps0
> 1488676128 .949531317 451379 0 .000000000 0

Not useful until you say how long it has been running.

really better if you present an ntpviz URL.

> Starting gpsd -D 5 shows :::

Whoa!  Huge red flag!

Mar  4 16:52:22 tic gpsd[31863]: gpsd:WARN: KPPS:/dev/pps0 kernel PPS unavailable, PPS accuracy will suffer

No point continuing until that is fixed.


> That is a problem. Until the recent changes, on FreeBSD I would have
> said you could look in rc.conf to find out which ntp.conf is being
> used, but someone decided to make that concise location as
> diversified and difficult as linux ...  ;(

NTPsec runs on way more than FreeBSD, and Linux.  And even on Linux the
ntp.conf file has at least 10 different locations that I can name off
the top of my head.  And no preferred order of searching!  For example
Gentoo supplies a large number configs in a config directory and starts
ntpd using one that matches the local configuration.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/bugs/attachments/20170306/c7d3caee/attachment.bin>


More information about the bugs mailing list