My New Raspberry Pi


So, after 6 months of wait­ing, a Raspberry Pi finally arrived in the mail a few days ago and I’ve finally had the chance to play with it.

Brand New Pi

In case you don’t know, a Rasp­berry Pi is a tiny, inex­pen­sive com­puter sold mainly for edu­ca­tional use. It’s only about the size of a credit card (it would fit in an Altoids tin if only the cor­ners were round­ed) and costs about $35 before shipping.1 They’re a new thing and are very pop­u­lar so the out­fit which is mak­ing them is hav­ing trou­ble keep­ing up with demand. 2 Of course, I had to have one too.

Here’s a pic­ture of the Pi; it’s the small cir­cuit board. I placed it next to my metro card to give a sense of scale:

Unboxed Pi

So I have projects planned for this device, but for starters, I decided to set up an MPD based juke­box. The Pi would act as the server, con­nected to my net­work, and the music would be stored on a USB hard drive that I have lying around. I would be able to con­trol the juke­box from any of my com­put­ers or from my phone, so long as I’m home. I’d be able to lis­ten to my music col­lec­tion with­out turn­ing on my desk­top com­put­er, which uses a lot of elec­tric­i­ty. The Pi by com­par­ison, uses almost none.

Inter­est­ing­ly, the Rasp­berry Pi comes with no acces­sories or periph­er­als, not even those nec­es­sary for it’s func­tion­ing. At a bare min­i­mum, the Pi needs a USB power sup­ply and an SD card to act as the hard drive. I have an Android phone and a Kin­dle both of which came with USB power sup­plies so I was cov­ered on that front, but the SD card I had to buy. The Pi also needs a dis­play and input devices. A mouse and key­board can be attached through the USB ports but the Pi only has a HDMI and RCA out­puts for video so I needed an adapter to get it to work with my mon­i­tor.

Any­way, I down­loaded the default oper­at­ing sys­tem for the Pi, the one based on Raspbian. I con­sid­ered using the Arch Linux ver­sion since that’s what I use on my desk­top and lap­top but decided to start with the sug­gested method. I flashed the SD card, inserted it, and booted the device. I turned on SSH, changed the pass­word and turned the device off. I could then con­trol the Pi with­out using up a mon­i­tor and key­board on it.

An SSH login on my Pi:

Raspberry Pi SSH Session

I plugged in my speak­ers and the USB hard drive and I con­nected the PI to the net­work. I logged into it and installed MPD, and MPlayer:

sudo apt-get install mplayer
sudo apt-get install mpd mpc

MPD is a music player dae­mon, which is a music player pro­gram which runs in the back­ground and can be con­trolled over the net­work. I mounted the USB hard drive:

sudo mount /dev/sda1 /mnt -o rw

and checked to see it would play music:

mplayer /mnt/music/<a song name>

It worked!

I set MPD to point to the music direc­tory and lis­ten on the network:

sudo vi /etc/mpd.conf

music_directory "/mnt/music"
...
bind_to_address "192.168.1.-"

and started it up:

sudo /etc/init.d/mpd start
mpc update

and now it works. I installed an MPD client on my phone and now I can use it to change the playlist and what­not.

This is the whole setup right here:

Raspberry Jukebox

This was a really easy project and I have some ideas for more ambi­tious projects for the Rasp­berry Pi, but on those as I actu­ally get to them.

  1. This is Model B, which is the one I ordered. The Model A is only $25 but has no network ports. 
  2. This is partly why it took them so long to ship my mine. There are only two primary suppliers, RS and Farnell. I ordered mine from RS. Apparently Farnell is much more efficient. 

Last update: 01/12/2012

blog comments powered by Disqus