![]() |
rdate: Set time from timeserver [ANNOUNCE]
1 Attachment(s)
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 >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 |
Re: rdate: Set time from timeserver [ANNOUNCE]
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 ;) |
Re: rdate: Set time from timeserver [ANNOUNCE]
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! :)
|
Re: rdate: Set time from timeserver [ANNOUNCE]
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:
Quote:
|
Re: rdate: Set time from timeserver [ANNOUNCE]
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. |
Re: rdate: Set time from timeserver [ANNOUNCE]
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: Quote:
|
Re: rdate: Set time from timeserver [ANNOUNCE]
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. |
Re: rdate: Set time from timeserver [ANNOUNCE]
is there any repo with rdate or ntpdate?
|
Re: rdate: Set time from timeserver [ANNOUNCE]
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.
|
All times are GMT. The time now is 12:03. |
vBulletin® Version 3.8.8