Saturday, 26 May 2012

Raspberry Pi: Getting Started & First Impressions


One would only have to remove the unnecessary RCA and 3.5 jacks, the positively extravagant dual USB "tower", the ethernet port of yesteryear, and snip the tops off the JTAG headers. Then this little beauty could slip snugly into a wallet, alongside Visa, Mastercard and that well-intentioned gym membership card.

Yes folks, this past week the Raspberry Pi has been rolling off production lines and into expectant sweaty paws around the country. I was fortunate to receive mine a couple of days ago, and today has been my first opportunity to try it out for size.

First impressions: it's small. Really small. I've never before owned a computer which I risk misplacing beneath my TODO list.

Next up, it boots (unlike my main rig, which has its own troubles at present). No problems there, it took a mere minute before I was sitting in front of an LXDE desktop under Debian.

Third, it's nippier than I expected. For a CPU which is said to compare to a 300MHz PII, this handles the rigours of a modern linux desktop quite nicely. Opening the PCManFM file manager takes but a second. Opening the Midori web browser takes a few more. Browsing to a simple webpage spikes the CPU only momentarily.

It's not all good news; a complex webpage maxes the ARM chip for some seconds. The GUI isn't awfully responsive in general. And, one all is said and done, 186MB of accessible RAM is rather limited. This is no cheetah, and struggles even with this basic LXDE desktop environment. However, it is just sufficient to run it bearably - and that's the point.

For those of you firing up your Pis over the coming days and weeks, here's a very brief "getting started" guide - although all the information you need, and much more, is available on the excellent Raspberry Pi wiki (and do take note of the encouragement for contributions).

You'll require:

  • a SD card, 2GB or more. Preferably a more expensive card with better read/write performance. In general terms, they're divided into classes, with class 10 being the fastest. Check to see if it's supported before buying.
  • a means of connecting it to another computer (such as a USB SD card adapter, which you can pick up very cheaply - around 2 GBP). I used an Integral SDHC USB2 SD card adapter.
  • another computer
  • a power adapter (make sure it's 5V, and around 1A). Many phone chargers fit the bill perfectly. I had a spare HTC charger lying around that works just fine. 
  • a USB keyboard. If you plan to use the GUI, a USB mouse too. Getting a combination wireless USB keyboard and mouse is a good idea, since then you only need to use the one wireless dongle.
  • a means of connecting it to your display. This will probably be either a HDMI cable, or a HDMI -> DVI-D adapter cable. Alternatively, you can use an RCA cable, or work out an alternate solution, such as with a HDMI -> DP adapter. 
Then there are the optional components, depending on how you plan to use it. An ethernet cable; a wireless USB dongle (again, check for compatibility on the wiki), a 3.5" audio cable, a USB flash drive for more storage, a powered USB hub to increase the number of USB ports or in case some devices need more power, etc. For the record, a powered USB hub strikes me as a good idea in this case.

To get up and running, you first download one of the Linux distro images (I also recommend starting with Debian). The following instructions assume you're working on Linux:

$ wget http://downloads.raspberrypi.org/images/debian/6/debian6-19-04-2012/debian6-19-04-2012.zip
$ sha1sum debian6-19-04-2012.zip | grep 1852df83a11ee7083ca0e5f3fb41f93ecc59b1c8 && echo "Success" || echo "File is corrupted. You need to download it again"
$ unzip debian6-19-04-2012.zip
$ cd debian6-19-04-2012

Now connect your SD card and verify that it's visible to the computer. There are detailed instructions for this on the wiki. You can use df, mount, lsusb, or a plethora of other methods to find out what the mountpoint of the device is. Once you know this, unmount the device (if it auto-mounted) and copy across the image file:

# dd if=debian6-19-04-2012.img of=/dev/pathToTheDevice bs=1M

Note that if you're performing this step under FreeBSD, replace the sha1sum command with sha1, and use # camcontrol devlist to find out the mountpoint of the SD card.

This gives you your bootable SD card. All that remains is to insert it into the Pi, connect your display cable, your keyboard & mouse, and network if you desire, and finally connect your power adapter cable. Your Pi will start booting automatically.

For those interested, the package you'll receive is rather basic compared to what you might get with a typical off-the-shelf computer. It consists of a small cardboard box with some labels plastered over it, inside of which is an anti-static bag containing the Pi itself. 

It may not be much. But, quite frankly, what more does one need?