[SOLVED] Who has clock issues?


AquaAnalogue

Member
Joined
Jan 19, 2010
Messages
355
Hello friends, it has been a while. Save for the occasional read-only visit (*lurk lurk* :ph34r: ) I have been neglecting the Pandora scene for about a month on and off, due to the pains of life outside Eden and some annoying family issues (just money, nothing serious).


I am saddened to report that the RTC on my Pandora is indeed defective. Oh well... there had to be something, right? I have set it numerous times only to have it lose time horribly during sleep mode or downtime. It really is broken.


The reason I have come here is to fix the issue, not by RMA as that would be silly, but by using something like NTP. The problem is, NTPd and ntpdate are not in the repositories, Pandora nor upstream.


I could run a startup script to synchronize the time. I am just unfamiliar with what direction would be best. Should I compile the utilities from source or are they available somewhere I haven't seen? Most of all, could we get some kind of firmware integration as I believe it is a very small application with a very big impact?
 
Last edited by a moderator:
i had this issue when i first updated to the latest hot fix. a quick re install sorted out the majority of issues i previously had. could be worth a shot
 
Yes, I've seen this happening as well. Every once in a while I notice that my Pandora has drifted between ten minutes to half an hour from the correct time.


Has the cause of this ever been identified? I vaguely recall some discussion about it when I was still waiting for my Pandora but I didn't pay much attention to it at the time.
 
