Last week I received my Raspberry Pi, pre-ordered from Farnell several months ago. The idea behind this (quite literally!) credit card-sized PC is for kids to get to grips with programming, much in the same vein as those of us from the 80s who had to input commands to get those games booted up. There’s none of that nowadays – it’s simply a case of ‘click and play’.
Why did I buy a Raspberry Pi? Partly out of curiosity, and partly out of sheer geekery, but mainly because this handy little device is a useful tool for teaching me the basics of programming. So, with this in mind, I wanted to put together a small tutorial on how to set up the Raspberry Pi, the things you’ll need to get going and the method of installing an operating system on an SD card using the Terminal on the iMac.
Things you will need to get going
- Raspberry Pi – yes, this goes without saying
- Micro USB power cable. I used my Kindle USB cable, which fits perfectly, but there are various mobile phone adapters you can use too
- HDMI cable
- Ethernet LAN cable
- USB keyboard and mouse
- SD card (at least 4gb)
Setting up the SD card using an iMac
To set up the SD card correctly, you’ll need a self-booting operating system. I want show how to do this the relatively hard way because I believe it helps you get to grips with using the Terminal – the scary white box.
- To access the Terminal, go to Applications – Utilities and you’ll find it in there. Drag it to the Toolbar, as you’ll be using this quite a lot.
First things first. Download the operating system here. The default login details are Username: pi, password: raspberry.
And, follow these instructions (taken from http://elinux.org/RPi_Easy_SD_Card_Setup):
- Verify if the the hash key is the same (optional), in the terminal run:
- shasum ~/Downloads/debian6-19-04-2012.zip
- Extract the image:
- unzip ~/Downloads/debian6-19-04-2012.zip
- (or: just double click the zip, it will extract automatically)
- From the terminal run df -h
- Connect the sdcard reader with the sdcard inside
- Run df -h again and look for the new device that wasn’t listed last time. Record the device name of the filesystem’s partition, e.g. /dev/disk1s1
- Unmount the partition so that you will be allowed to overwrite the disk:
- diskutil unmount /dev/disk1s1
- (or: open Disk Utility and unmount the partition of the sdcard (do not eject it, or you have to reconnect it))
- Using the device name of the partition work out the raw device name for the entire disk, by missing out the final “s1″ and replacing “disk” with “rdisk”:
- e.g. /dev/disk1s1 => /dev/rdisk1
- In the terminal write the image to the card with this command, using the raw disk device name from above:
- dd bs=1m if=~/Downloads/debian6-19-04-2012/debian6-19-04-2012.img of=/dev/rdisk1
- (note that dd will not feedback any information until it is finished, information will show and disk will re-mount when complete)
- After the dd command finishes, eject the card:
- diskutil eject /dev/rdisk1
- (or: open Disk Utility and eject the sdcard)
- Insert it in the raspberry pi, and have fun
Hope this guide helps. as time goes on, I aim to write more about my Raspberry Pi experiences, including some of the funky stuff possible with PHP. Visit the Raspberry Pi website here.