Raspberry Pi Cheatsheet
The Raspberry Pi is a fantastic, cheap, light and energy efficient single board computer. Ideal for quick prototyping or even serious applications like home automation.
Basic
# Login with username "pi", password "raspberry", figure out the Pi's ip address (connected devices list in your router interface) ssh pi@192.168.178.39 # Basic Raspberry Menu options (extend filesystem to use all the space on your SD card!) sudo raspi-config # Update and upgrade raspbian sudo apt-get update && sudo apt-get upgrade sudo apt-get dist-upgrade # Update firmware sudo apt-get install rpi-update sudo rpi-update
WiFi
# Scan for available networks sudo iwlist wlan0 scan # Add network credentials sudo nano /etc/wpa_supplicant/wpa_supplicant.conf # Add your network credentials to the bottom and save (ctrl+x, y and enter) network={ ssid="myWifi" psk="myWifiPassword" }
SD card tweaks
# Shut down properly (for the sake of your SD card), wait for the Pi's activity LED to flash sudo halt # Disable swap to increase the lifespan of the SD card sudo dphys-swapfile swapoff # Or completely remove swap sudo apt-get remove dphys-swapfile # Minimize logging; in /etc/fstab: # 1. set /boot partition to noatime # 2. move /var/log/ to ram by adding the last line proc /proc proc defaults 0 0 /dev/mmcblk0p1 /boot vfat defaults,noatime 0 2 /dev/mmcblk0p2 / ext4 defaults,noatime 0 1 none /var/log tmpfs size=1M,noatime 0 0
Webcam
# Enable webcam in raspi-config sudo raspi-config # Capture a still and save as filename.jpg raspistill -o filename.jpg # Capture video for 10 seconds raspivid -o filename.h264 -t 10000
Domoticz
# Start Domoticz sudo service domoticz.sh start # Stop Domoticz sudo service domoticz.sh stop # Check if Domoticz is running sudo service domoticz.sh status
Add a camera in Domoticz
IP Address: Your domoticz server IP address (eg 127.0.0.1) Port:8080 Username:<blank> password:<blank> ImageURL:raspberry.cgi
Miscellaneous
# When you have a minimal install but want a desktop sudo apt-get install lxde sudo apt-get install lightdm # When you want to be able to use startx/xinit sudo apt-get install xinit # Change keyboard layout (default is UK) sudo dpkg-reconfigure keyboard-configuration