OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Real Time Clock › Re: Re: Real Time Clock
Dan in CA
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:
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
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
must be root or use sudo:
to read clock:
set the hardware clock from the current system time:
set the system time from the hardware clock:
‘I haven’t tried setting it up according to the instructions on the Wiki. It says to add
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.