#25536

Dan in CA
Participant

Mike,

The OpenSprinkler Pi board already has an RTC on-board.

When I first started working with it I used the following to access the clock:

“FYI
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)

i2c-bcm2708
rtc-ds1307

2. added following line to /etc/rc.local
for a 256MB Raspberry Pi Model B:

echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-0/new_device

for a 512MB Raspberry Pi Model B (i2c-0 is changed to i2c-1):

echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device

3. Reboot

must be root or use sudo:
to read clock:

hwclock -r

set the hardware clock from the current system time:

hwclock -w

set the system time from the hardware clock:

hwclock -s 

‘I haven’t tried setting it up according to the instructions on the Wiki. It says to add

hwclock -s

to /ect/rc.local which will set the system time from the RTC at boot but I am not sure if the system will keep updating the time from the network. If so the instructions don’t say how to update th RTC from the network.

The way it should work is that the system uses the RTC if the network is not available but the RTC should be kept up to date from the network otherwise.

Occidentalis is a custom Linux distro developed by Adafruit for educational purposes. I haven’t tried it but if you do, please let us know your experience.

Dan