So, after 6 months of waiting, a Raspberry Pi finally arrived in the mail a few days ago and I’ve finally had the chance to play with it.
In case you don’t know, a Raspberry Pi is a tiny, inexpensive computer sold mainly for educational use. It’s only about the size of a credit card (it would fit in an Altoids tin if only the corners were rounded) and costs about $35 before shipping.1 They’re a new thing and are very popular so the outfit which is making them is having trouble keeping up with demand. 2 Of course, I had to have one too.
Here’s a picture of the Pi; it’s the small circuit board. I placed it next to my metro card to give a sense of scale:
So I have projects planned for this device, but for starters, I decided to set up an MPD based jukebox. The Pi would act as the server, connected to my network, and the music would be stored on a USB hard drive that I have lying around. I would be able to control the jukebox from any of my computers or from my phone, so long as I’m home. I’d be able to listen to my music collection without turning on my desktop computer, which uses a lot of electricity. The Pi by comparison, uses almost none.
Interestingly, the Raspberry Pi comes with no accessories or peripherals, not even those necessary for it’s functioning. At a bare minimum, the Pi needs a USB power supply and an SD card to act as the hard drive. I have an Android phone and a Kindle both of which came with USB power supplies so I was covered on that front, but the SD card I had to buy. The Pi also needs a display and input devices. A mouse and keyboard can be attached through the USB ports but the Pi only has a HDMI and RCA outputs for video so I needed an adapter to get it to work with my monitor.
Anyway, I downloaded the default operating system for the Pi, the one based on Raspbian. I considered using the Arch Linux version since that’s what I use on my desktop and laptop but decided to start with the suggested method. I flashed the SD card, inserted it, and booted the device. I turned on SSH, changed the password and turned the device off. I could then control the Pi without using up a monitor and keyboard on it.
An SSH login on my Pi:
I plugged in my speakers and the USB hard drive and I connected the PI to the network. 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 daemon, which is a music player program which runs in the background and can be controlled over the network. 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 directory and listen 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 whatnot.
This is the whole setup right here:
This was a really easy project and I have some ideas for more ambitious projects for the Raspberry Pi, but on those as I actually get to them.