Getting started Optional set up items 3D graphics Camera Trap Remote Control by smart phone Object tracking BrickPi robot

Optional set up items

This page contains details on how to do a number of things that I have found useful, but that weren't obvious how to do at first.

To find IP address of the raspberry pi:

On the raspberry pi type (at the command line):

            hostname -I

(Note: that is a capital i at the end)

If you don't have access to the Raspberry Pi, but you think it is connected to your local area network (LAN), you can find the IP address either by using your wireless hub's settings panel to see what devices are connected, or by using a LAN scanner (e.g. LANscan for Mac, or Lanscan for Winodws).

To connect to Raspberry Pi from a laptop (or smartphone ssh client):

This is a way of interacting/using the pi without a monitor or keyboard of its own. You will connect from another computer using Secure Shell (ssh). To do so you need to know the hostname or IP address of the Raspberry Pi. Luckily on many home networks the hostname will be "raspberrypi.local"

On a mac, open the Terminal application (in Utilities folder), and at the terminal enter the following:

            ssh pi@raspberrypi.local

then enter the password (raspberry) at the prompt. On some networks you will need to give a different hostname, e.g. on the Durham wireless network I have to type


The first version should work on a simple home network, but unfortunately often it doesn't. Alternatively you can enter the IP address if you know it, e.g. ssh pi@; you can look up the IP address on your wifi hub settings system.

On windows you will needs to download and install PuTTY, then make the same connection.

On a smartphone you can download a ssh client, e.g. "vSSH lite" on an iPhone, or "JuiceSSH" on Android.

In any of the cases, you then have access to the command prompt of the raspberry pi from your other computer.

To install remote desktop functionality:

At the command promt type:

            sudo apt-get install tightvncserver

To view the desktop remotely:

On the raspberry pi type (at the command line):

            vncserver :0 -geometry 1024x768 -depth 24

then in a vnc client (e.g. TightVNC) on the remote computer enter the IP address of the raspberry pi. On a Mac you can simply go to the safari url bar and enter:


(replace with raspberry pi"s hostname or IP address), which will launch screen-sharing.

N.B. the vnc password is 'raspberr', unless it asks you to set your own. (truncated to 8 letters).

To correct 3D TV overscan issues

You may find that switching to 3D mode with a 3D capable TV gives horrible results. If so it is likely that the raspberry pi is assuming the TV overscans and misses the edge of the image off, so is not giving a full image to the TV. In the "boot" folder in the top most folder of the raspberry pi, find the config.txt file and add (or uncomment) the line             disable_overscan=1

Run on boot

In order to get the camera trap to 'just work', I set it so that the python program would run immediately after the Raspberry Pi boots. Then I could take the trap into the garden, plug in the battery and it would launch itself with no keyboard or interaction from me. You can do this for any program you want to run on boot. Suppose you want to run a python program called which is on your desktop: add the line

       sudo python /home/pi/Desktop/ &

to file /etc/rc.local just above the last line (exit 0), then reset permissions at the command prompt with

       sudo chmod 755 /etc/rc.local

The line tells the program to run, and the ampersand tells the shell to move on, rather than waiting for your program to finish. Changing permissions allows this file to be executed on boot.

Copying an SD card

Pop your SD to clone into the slot. On a Mac enter terminal, or on Linux at the command line, use 'diskutil list' to find out the mounting point of the SD card. You will see a list of mounted disks on your system; look for the one that is 4 or 8GB and has linux on. It will be something like /dev/disk2 - getting the number right is important.

Now copy the disk to an 'image' on your computer with the command

       sudo dd if=/dev/rdisk2 of=SD.img bs=1m

This will create a file called SD.img in the folder where you are, which is a copy of the entire SD card (i.e. 4GB in size or whatever)

Now take out the SD card and put in a second SD that you want to overwrite with a clone of the first. Use 'diskutil list' to check the mount point, then unmount and reverse the copy:

       diskutil unmountDisk /dev/disk2

       sudo dd of=/dev/rdisk2 if=SD.img bs=1m

Again make sure you enter the correct number on /dev/rdisk, otherwise you will wipe some other disk attached to your computer.

You will see many places on the internet give similar instructions with /dev/diskn, rather than /dev/rdiskn. Trust me, the r make everything very much faster (~10minutes to create a 4GB SD card.)

Raspberry Pi is a trademark of the Raspberry Pi Foundation