Notices


Reply
Thread Tools
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#1
I have re-packaged the Debian version of the 'rdate' program for OS2007. You can use it to set the clock on the N800 from a reference time server computer, using either the RFC868 time protocol or SNTP.

It works similar to e.g 'ntpdate', although they don't always work against the same computers.

Code:
>rdate
Usage: rdate [-46acnpsv] [-o port] host
  -4: use IPv4 only
  -6: use IPv6 only
  -a: use adjtime instead of instant change
  -c: correct leap second count
  -n: use SNTP instead of RFC868 time protocol
  -o num: override time port with num
  -p: just print, don't set
  -s: just set, don't print
  -u: use UDP instead of TCP as transport
  -v: verbose output
To just check your clock against a server, use -p -v:
>rdate -p -v -n time.nist.gov
Tue Oct 30 17:59:39 MET 2007
rdate: adjust local clock by 2.046977 seconds

>rdate -p -v time-b.timefreq.bldrdoc.gov
Tue Oct 30 18:00:56 MET 2007
rdate: adjust local clock by 2 seconds

The above "-p print only" commands can be run as user. To set the clock (i.e. running without -p or with -s) you need to be root.

Note that time.nist.gov appears to support only SNTP (thus the -n), while the other one supports RFC868. (If you look at nist's website you should find a whole bunch of other reference time servers).

Very often you can also get rdate working against a local computer in your network if that one's got correct time by other means. Particularly if that computer happens to be a Unix- or Linux computer:
>rdate local-computer.your.net

The above example output was from my desktop computer. When I did the same on the N800 it was only 3 seconds off.. and I haven't adjusted the time in weeks, possibly months (I set it manually, but accurately at the time). So the N800 clock seems to be _very_ accurate, unless I got lucky for some reason. But this means that you won't have to constantly monitor and set the N800 clock, which means that it's not a problem that there's no 'cron' on the N800, and it also means that there's not much point in installing the whole 'ntp' suite, for example.

Where to find it:
http://www.box.net/shared/zaj5id7dau
(click the link and you'll see the .deb, together with some other stuff.)
Note that box.net's server doesn't set the necessary Content-Type, so if you use the N800 browser it won't automatically understand that it can be installed. You'll have to download it first.
But, as this program is _really tiny_ I'll attach it here as well: The .deb is 9KB while the installed program is only 16KB.

TA-T3
Attached Files
File Type: deb rdate_1.1.2-5_armel.deb (9.2 KB, 464 views)
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 

The Following 4 Users Say Thank You to TA-t3 For This Useful Post:
R-R's Avatar
Posts: 739 | Thanked: 242 times | Joined on Sep 2007 @ Montreal
#2
cool! thanks ... i have to use -n but it works where netdate didn't... :-)

Now, why the hell am i getting set back one hour as if the timezone change for north america was still in the old format... (oh well, only for a week
 
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#3
The US zoneinfo was old? Not good. (checking...) Ah, the zoneinfo data comes integrated with the libc package on the Nokia, instead of being in a separate 'tzdata' package as it is on desktop Debian. (checking more..) Ok so the tablet libc is an old version (as we know), and in those old versions the zoneinfo was kept in the libc package. Hopefully the libc in OS2008 is new enough that the zoneinfo is split out into a separate tzdata package -- timezone info is definitely something you want to be able to update independently of libc. Not that it needs updates often, but when it happens you really want it, and you want it now!
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 
Posts: 232 | Thanked: 32 times | Joined on Jul 2009 @ Idaho
#4
I hate to 'necropost', but my n810 is falling behind really quickly (like a minute a day), and when I use rdate -c -n time.nist.gov, it gives me:
/home/user # rdate -v -n -c time.nist.gov
Warning: error reading tzfile. You will NOT be
able to get legal time or posix compliance!
Thu Jan 7 06:10:02 MST 2010
rdate: adjust local clock by 0.011705 seconds
/home/user #
The time is updated, but the adjustment doesn't happen. I try other time servers but it seems to just lag out.. Is anyone else getting this?
 
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#5
Try this instead:
rdate -p time-b.nist.gov
rdate -s time-b.nist.gov
rdate -v time-b.nist.gov
The first one should show the difference (but not adjusting)
The second one should adjust
The third one should show that it's 0 seconds off.

I used time-b.nist.gov instead of time.nist.gov (time-b doesn't use ntp so I left out -n then) because time.nist.gov gave me that message you printed, but also didn't give enough replies to allow setting the time.
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 
Posts: 232 | Thanked: 32 times | Joined on Jul 2009 @ Idaho
#6
But I need to adjust the internal timer. I woke up today when m atomic said 5:40, my tablet said 5:34 and they were synced yesterday, so my internal clock is messed up (don't know what the timer name is)
edit: after only like 5 seconds my clock is a whole second off.
edit: rdate calls it leap second count... time-b is also throwing me:
/home/user # rdate -c time-b.nist.gov
Warning: error reading tzfile. You will NOT be
able to get legal time or posix compliance!
Fri Jan 8 06:02:19 MST 2010
/home/user #
I need to adjust that... I don't know why it's so off. Could dropping your tablet do that (in a leather tablet case?)

Last edited by Mgamerz; 2010-01-08 at 13:03.
 
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#7
My N800 is extremely accurate at all times, so I rarely do anything about the time - but there is a function which sets the hardware clock from the software/system clock, it works like this (in OS2007, I think, but ain't certain, that it's the same in OS2008):

/mnt/initfs/usr/bin/retutime --rtc-from-system

So, first set the time with rdate, then use the above command. It's the same as the 'hwclock' command on mainstream Linux, and also now Maemo 5.
EDIT: Clarify the above: On the N900 (Maemo5) the command is 'hwclock -w -u'. The 'retutime' command is for the old(er) systems.
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.

Last edited by TA-t3; 2010-05-10 at 14:46.
 
Posts: 11 | Thanked: 0 times | Joined on May 2010
#8
is there any repo with rdate or ntpdate?
 
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#9
Well, I never installed rdate into a repo. I haven't seen if anyone else did. BTW the rdate I attached in the first posting installs OK also on Maemo5. I'm using it to adjust the time of my N900, which seems to be not as good as the N800 on keeping the time.
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 
Reply


 
Forum Jump


All times are GMT. The time now is 12:16.