Preparing RaspberryPI (Debian-Wheezy) for Domoticz
To prepare a Raspberry PI (Debian/Wheezy) from scratch to run Domoticz
Download the Wheezy image
http://www.raspberrypi.org/downloads
Unix
Follow instructions to prepare an SD-card
http://elinux.org/RPi_Easy_SD_Card_Setup
Windows
Use the program Win32DiskImager to burn the image to the SD card:
https://sourceforge.net/projects/win32diskimager/
Raspbian images released after 2016-11-25: If You downloaded the latest version of Raspbian and You intend to access it using ssh, enable ssh by creating a file with name "ssh" in boot partition of the SD card.
To login via SSH, you can use the application 'Putty'
Get your Rpi up-and running with this SD card
The Raspi-config will start up, perform the following actions:
Option 1. expand Filesystem
Option 2. Change User Password
Option 4. Internationalization options:
- Option I1. Change Locale: set locale to en_US.UTF-8
- Option I2. Change Timezone: set to appropriate timezone
- Option I3. Change Keyboard Layout: Takes a while for the list to appear - stick to the generic layouts unless you have a good reason not to IBM PC Keyboard.
Option 8. Advanced Options:
- Option A3. Memory Split: Set to 16M since we don't need a graphical environment
- Option A0. Update
Finish the config tool and reboot.
sudo reboot
Give it at least a minute to expand your root filesystem, then continue
Cleanup
Login as 'pi' and remove unneeded packages.
sudo apt-get remove cups* sudo apt-get remove gnome* sudo apt-get remove x11-common* sudo apt-get autoremove
Installing updates
sudo apt-get update sudo apt-get upgrade
Add some extra packages
sudo apt-get install git-core subversion screen
Install texteditor 'nano', which is much easier to work with than 'vi'.
sudo apt-get install nano
Updating firmware
sudo apt-get install ca-certificates sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update sudo rpi-update
And reboot again.
sudo reboot
Options (Optional)
fixed ip-adress
sudo nano /etc/network/interfaces
iface eth0 inet static address 10.0.1.10 # << change to an ip address in your network netmask 255.255.255.0 gateway 10.0.1.1 # << change to your gateway
Tweaking (Optional)
Free up some memory and cpu cycles:
sudo nano /etc/inittab
/etc/inittab no longer present in Raspbian Jessie, use;
sudo systemctl disable [email protected]
Find the lines:
4:23:respawn:/sbin/getty 38400 tty4 5:23:respawn:/sbin/getty 38400 tty5 6:23:respawn:/sbin/getty 38400 tty6
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
And replace 'respawn' by 'off'
4:23:off:/sbin/getty 38400 tty4 5:23:off:/sbin/getty 38400 tty5 6:23:off:/sbin/getty 38400 tty6
T0:23:off:/sbin/getty -L ttyAMA0 115200 vt100
And make changes active:
sudo telinit q
Install Domoticz
Follow the instructions at: Installing and running Domoticz on a Raspberry PI
Now backup the SD-card
sudo halt
Unix
Put the card in a Mac or Linux workstation. Find the raw disk device, be very careful not to overwrite your system disk:
sudo diskutil umount /dev/disk1s1 sudo dd bs=1m if=/dev/rdisk1 of=clean-rpi.img
Windows
Put the card in a windows workstation, and use the program 'Win32DiskImager' again to backup the SD card.