OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Real Time Clock
- This topic is empty.
-
AuthorPosts
-
September 13, 2013 at 2:46 pm #22636
mikethechapParticipantI was reviewing the material on the real time clock (RTC) that Ray posted here: http://rayshobby.net/mediawiki/index.php?title=Set_Up_RPi,_RTC,_WiFi,_Data_Log.
Ray referred back to the Adafruit discussion here. On the Adafruit page it says that the Wheezy or Occidentalis v.01 distributions don’t have the necessary RTC module or the DS1307 module.
So, does anybody at this time have a working RTC using Wheezy? Will Ray’s instructions work with Wheezy?
Thanks for any help. I’m thinking about putting an RTC on my OSPi.
[EDIT] If anyone used Occidentalis v.02, did you follow Ray’s instructions as detailed above? How did it work out?
September 13, 2013 at 10:20 pm #25536
Dan in CAParticipantMike,
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-ds13072. 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
September 14, 2013 at 2:42 am #25537
mikethechapParticipantThanks, Dan!
The OSPI connected to the sprinkler is running wheezy. I am using Occidentalis on another Pi. but that RPi isn’t connected to the OSPi board. I’ll try and check it out tomorrow and see if it works okay.
The wheezy kernel did fine using your instructions. The glitch was not observing the integer 1 in the following instructions for the 512 RPi board:
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
Thank you!
As soon as I get a chance I’ll try the Occidentalis with the OSPi board.
September 17, 2013 at 7:42 am #25538
KanyonKrisParticipantIs the real time clock very important?
If the Pi has even a flaky internet connection it will get regular time updates via NTP to keep it’s clock accurate.
One user reported his Pi drifting forward 12 seconds per day without NTP. Could be worse depending on temperature, etc. Let’s say it gains 30 seconds per day, that’s still only 5 minutes every 10 days. I wouldn’t care if my watering drifted that much or more, others may. And I doubt my internet connection would be down that long.
But what if the Pi’s ethernet/WiFi konks out? I may not notice that. An RTC, like the one on the OpenSprinkler board, would help here. Since I’m using relays I better rig up a ping test to alert me when the sprinkler Pi can’t be reached.
Other thoughts / comments?
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Real Time Clock