[beagleboard] DS1307 rtc lose time between power cycle

I know this is a stupid question but does your rtc have a backup battery? Is the battery good? Is the rtc resetting itself or is the bone not pulling the right settings? Sounds like your rtc is loosing all power when you unplug the source.

-Wil

Hi guys, I am currently trying to connect a DS1307 clock to my beaglebone and I am having some issues. I followed the adafruit tutorial to connect the same clock with a raspberry pi http://learn.adafruit.com/downloads/pdf/adding-a-real-time-clock-to-raspberry-pi.pdf
I pretty much did the same thing except for the part where I had to write something in the rc.loclal file. Since that file did not exist in my system, I created a service instead called “real-clock.service” that calls a bash script that does the same thing describe in the “write to rc.local file” step. I put my service in /lib/systemd/system" and enabled it so the system would call it at boot time. Now, everything would work correctly when I do a warm reboot but if I turn the power down completely, the time is reset to its default value. Do you guys have any idea of what could cause my clock to behave like that?

Thank you for any answers

this happen to me so i will ask, are you using the correct rtc? If you add the ds1307 like in the adafruit tutorial the ds1307 will be /dev/rtc1 so you need to use hwclock -f /dev/rtc1, and for making the DS1307 the default rtc run the following

rm /dev/rtc/

ln -s /dev/rtc1/ /dev/rtc/

this will create a symbolic link to rtc1 instead to rtc0 which is the processor internal rtc with no battery

-Pedro

note if you created the symbolic link you dont need to use the -f option on hwclock