[ntp:questions] Pi 4 and Ultimate hat weirdness

Gary E. Miller gem at rellim.com
Tue Jan 26 18:55:43 UTC 2021

Yo Jim!

On Mon, 25 Jan 2021 14:04:58 -0800
Jim Pennino <jimp at gonzo.specsol.net> wrote:

> > What versions of gpsd and xgps?  
> gpsd -V
> gpsd: 3.17 (revision 3.17)

3.17 is from 2017.  More than a few bugs and improvements since then.

> ntpd --version
> ntpd 4.2.8p12 at 1.3728-o (1)

We prefer NTPsec, our sister project here, but that s/b OK.

> > From your distro of from source?  
> Distro, totally up to date.

You may be up to date with your distro, but your distro is not up to 
date with gpsd.

> > Did xgps give any warnings on the command line when started from the
> > command line?  
> xgps
> Gtk-Message: 13:45:00.966: Failed to load module "canberra-gtk-module"
> TypeError: Couldn't find foreign struct converter for 'cairo.Context'

That is easy.  You are missing at least one python dependency.  That
is a bug you need to report to your distro as your package manager should
have dealt with that.

> Makes me think the distro is missing a dependancy.


If you look in the gpsd INSTALL file for you distro it might tell
you the missing giles.   Here is what it says for Buster:

# apt-get install python-gi-dev python-cairo-dev
# apt-get install python-gobject-2-dev libgtk-3-dev

> > > I don't care too much about this one as AFAIK xgps is broken on
> > > Pi.  
> > 
> > Nope.  Works for me.  
> On buster?

Yes, but from source, not from a package.

> > > Second weird thing; I started the 20 driver in mode 0. ntpq showed
> > > lots of syntax errors on the $GPGGA message.  
> > 
> > Before that:
> > 
> > How are you running gpsd?  Root?  With what command line?  
> sudo systemctl start gpsd
> sudo systemctl start gpsd.socket

Oh.  systemd(umb).  I'm not allowed to help people with systemd(umbest).

But not your problem, yet.

> ps -eo euser,egroup,args | grep gps
> gpsd     dialout  /usr/sbin/gpsd -n -r /dev/ttyAMA0 /dev/pps0

Good, you have the -n and the pps0.  Commonly missed requirements.

> ps -eo euser,egroup,args | grep ntp
> ntp      ntp      /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 115:124

You may want to add -N and -g.

> > Then please copy the errors here.
> >   
> > > I changed the mode to 29 to deselect $GPGGA; no errors from ntpq.
> > > So maybe it was a satellite thing, but whatever it was, no more
> > > errors.  
> > 
> > We can only guess without seeing what you see.  
> Not a big deal to me if ignoring $GPGGA makes the errors go away.

Another guess, without data.

> The GPS has been powered up since I stuck in the battery for the
> on board RTC 5+ days ago.
> How long does it typically take a receiver to have the current leap
> second.

Certainly no longer than 30 minutes after a fix.

Slow serial port speed can also cause your problem.  Be sure you are
running at 9600, or faster.  Faster the better.

> BTW, the GPS has an external antenna with a good view of the sky
> and cgps alway shows 11+ satellites in view and always 8+ in use.

Good.  Also important that they have good SNR.

> > > Also the jitter times look high. At this moment ntpq shows:  
> > 
> > That is to be expected early on.  Don't bother to look at the
> > jitter until the offset is stable for hours.  
> Right now ntp has been running for about 18 hours.

It can take weeks.  On a lightly loaded system.  If you are running a
lot of daemones it may never improve.

Setup ntpviz.  That makes monitoring the system mmuch easier.

> > > For comparison, a GlobalSat BU-353-S4 USB GPS on a PC ubuntu
> > > system shows: *SHM(0)          .SHM.            0 l    3   16
> > > 377    0.000 -0.728   1.356  
> > 
> > Which I assume had been running for months.  
> Yes and no; the system was rebooted 4 days before.

But the adjtime file survives a reboot.  And not as good as your current

The 0.720 you see now is a start.  Now you have to check for anything that
disturbs your CPU.  Heavy loads, temperature swings, CPU speed changing, etc.

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: 851 bytes
Desc: OpenPGP digital signature
URL: <http://lists.ntp.org/pipermail/questions/attachments/20210126/6c858621/attachment.sig>

More information about the questions mailing list