gpsd-dev
[Top][All Lists]
Advanced

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

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


From: Terje Mathisen
Subject: Re: [gpsd-dev] gpsdate program, similar to 'ntpdate'
Date: Wed, 26 Jun 2013 08:50:36 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0 SeaMonkey/2.17.1

Ed W wrote:
On 21/06/2013 08:17, Harald Welte wrote:
Hi C.J.,

On Thu, Jun 20, 2013 at 03:56:00PM -0700, C.J. Adams-Collier wrote:
I hear ntpdate has been deprecated long time and obsoleted in new
releases.

Try ntpd -q
I have tried this long ago, and would be happy if things would have been
that simple.

ntp_refclock:refclock_process_f() calls libntp:clocktime() and the
latter aboslutely cannot deal with the fact if e.g. your embedded
system without RTC boots up assuming it is January 1st 1970 and a GPS
reference time in the year 2013 has been received.

I looked into fixing the ntpd/libntp code some months ago, but gave up
as it seems to be written on the assumption that there simply are not 43
years of difference between two timestamps.

ntp-dev was updated a few years ago to allow the maximum possible gap (i.e. 2^31 seconds or 68 years) during startup.


Having said that, I'm clearly not a ntpd expert and happy to try
whatever method people suggest here.  But after lots of debugging and
ntp source code reading I arrived at the conclusion that it is not
possible using the existing code, which prompted the implementation of
gpsdate.



I don't have this problem with Chrony when my board boots up with 2000
as the date... However, I haven't tested with wider than 13 year gap.

As has been noted here, the current ntp-dev code also has logic to assume the time is within 68 years of the time when the binary was compiled.

This is actually a _very_ safe assumption imho. :-)

Terje

Also I use gentoo on these boards and the service "swclock" which
implements a weak monotonic clock source by setting the initial clock to
match some file on the filesystem. Touch this file as often as you wish
to get the initial clock as for forward in time as you wish.  The main
goal is simply that the clock doesn't move (to far) backwards in time
rather than it's accurate

Ed W




--
- <address@hidden>
"almost all programming can be viewed as an exercise in caching"



reply via email to

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