Commit Graph

13 Commits (master)

Author SHA1 Message Date
Oliver Smith 68bcf620b4 Fix build against gpsd >= 3.20
The previous version was written against gpsd 3.10. This also makes the
date more precise, previously microseconds were set to 0.

GPSD_API_MAJOR_VERSION is defined in gps.h, together with a changelog:

Use Pau's compat_gps_read() from:

Related: SYS#6222
2022-12-14 19:25:01 +01:00
Harald Welte d59eb51be6 gpsdate: Discard gpsd reports when no fix or no satellites used
We've observed several times that GPS receivers would report a wrong
time/date directly after boot, probably assuming that their RTC is

Let's wait until the receiver reports it has a fix and reports actual
satellites were used to compute it.
2019-08-17 12:54:24 +02:00
Holger Hans Peter Freyther cb50b4bb9f Add an option to not fork and use it
For systemd it is better to not fork. Add an option for that.

Fixes: SYS#1152
2015-02-14 23:31:25 +01:00
Harald Welte 019d2535b6 Allow user to specify a non-standard gpsd port
.. which is required on the ODU.
2014-12-20 15:46:56 +01:00
Harald Welte 75cbc3d0e5 Allow configuration of number of retconnect-attempts/interval 2014-12-20 15:44:30 +01:00
Harald Welte c77a9b3342 reconnect to gpsd if it disappears while we wait for fix/time
In some cases, gpsd might die while we are waiting to receive a valid
fix/time information.  In that case, we have to reconnect to gpsd
again and again, until a valid time has been received (and set as
system clock).
2013-10-14 10:39:34 +02:00
Harald Welte cb65bc5348 avoid using 99% CPU in case gpsd dies
This addresses and issue when gpsdate is running and the gpsd will be
killed (testing coredump handling).

The issue is within the libgps cod itself that doesn't handle the
result(0) of the recv syscall correctly and keeps on looping. Now in a
normal system gpsdate should only execute at the beginning and exit once
there is a date. So the window for this runtime failure is quite low.

Bug reported by Holger Freyther.
2013-08-29 17:12:25 +02:00
Harald Welte 58e3cdeb19 run until we receive valid GPS timestamp 2013-04-10 15:15:35 +02:00
Harald Welte 4ad6c932c9 daemonize after gpsd connection is established; gps fix might take time 2013-04-10 14:06:25 +02:00
Harald Welte 3b870221a9 gpsdate: log the actual time that was set to the RTC. 2013-04-10 12:23:16 +02:00
Harald Welte f56f16539b use syslog() for reporting errors and status 2013-04-10 12:16:33 +02:00
Harald Welte a1aa41e813 perform up to 60 attmepts to re-connect to gpsd and print more status 2013-04-10 12:11:12 +02:00
Harald Welte 346b5d00a9 initial checkin of 'gpsdate' program 2013-04-10 10:47:19 +02:00