| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Outide of one Mac portability shim, anyway. Associated select(2) calls
become pselect(2) calls.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the Linux kernel is built with CONFIG_PPS_CLIENT_KTIMER=y, then a
synthetic PPS source is added to allow testing without a real PPS
source. However, this source doesn't even run at exactly 1Hz, so any
attempt to use it for real time synchronization is disastrous.
To make matters worse, this is usually the first PPS driver
configured, causing it to appear as /dev/pps0, which is the implied
PPS device used by the "Magic HAT" kludge.
This change adds detection for the fake source (based on its name),
both to provide a warning if it is configured explicitly, and to skip
over it when applying the "Magic HAT" kludge.
TESTED:
Tested both gpsmon and gpsd on a Beaglebone Black with added symlinks
for testing "Magic HAT". Did this with kernels with and without the
KTIMER enabled. Verified that the proper PPS device is selected by
"Magic HAT", and that a warning is generated when expected.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a build option called 'magic_hat', and makes the code for
MAGIC_HAT_GPS and MAGIC_LINK_GPS conditional on it. It currently
defaults to True on Linux and False otherwise. It's meaningless on
non-Linux platforms, though at present there are no
conditionally-present options, so this one is also present on all
platforms.
TESTED:
Tested on a Beaglebone Black with suitable symlinks added (and running
a kernel with PPS_CLIENT_KTIMER turned off. Verified that the kludge
behaves as intended when enabled, and is inoperative when disabled.
|
|
|
|
|
|
|
|
|
| |
149f329e ("ntpd uses precision as a floor, so do not be conservative.",
2016-10-10) changed the log output of "pps" or "clock" to the numeric
precision without also updating the gpsd_log() format string, causing
a SIGSEGV when running with -D4 or above.
Signed-off-by: Beat Bolli <dev@drbeat.li>
|
| |
|
|
|
|
| |
precision -20 is 1 micro Sec, -30 is one nano sec
|
| |
|
|
|
|
|
|
| |
When FreeBSD turns on POSIX it disables BSd extenstions, with no
possible workaraound. So just don;t ask for POSIX when then
insanity becomes visible.
|
| |
|
| |
|
|
|
|
| |
vsnprintf() and strlcmp() are happier now.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
When a serial device to be opened is /dev/ttyAMA0, and /dev/pps0 exists,
and we have read-write access to it (which implies running as root),
substitute /dev/pps0 for the device name in the thread context so we
use KPPS.
Should be safe because /dev/ttyAMA0 is so specific to the Raspberry Pi.
|
|
|
|
|
| |
NTPTIME is from the serial stream, it never had anything to
do with PPS and it just confused everyone.
|
|
|
|
|
|
|
|
|
| |
This applies to not just PPS, but all NTP reportable
time. Even with a valid fix, the frist 3 times may be off.
Don't send bad time to ntp/chrony.
Move the definition into gpsd.h to be widely available not
depending on scons options.
|
| |
|
|
|
|
|
|
|
|
| |
...to mark that the device has a good time even if it does not report
a position fix. Used by the OnCore driver, e.g. when in position hold
mode.
scons check passes
|
| |
|
| |
|
|
|
|
| |
Only once a second.
|
|
|
|
| |
This makes it easy to pick oout the time logs. Along with PPS:
|
|
|
|
| |
/dev/pps0 actually seems to work.
|
|
|
|
|
|
| |
/dev/pps0 now ships time to NTP SHM. Very wrong time...
last_fixtime is all wacky...
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Instead, pass out real time of last PPS as it was actually seen. We can then
correct it using the device's actual cycle time.
The correction currently only works for cycle times that are integral
multiples of a second.
|
|
|
|
|
|
| |
Remove the wrap hook. The only thing it was doing was closing the chrony fd.
which can be done just as cleanly by whatever calls the pps_thread_deactivate()
function.
|
|
|
|
|
|
| |
With a bit of refactoring we can eliminate one of the hooks.
PPS observed live, telnetting to localhost:2947 with gpsd running.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The proximate cause was that we've been seing emission of error
messages that were randomly and disturbingly variable across different
environments - notably Raspbian and Gentoo splint gave nontrivially
different results than Ubuntu 14.10 splint. And this was *not* due to
Ubuntu patches! A pristine splint built from the 3.1.2 tarball on
Ubuntu didn't match the Raspbian and Gentoo results either.
But this has been coming for a while. Easy access to more modern
static analyzers such as coverity, scan-build and cppcheck has been
decreasing the utility of splint, which is unmaintained and somewhat
buggy and not easy to use.
Only file not cleaned is ppsthread.c, because Gary has been working
on it during this cleanup.
All regression tests pass. PPS observed live on GR601-W.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
With more than one PPS thread going at a time hard to know
which is which without help.
Also remove restriction that devicename is a tty since /dev/ppsX is
not a tty.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Same fix as in ntpshmwrite.c. GPS may notify about upcoming
leap second long before NTP can handle it. So limit leap notify to
months of June and December.
Per Hall Murray and http://bugs.ntp.org/1090
|
| |
|
|
|
|
|
|
| |
It's not used on the client side, and it's needed separately for ntplib.
All regression tesrs pass. PPS is live.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the big step towards ntplib. A couple of minor issues remain to be
ironed out, the most significant of which is what to do about the timestamp_t
type.
This changes some field offsets of private fields in struct gps_device_t.
Probably does not require a version bump as access to them is all through
the libgpsd API.
All regression tests pass. PPS observed live in gpsmon direct mode.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change is done so we can add a "log" hook to the pps_thread_t
structure (this is not done yet) and harmonize with the name of the
outer logging function. If that name had been left as gpsd_report()
there would have been scope for bad confusion with the report_hook
member.
Also, remove two stray duplicative printf calls from the NMEA2000 driver
(drivers shouldn't have printfs!) and fix one typo.
This is a step towards factoring out ntplib. For that to happen, the
PPS thread code needs to be decoupled from the core session structure.
No logic changes. Object compatibility preserved. All regression tests pass.
|
|
|
|
|
|
|
|
|
|
|
| |
No logic changes, though it looks like there are two because two guards
that would always have failed when the code was compiled with pps=off
are now conditioned out. Also, this code is offset-preserving
so as not to break link-time compatibility of libgpsd.
(This is the subtler approach...)
All regression tests pass.
|
|
All knowledge of the ntpd SHM format is now confined to the three
files ntpshm.h, ntpshmread.c, and ntpshmwrite.c.
No logic changes. All regression tests pass. PPS works on GR-601W.
|