8ctopus
Posts: 11
Joined: Sun Sep 23, 2012 9:50 am

system time not syncing from RTC

Fri Oct 12, 2012 4:53 am

I have just installed a RTC (DS1307) exactly following the adafruit tutorial here: http://learn.adafruit.com/adding-a-real ... i/overview

Everything went great, the clock was detected, I updated the RTC from the system time and added the appropriate lines to /etc/modules and /etc/rc.local

but... when I reboot (without internet access) the system time is not synced with the RTC, that is to say that running date vs sudo hwclock -r reports different times - the RTC is correct and the system time looses several second with each reboot.

interestingly I have to run hwclock -r as sudo, otherwise I get

Code: Select all

pi@raspberrypi ~ $ hwclock -r
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
pi@raspberrypi ~ $ hwclock -r --debug
hwclock from util-linux 2.20.1
hwclock: Open of /dev/rtc failed: Permission denied
No usable clock interface found.
hwclock: Cannot access the Hardware Clock via any known method.
pi@raspberrypi ~ $
could it be a permission problem? any ideas on how to fix?

robotworkshop
Posts: 24
Joined: Thu Aug 30, 2012 7:19 pm

Re: system time not syncing from RTC

Fri Oct 12, 2012 5:29 pm

Checkout the end of this thread:

http://www.raspberrypi.org/phpBB3/viewt ... 44&t=16218

It should have the answer to your question about reading the RTC upon boot.

8ctopus
Posts: 11
Joined: Sun Sep 23, 2012 9:50 am

Re: system time not syncing from RTC

Sat Oct 13, 2012 4:20 am

Thanks, seemed like exactly what I was looking for but for some reason I ran into a problem running update-rc.d hwclock.sh enable. Anyway I posted in the other topic, thanks for the link.

Return to “Interfacing (DSI, CSI, I2C, etc.)”