OpenSprinkler Pi

From Rayshobby Wiki
Revision as of 04:12, 11 June 2013 by Ray (talk | contribs) (Created page with "right = Download Location = http://www.raspberrypi.org/downloads It is recommended to use Raspbian “wheezy”. There is unlikely to be any r...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Download Location

http://www.raspberrypi.org/downloads

It is recommended to use Raspbian “wheezy”. There is unlikely to be any reason to use the slower soft-float version.

Installation

Please refer to the instructions on http://www.raspberrypi.org

Defaults

Login: Username: pi
Password: raspberry
IP address: via DHCP

Initial Setup

If you are using your Raspberry Pi without a monitor you will need to run the initial setup manually from the command line when you first log in to it via ssh:

sudo raspi-config

DS1307 RTC

The following is collected from various sources:

Add the following to /etc/modules

i2c-bcm2708 
i2c-dev
rtc-ds1307

Comment out both spi-bcm2708 & i2c-bcm2708 from /etc/modprobe.d/raspi-blacklist.conf

Install i2c-tools

sudo apt-get install i2c-tools

Look for ID #68 with i2cdetect
On a 256MB Raspberry Pi Model B:

sudo i2cdetect -y 0

On a 512MB Raspberry Pi Model B:

sudo i2cdetect -y 1

The result should look like:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --  

As root:
On a 256MB Raspberry Pi Model B:

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

On a 512MB Raspberry Pi Model B:

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

Check the kernel logs for messages like

rtc core: registered ds1307 as rtc0

Then check for time from the clock (which will show Sat 01 Jan 2000 if it is the first time it is used):

sudo hwclock -r

And then write the current system time to the clock:

sudo hwclock -w

The edit /etc/rc.local and add the following before exit 0:
On a 256MB Raspberry Pi Model B:

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

On a 512MB Raspberry Pi Model B:

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

Hardware watchdog

The following is collected from:

Install watchdog

sudo apt-get install watchdog

Uncomment the following line in /etc/watchdog.conf

watchdog-device = /dev/watchdog

Add the following to /etc/modules

# hardware watchdog
bcm2708_wdog

Run the following command to activate the module and service:

sudo modprobe bcm2708_wdog ; sudo service watchdog restart

Further steps

Further installation and configuration is done as per a standard Debian or Ubuntu setup.
E.g. Network configuration can be done through /etc/network/interfaces