I gave up long ago trying to keep my Pandora's RTC at anything like the current time. Folks here kept telling me it was a battery issue, but it's not - the damned thing just will not keep time and loses hours at a time when in standby mode (including time spent plugged into the AC charging - and it's never had a flat battery).


So I just gave up, it's just not going to be a feature I can use :(


D.
 
Don't give up Dunny. I am really trying to find the issue here and your experience sounds closest to mine thus far. My clock currently says it is Saturday. o_OHas anyone experimented with a script to check the time and correct it?
 
Don't give up Dunny. I am really trying to find the issue here and your experience sounds closest to mine thus far. My clock currently says it is Saturday. o_OHas anyone experimented with a script to check the time and correct it?

That would only be useful if my Pandora connected to the 'net, and it does not - I don't use it with Wifi enabled. It's a real shame that the clock just can't seem to keep time.


D.
 
I figured it was like the beagleboard and didn't have a RTC installed by default... Mine is always off.
 
It seems if you only set the clock in xfce, the rtc is not updated.


Try setting the clock, then open a terminal and type:



Code:
sudo hwclock -uw
 
It seems if you only set the clock in xfce, the rtc is not updated.
Hey, you seem to be right. That's a bit unexpected (the fact that it doesn't update the RTC, not the fact that you're right :p ). The difference between the two seems to equal the typical drift I've been seeing.


Hopefully this will fix the problem.
 
I've had no problems whatsoever since doing this:

Setting the system time and RTC (real time clock) require root privileges so...


# sudo bash


<your passwd>


In the shell as root (no more time consuming password prompts)...


# date 07182233.30 # format being... MMDDhhmm.ss


# hwclock -w # this writes the system time to the RTC. Other flags -r will read/display the RTC time and -s will set the system time from the RTC.


Now I know both my system and RTC are correct and in sync.


Confirm with...


# hwclock -r; date


exit root shell for your own safety...


# exit
 
Thanks so much for this solution, Notaz. My hardware clock was, indeed, off by quite a lot, and was not being set properly.


I have it set with ~2 seconds precision to the output of a website. In a week's time, I'll report back to this thread, hopefully with a confirmation for this fix.


Can we get this into the firmware, doing it automatically after the time/date prompts?
 
Can we get this into the firmware, doing it automatically after the time/date prompts?
I don't know if that's a good idea or not. The hardware and system clock are separate by design. Even on your desktop, the hardware clock isn't set immediately upon changing the system clock (via 'date'), getting and setting automatically only on start up and shut down. Doing otherwise deviates from Linux convention.


On the other hand, the Pandora is more than a Linux device, it needs to be much more user-friendly, and that may mean dropping some "power" decisions in favour of "usability" decisions. Certainly it's worth considering.


If you can prove through your testing, AquaAnalogue, that it is the system clock (displayed by 'date') that slips while the hardware clock (displayed with 'hwclock') remains mostly accurate, then perhaps attaching a "hwclock -r" to the lid open script may be useful.
 
I'm rather upset. I just made a monster post from the Pandora but Firefox crashed on me. So here goes again...


I gave some thought yesterday to updating the system time from an internet source via the Network Time Protocol (NTP).


I first installed the ntp patckage from the Angstrom repo but removed this later as I don't this running all the time on a system that is short of resources and not always connected to the internet.


Next thought was ntpdate. This uses the same protocol but is more ad hoc which is exactly what I want. After the obligatory sudo opkg update I then searched for the package that contained ntpdate with sudo opkg search "*ntpdate", oddly blank. Never mind, sudo opkg install ntpdate does the trick. It also installs a useful looking scripts called /etc/network/if-up.d/ntpdate which is supposed to run ntpdate when an interface is upped. I toggled wifi off and back on to no effect. urm!


See the internet of more details but ntpdate has three flags I'm interested in. -b, -d and -q. -b sets the system time without slewing, -d is debug more and shows all the working without actually changing the date and -q does much the same but without too much noise.


I'm using an NTP source from NTP Pool Project guys Below I'm using the generic pool.ntp.org but you would be better of using something closer to home.


e.g uk.pool.ntp.org for me.


What's the time...


# ntpdate -q pool.ntp.org; date; hwclock -r

server 85.214.116.15, stratum 2, offset 1.448602, delay 0.07933


server 193.110.251.50, stratum 2, offset 1.449888, delay 0.05902


server 83.98.201.133, stratum 2, offset 1.449766, delay 0.05441


30 Jul 18:16:24 ntpdate[5081]: step time server 83.98.201.133 offset 1.449766 sec


Sat Jul 30 18:16:24 BST 2011


Sat Jul 30 17:16:25 2011 0.000000 seconds


UTC or Local for the hardware clock?


Notaz's command above uses the -u flag which saves the time in UTC mode. However the /etc/init.d/hwclock.sh script relies on the UTC variable in /etc/default/rcS being equal to yes.


So if you want to go UTC then edit this and uncomment the UTC line else you'll switch to local if you reboot.


Update the time from the internet: Assuming that you are online then...


# sudo bash


# ntpdate -b pool.ntp.org


# hwclock -wu # drop the u or replace with an "l" if you sticking with local.


# exit


You may have noticed I'm about 1.4 seconds adrift and that was only from yesterday morning. Both system and RTC (Real Time Clock aka hardware clock) appear to have kept in sync.


Going forward:


I was going to knock up a script to rum from hourly cron to...


exit if lock file exists and is < 1 day old.


ping pool.ntp.org (check the internet is there)


ntpdate -b ....


source /etc/default/rcS


[ "$UTC" = yes ] && UTC=-u || UTC=-l


hwclock -w $UTC


touch lock file in /tmp ... which is should be volatile so we get a new update on reboots.
 
Last edited by a moderator:
I'm rather upset. I just made a monster post from the Pandora but Firefox crashed on me.
Ugh that sucks. I've done that a couple times before. I usually use a text editor first now. Catlooking Writer is the best for that, I think.

On topic, though, thanks for finding ntpdate in the upstream repositories. I had done a search before but I couldn't find them, because first I was like:

The problem is, NTPd and ntpdate are not in the repositories, Pandora nor upstream.
Then you were like:

After the obligatory sudo opkg update
Then I was like:

Shit. /thread

Not really though, because thanks to my little brain fart, I found the source of the issue (system does not set hardware clock) and not just some hack, and perhaps Dunny can make use of it as well (since my hack wouldn't have worked for him). The Pandora's clocks do lose time though, about 1.5 seconds a day for the RTC (not a scientific measurement) and a little more for the system clock, so I think I will make a little script to run it when I first connect to the internet for the day.


I really, really think we should:

  1. Include NTPdate in the firmware (it cannot be that big)
  2. Make an option to set the date via one of those NTP pool servers instead of by hand
  3. After the initial setup, and the initial setup only, write to the hardware clock.
 
Just a random aside. I've noticed that if I ever have to do a hard reset of the pandora (pandora button and flip the power switch or remove the pandora battery) when the pandora is in some sort of state that is locked or something similar, that the current date & time will be set back to when the pandora was first turned on in that session.


So, if you had to do anything like that, that will though the time way off.
 
Right, this fix is confirmed after a week (or thereabouts) of no clock issues. Total drift over the week was about 10 seconds; not too bad for a device with nothing radioactive inside. Thanks for all your help guys.





@CatPhoenix: I tried that just now; didn't do anything bad to my clock... o_O



My original problem is long gone, so I've marked this thread as solved. Woo!
 
can't seem to install ntpdate via opkg (gives me - cannot install ntpdate message), can anyone post a ipk for me?


cheers


edit/ am running HF7a3
 
Last edited by a moderator:
Dont know if my problem is different but, I have been having this issue with my unit where i set the time to eastern standart time NY and it reverse back to EU time. Its 5 hours advance than what I want it to be.
 
Back
Top