[Top][All Lists]

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

[gpsd-dev] gpsd for time sync on Ubuntu remix too hard for normals - how

From: Greg Troxel
Subject: [gpsd-dev] gpsd for time sync on Ubuntu remix too hard for normals - how to improve?
Date: Fri, 03 May 2019 10:25:03 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (berkeley-unix)

* introduction

[This is just where I'm coming from, not really relevant.]

In June, amateur radio operators do "Field Day", an operating event
which is three things at once:
  - emergency preparedness exercise (so no commercial power, no
    permanently-installed station facilities)
  - contest (talk to as many other stations as possible)
  - cookout

This year, a digital mode called "FT8" will be used, and it requires
more-or-less sub-second time sync so the parties agree on where a ~13s
transmission belongs.

The FD rules do not prohibit the use of the internet and the cell
network to obtain time sync, but given that you can't use commercial
power (basically everybody is on generator and solar, a bit of wind),
and you can't use any antennas or other things that are already there
(antennas are basically all erected the day before).  I think the rules
should prohibit Interent use, and it seems highly bogus to use NTP over
the Internet, which presumably might not be there in an emergency.

So, after saying my club should do this right, I had to volunteer to
make it work.  I have a shiny new $20 multiconstellation receiver for FD
use, so we can sync to BeiDou and Galileo too.

The person providing the FT8 station is planning to use CentOS.  So I am
setting up an old laptop with an Ubuntu-ish remix for ham radio ("Andy's
Ham Radio Linux"), because it has a lot of ham software already, and
because Ubuntu seems relatively normal, perhaps even the standard
approach within GNU/Linux.  The distribution I'm using is basically
Ubuntu 18.04, with a bunch of PPAs preconfigured and the ham packages on
the iso, installed by default.  On it I am setting up gpsd/ntpd, so it
can get time sync without a network.

* -n, systemd

I installed "Andy's Ham Radio Linux", basically Ubuntu 18.04 on a
2008ish MacBook.  (I then installed "gpsd-clients", which wasn't there
by default.)

I configured ntpd to use the two shm instances for GPS and PPS.

I plugged in a USB GPSr (GR-601W, with PPS) and booted.

I see that systemd is listening on gpsd's port, and gpsd is not running.

I started up xgps.  I saw the "gpsd 3.17" line but no sat positions, no
nav solution, even after a while.   I noticed that gpsd was running with
no flags (no -n, no ttyUSB0).

After killing gpsd and trying to start it, I realized systemd was
listening.  So I did "service stop gpsd", and was able to run gpsd with
-n, -N, -D, and /dev/ttyUSB0.  Then xgps reported a position.

I restarted ntpd, which may or may not have been necessary, and am
seeing small offsets from both GPS and PPS.  (Amusingly, they are both x
because there are no other sources and they are 100ish ms apart, but
that's not why I'm writing.  After adjusting the non-pps fudge, it's

As I understand it, the hotplug system is supposed to fire up gpsd when
a USB GPSr is plugged in.  Or perhaps gpsd is running always and it's
supposed to gpsdctl add the GPSr.  But, I wonder if this is expected to
work for NTP?  Without -n, it seems it will not work.

The Time Service HOWTO does not talk about systemd, although it does
mention that -n is needed for gpsd.  So it seems that to run NTP on
ubuntu, one has to:

  add the shm lines to ntp.conf (easy)

  decide to avoid the hotplug scheme
  tell systemd not to start gpsd
  add a way to start gpsd with -n on boot or insertion
in order to have the system boot up and work.

(Or build gpsd with timeservice=yes, but I'm trying to help people
configure distributions easily without having to become gpsd experts,
not asking them to build things from source.)

Am I confused, or did I get this right?

* thoughts

It should be easy for someone to setup up a system so that gpsd/ntpd
works on boot.  I'm not sure of the way forward.

Ideally, particularly for a ham remix, but in general, things would
default so that if one plugs in a USB GPS that has PPS, ntp would sync
to it without extra config.

It seems that the main barrier to having this work is the defaulting to
non -n.

While I know we look down on non-PPS time sync, being synced to 50 ms is
vastly better than not being synced at all.  And, for operating FT8 off
the grid, totally adequate.   It seems easy enough to calibrate out the
usual delay when on the net and have a fudge configured for offline use.

Realistically, given the offset from the non-PPS sync, I don't see it
being workable as a default.  But it could be a high stratum with a 100
ms guess, so that it takes over with no other sources.  I realize this
is likely controversial and for specific situations, so please take it
as musing rather than recommendation.

reply via email to

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