OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) DS1307 W RPI Wheezy Softfloat Re: Re: DS1307 W RPI Wheezy Softfloat



A while back Dan in CA sent me some instructions on how to use RTC with RPi. I tried and they seem to work. I’m posting his instructions here, hope these help:

after a few different iterations, here are the settings I used to access the RTC:

1. added following lines to /etc/modules (sudo nano /etc/modules)
2. added following line to /etc/rc.local
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-0/new_device

3. Reboot

must be root or use sudo: hwclock -r to read clock.
set the hardware clock from the current system time: hwclock -w
set the system time from the hardware clock: hwclock -s

Following up on the RTC stuff:

You must ‘sudo -s’ before you can set the RTC.