[ntp:questions] NTP on embedded Linux with GPRS connection

mass85 at tlen.pl mass85 at tlen.pl
Wed Nov 23 16:06:28 UTC 2011


I have Linux running on ARM. System has GPRS connection to internet,
which is slow and unreliable (sometimes it is very hard to establish
it, that's probably GSM operator's fault).

What I want to achieve is:
1. set time as precisely as possible at Linux startup, before my
applications are started (note that system could have been down for a
few days)
2. maintain small offset in a long term even if I establish connection
with Internet only twice a day for not very long period of time (let's
say 30minutes, but can be longer if necessary)
3. never step clock when my applications are running, only slew it

The first goal I can achieve in two ways I can think of:
- connect to Internet before applications are started, run "ntpdate -
b"
- use hwclock --adjust. So after ntpd synchronises the time, I would
have to issue "hwclock -w -u" and repeat it after at least 24h, so
hwclock can estimate the drift. Then repeat this process.
There is a big drawback of the former solution: connection setup can
last long and we don't have any guarantee that we will finally
connect. The latter solution is probably not very accurate and I
wonder if ntpd could not issue hwclock command in the right moment?
Is ntpd able to apply proper clock adjustment at Linux startup without
connecting to Internet based on the results of synchronisation before
system reboot?

Are all three goals achievable together?

Regards
Marcin Adamski



More information about the questions mailing list