[Top][All Lists]

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

Re: [gpsd-dev] gpsdate program, similar to 'ntpdate'

From: C.J. Adams-Collier
Subject: Re: [gpsd-dev] gpsdate program, similar to 'ntpdate'
Date: Thu, 20 Jun 2013 15:56:00 -0700

I hear ntpdate has been deprecated long time and obsoleted in new releases.

Try ntpd -q

On Jun 20, 2013 2:16 PM, "Harald Welte" <address@hidden> wrote:
Hi all,

recently I discovered what I considered a severe shortcoming in the
combination of using gpsd + ntp[d] on embedded systems without RTC:

While ntpd is very happy to use a local gpsd as source, 'ntpdate'
exclusively works with NTP-based time servers.

This means, during system boot, with no half-way valid clock at all,
ntpd will receive the time from gpsd, but will refuse to adjust the
clock by years in difference.  On the other hand, ntpdate will not even
work with the shared memory gps driver, i.e. the time will never be set
correctly, and ntpd will never get into a state where it can do
fine-grained syncing against GPS.

To resolve the problem, I wrote a small tool called 'gpsdate', which can
be used as 'ntpdate' replacement in boot scripts:  It connects to GPSD,
waits until a valid time has been received, and then uses settimeofday()
to set the local clock.  After that, it terminates and leaves future
fine-grained synchronization to ntpd.

The tool can be found in its git repository at "git clone
git://".  I've attached the only source code
file for your convenience to this message

I would appreciate if it could become part of either the gpsd or ntpd
source trees.  Releasing it under the license of the respective original
software project (instead of GPLv2+) is no problem at all.

First I'd like to get review from the ntpd and gpsd maintainers if any
of the two (and if so: who!) would want to merge it.  My personal bias
is towards gpsd, as it depends on libgps and has no NTP dependencies.


- Harald Welte <address@hidden> 
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)

reply via email to

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