Time...
Pages: 1 2
David Feugey (2125) 2709 posts |
I have a small problem with RISC OS 5.22 under RPCEmu DST and TimeZone is OK at boot, but after a few seconds the system act as if TimeZone was 0 and DST not active (configure options are still good). It seems to be a bad interaction with the SyncClock module. ROS 5.20/5.21 did not have this problem. |
Steve Pampling (1551) 8172 posts |
DST and TimeZone is OK at boot, but after a few seconds the system act as if TimeZone was 0 and DST not active (configure options are still good). It seems to be a bad interaction with the SyncClock module. What problem? The Greenwich Meridian runs through France (just West of Le Mans IIRC1) now if you were talking about Eire not having -1 that would be different :) 1 I believe this puts over 90% of France in timezone 0 |
Frank de Bruijn (160) 228 posts |
Ha ha, very funny. Seriously though, if timezone setting is indeed broken like this, I’ll hold off installing 5.22/23 on RPCEmu until it is fixed. I don’t need any more time related issues on RPCEmu. The nasty messing up of time stamps on reading from image files (SparkFS/StrongHelp) is more than enough… :( |
Steve Pampling (1551) 8172 posts |
OK. Seriously then: The SyncClock module is the issue, there was a daylight saving issue noted some while back and having done a quick search for the response from Dave Symes he identified the fix The original suggestion bounced around was deleting the module but the configuration change is the proper method. The emulator then uses the system time. I created a small obey file in boot.predesk |
Frank de Bruijn (160) 228 posts |
Ah, yes. I now remember reading that thread at the time and thinking it wouldn’t affect my setup as the host’s hardware clock is on UTC (as it should be). Funny thing, memory. I find I easily forget about things I think I don’t need to remember… :) |
Steve Pampling (1551) 8172 posts |
Strange timing – a comment from my director1 was “I don’t know how you remember all these things” I explained that I forget stuff like birthdays, including my own. 1 Twice this week |
Rick Murray (539) 13850 posts |
Unfortunately this is both correct and incorrect. Yes, the meridian runs through France. But alas you have failed to take into account latitude and the fact that we’re talking about a wobbly spherical object. Consider this: It’s a slightly different story the other side of the year at the winter solstice: |
Steve Pampling (1551) 8172 posts |
Ah, the muddled thinking that equates available daylight to a specific time on the clock. You’ll be talking about farmers needing specific sun positions to milk the cows next. |
Rick Murray (539) 13850 posts |
No more or less muddled than suggesting that a country at a different latitude would be at the same timezone because it is in some otherwise arbitrary line. As I said, it’s a wobbly sphere we’re dealing with.
Judging by the magazine racks, the French are big on gardening according to the position of the moon, so I wouldn’t be surprised if there are farmers who think the sun should be in a specific position in the sky . . . and indeed if we refer to fixed time (like UTC and not CE(S)T), the sun is in specific places each hour – that’s how sun dials work. ;-) |
Steve Pampling (1551) 8172 posts |
Time has no fixed relationship with available daylight – ask the Hebrideans.
Time zone 0. Groundhog time… |
Ronald May (387) 407 posts |
You’ll be talking about farmers needing specific sun positions to milk the cows next. Last weeks news (-: http://tvnz.co.nz/national-news/cows-milked-in-darkness-could-help-insomniacs-video-6303148 |
David Feugey (2125) 2709 posts |
It will. Even in UK there is DST. |
Frank de Bruijn (160) 228 posts |
Indeed. DST doesn’t even make a difference. Time is off by 2 to 4 hours, depending on various settings. I guess the mention of ‘raw time’ in the other thread somehow led me to believe that syncing something to the host’s UTC should make sure RISC OS stays on UTC as well. Apparently not. Unfortunately, switching SyncClock off (which is actually no different from removing the module – it becomes a piece of dead code) causes considerable time drift. So if I want to use this version of the OS, I’ll have to figure out exactly what has been changed here or write my own sync code. |
Steve Pampling (1551) 8172 posts |
Interesting, I don’t get the time drift. How long does your setup take to drift by a perceptible amount? |
Frank de Bruijn (160) 228 posts |
It starts almost immediately. Roughly one second per fifteen minutes. I let it run for four hours and it had gone up to fifteen seconds. |
Rick Murray (539) 13850 posts |
On a related note, it seems that if NetTime is unable to sync with the server it will give up but will not disable the slewing. I had this last night when my OLED failed to turn off at midnight. The last time sync was about 4pm, and the time was 23h35, so it managed to lose 25 minutes in eight hours. Hmm. |
Steve Pampling (1551) 8172 posts |
Reproducible, if I run a few processor intensive tasks. |
Frank de Bruijn (160) 228 posts |
Adding a call to Territory_ReadCurrentTimeZone to SyncClock, after the call to Territory_ConvertOrdinalsToTime, and adding the value returned in R1 to the 5-byte value in the block before the call to Territory_SetTime seems to work. Anyone see any pitfalls here? Now to find an easy way to identify the OS versions where this is necessary… |
Steve Pampling (1551) 8172 posts |
The first report from anyone of time sync issues was back in May 2014 on a version of 5.21. |
Frank de Bruijn (160) 228 posts |
Weirdest thing is, the change doesn’t seem to bother RISC OS 4.39, 5.21 (pre May 2014) or 6.20. I need to run more tests, but the quick check I did earlier shows that even with that extra bit of code in, the time is correctly synced. Which actually seems impossible. I would expect it to jump ahead with the same amount of time as it’s corrected with on 5.22/23. I’m missing something again… :( |
Steve Pampling (1551) 8172 posts |
I have a vague recollection of Sprow / Steve/ Jeffrey explaining a change that meant that something previously ignored was now picked up1. Could be muddling things, I’ve been to sleep a few times since. 1 In which case the broken bit wouldn’t care which way round things were. |
Frank de Bruijn (160) 228 posts |
That could be it. I get the impression Territory_SetTime doesn’t use the buffer provided. It does use something, because if I kill SyncClock the time starts to drift at an alarming rate (this is on RO 4.39), but no matter what I put in the buffer – even totally ridiculous values – with SyncClock running, time is neatly kept in sync with the host’s clock. |
Rick Murray (539) 13850 posts |
Just to give this a prod again. I looked at my Pi’s time just now and it was incorrect. By several minutes. In the course of a day and a half. Not as bad as the above, but still unacceptable. This is a continuing issue, it is only today that I have chosen to post a message about it. The time is usually…incorrect, by numerous minutes.
I would report this as a bug, but I’m not getting any response. Could somebody please either:
or:
I don’t know why NetTime is having problems, maybe “devrandom.pl” (however it managed to get that address…) just didn’t want to reply? I don’t know. What I do know is the mechanism designed to keep the clock accurate is making it worse. I have ClockSync on my phone to tell me the NTP time, and according to that, RISC OS is already two and a half seconds slow in the course of writing this message. Was it trying to correct for the previous 430 seconds after having force-set the time to be correct? Bug, surely?
|
Sprow (202) 1158 posts |
It will keep retrying even if one of the servers is uncontactable (see ‘machine.c’ in NetTime, both the DNS and server failures end up back in Sleeping state on SHORT_TIMER).
That should also be happening. There’s a default callback every hour that tries to set the time from the HW clock, but which has lower priority than NetTime, therefore for the (in your case) 30 mins while the NetTime slew is in progress the default callback will be declined (see rtclock_fg_callback in RTC). One extra angle here is the Pi may not have a HW RTC (you don’t mention that), so RTC_Read might fail if the HAL says there’s no chip, or it ends up comparing itself with the soft clock which is of course drifting too as it runs off the same centisecond ticker. You can experiment from BASIC what the outcome of those questions will be, I suspect we need to jiggle the logic of rtclock_fg_callback so that there’s an ‘else’ to default it back to no slew. |
Rick Murray (539) 13850 posts |
There is an RTC – http://www.cjemicros.co.uk/micros/individual/newprodpages/prodinfo.php?prodcode=4D-RaspberryPi-PowerControl-RealTimeClock-Temp-RTCT If the module will try every hour, why the 1 day 14 hours (etc) since the last update, along with the very wrong time? |
Pages: 1 2