Raspberry Pi’s are cheap, and I really like the Raspbian operating system, I can work in just about any programming language I want, and I can configure it from my laptop with standard networking gear. No extra keyboards, monitors or serial adapters needed.

Jack a cable from the Pi’s ethernet port straight into your network router, insert a SD card prepared with Raspbian and power up the Raspberry Pi. 98% of the time, your network will automatically assign the Pi with an ip address (the other 2% being cases where you have explicitly configured your network otherwise).

Picture of Raspberry Pi plugged into ethernet

Next, fire up a network analysis tool and find the address that was automatically assigned to the Pi. For me, I use the excellent Angry IP scanner (open source) to scan my network and get an address list of all the devices that are currently connected.

screenshot of Angry IP scanner

Now that you know the address of your Pi, you can crank open a terminal and SSH into it with the default credentials that comes with Raspbian:

laptop$ ssh pi@

(The default password is raspberry)

Now that we are in, the Raspberry Pi can be customised for your project. I upload and run a little script that installs the tools I use (OpenCV, vim and Go), it also ensures that the operating system is set to handle regular USB webcams and finally configures the timezone.

#!/usr/bin/env bash

# Update aptitude
sudo apt-get update
sudo apt-get upgrade -y

# Install opencv & vim.
sudo apt-get install -y libopencv-dev
sudo apt-get install -y vim

# Ensure webcam module is loaded with necessary settings.
sudo rmmod uvcvideo
sudo modprobe uvcvideo nodrop=1 timeout=5000 quirks=0x80

# Download golang
if [ ! -f go1.2.2.linux-arm~multiarch-armv6-1.tar.gz ]; then
	wget http://dave.cheney.net/paste/go1.2.2.linux-arm~multiarch-armv6-1.tar.gz

# Install golang
sudo tar -C /usr/local -xzf go1.2.2.linux-arm~multiarch-armv6-1.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> /home/pi/.bashrc
source /home/pi/.bashrc

# Configure the local timezone.
sudo bash -c 'echo "Australia/Brisbane" > /etc/timezone'
sudo dpkg-reconfigure -f noninteractive tzdata

Often I will tweak this base configuration with some project specific changes, which will customise the networking setup and tweak /etc/rc.local to run a custom application when the Raspberry Pi is booted.

Uploading the bootstrapping script from your laptop is pretty straight forward with scp:

laptop$ scp bootstrap.sh pi@

Running the script on the Pi is simply a case of:

pi@raspberrypi$ ./bootstrap.sh

You can pick up a Raspberry Pi from Amazon and when coupled with an Arduino it is a very flexible platform to power all those creative computing projects you are cooking up.

comments powered by Disqus