Page 1 of 1

Re: Is there any implementation of a system clock?

Posted: Sun Jan 08, 2012 7:56 pm
by mikeyp
I know there is no hardware clock or battery but is there any implementation of a time clock?

The reason I ask is because I would like to run the R-Pi as a low power server and I have some applications which display the time around the house, dependent on this device. If it did, I would expect it would get the time from an NTP server online and then check periodically it hadn't drifted.

Is this a reasonable assumption or would it need a hardware clock addon through the GPIO as GERT has alluded to considering producing in another thread?

Re: Is there any implementation of a system clock?

Posted: Sun Jan 08, 2012 8:25 pm
by slacker
Yes, it has a system clock and assuming it has an internet connection, it will be able to get the time from an NTP server.

Re: Is there any implementation of a system clock?

Posted: Sun Jan 08, 2012 8:30 pm
by DaQatz
You will probably have to access the ntp server fairly often. The software clocks tend to have a lot of drift.

Re: Is there any implementation of a system clock?

Posted: Sun Jan 08, 2012 8:50 pm
by mikeyp
That's good. Don't mind how often it needs to access, just as long as it'll do. I'm probably going to hook it up to a GPS device anyway.

Thank you.

Re: Is there any implementation of a system clock?

Posted: Sun Jan 08, 2012 9:58 pm
by bsmulders
GPS devices need to be placed near a window though.

If this is a problem, you can try an older cellphone and use a serial connection to grab the phone's time. It will be as accurate as the phone's internal clock though. But it will work after a power outage due to the internal battery.

Re: Is there any implementation of a system clock?

Posted: Sun Jan 08, 2012 10:22 pm
by daemondust
Once someone has written kernel i2c/smbus drivers, you should be able to attach something like a chronodot to have the time set for you on boot. The kernel supports a lot of RTCs.

Re: Is there any implementation of a system clock?

Posted: Sun Jan 08, 2012 10:58 pm
by sylvan
DaQatz said:


You will probably have to access the ntp server fairly often. The software clocks tend to have a lot of drift.



chrony will discipline the kernel clock using corrections from either you manually entering the correct time every now and then or using NTP (if available).