Raspberry Pi Notes
Installing Raspbian OS:
Initial configuration in raspi-config:
Everything here is done by running #raspi-config. raspi-config is the central configuration wizard for most important things on the pi.
Change keyboard layout (default is UK):
In raspi-config go to Localization Options > Keyboard Layout. Choose a generic keyboard (101 key, 102 key, etc), then English, then Other, then English (US).
OR from the desktop environment go to Menu>Preferences>Mouse-and-Keyboard-Settings.
Configure network options:
In raspi-config go to Network Options. From here...
Change the host name from raspberrypi to anything we want, so that on the local network we can ssh into it with this name instead of the ip, or browse to local.[new name] in the browser.
Set the Wi-Fi SSID settings so it will automatically connect to the wifi network.
For more control in setting the network connection options, edit the supplicant file in /etc/wpa_supplicant/wpa_supplicant.conf. Here, connection info can be deleted, and connection priorities set (otherwise it goes by signal strength). To set priorities for different networks, add “priority=x” line, where the Pi will connect to the network with the highest valued x, and then run $wpa_cli -i wlan0 reconfigure. Example network info:
Enable SSH access:
In raspi-config, go to Interfacing Options > SSH > enable. With this, the pi can be accessed remotely by doing firstname.lastname@example.org with password “raspbbery”, or with whatever other host name was chosen in the previous step.
Set a static IP address:
In /etc/dhcpcd.conf add a line like this in the right place: static ip_address=192.168.0.XX/24
In raspi-config, go to Interfacing Options > SPI > enable. This is needed to use SPI over the GPIO header, which pi-plates needs (for example).
Setting up Pis so more than one can be accessed on the same LAN (wifi or ethernet)
NOTE: Both these should happen automatically as a result of setting the hostname in raspi-config.
Edit /etc/hosts so that both 127.0.0.1 and 127.0.1.1 uses the custom hostname.
Edit /etc/hostname to contain only the custom hostname.
Setting up a webcam server on the Pi:
Configure webcam server software (“motion”):
-Note: Change the following two lines from on to off if you’re having issues with the stream freezing whenever motion occurs:
-stream_maxrate 100 (This will allow for real-time streaming but requires more bandwidth & resources)
-framerate 100 (This will allow for 100 frames to be captured per second allowing for smoother video)
-width 1920 (This changes the width of the image displayed)
-height 1080 (This changes the height of the image displayed)
@sudo modprobe bcm2835-v4l2 (this loads the bcm2835 module added above and creates /dev/video0)
@sudo service motion start
After restarting the stream will now be up at http://raspberrypi.local:8081/. This can be added to the streaming link in DWC by adding it in the webcam stream configuration and enabling “embed video stream”.
Installing Pi-Plates libraries: