Wednesday, 13 June 2012

Pi Server

Back in February I registered my interest in the Raspberry Pi, an inexpensive computer supplied as a small PCB with no case, based on ARM system-on-a-chip, which boots its OS from an SD card. It has 2 USB ports, ethernet, HDMI out, audio out, power in and some GPIO connectors to connect it to whatever you want. It is intended, at first, that it will run Debian Linux. Shortly afterwards, I was invited to place an order. A couple of weeks ago, it arrived.

It wasn't too hard to get Linux running on it, using a flat screen TV via the HDMI port and a USB wireless keyboard & mouse. The TV also has a USB port, which provided enough power to run the Raspberry Pi and the USB K & M.

I'm a complete newbie to Linux, and have had very little exposure to Unix (and none as a sys admin), so the first week all the time I spent with it was used getting some basic functionality out of it. Starting SSH and installing VNC turned out to be fairly simple, and removed the need for the keyboard, mouse and TV, since they allow me to use it remotely from another PC on the network, or even an Android tablet, it turns out.

Then I learned that Thomas Ruehl has got Logitech media server (and a selection of other media servers) running on one, which raised an interesting possibility. I have a Squeezebox duet, served from a PC in the next room, but the idea of using a tiny, low-power, low-noise, low-cost computer to do the job instead was very appealing.

I downloaded the SD card image, wrote it onto a card and went through the setup procedure, using an old 40GB 2.5" drive in a USB case with some MP3 files as the music library. This worked very well, but 40GB isn't big enough for my music collection, which is mostly flac files ripped from my CDs. I have all of these on an external 3.5" USB drive and set up this as the music library, which also worked well. I wasn't happy with that solution though as a) that drive also holds a backup of my digital photos and b) it runs off a 12V supply. The Raspberry Pi needs 5V so if I were to use a 3.5" drive for my music server I'd need to use 2 power supplies or an over-rated 12V supply with a regulator to give 5V in addition.

I considered getting a SSD, so there would be no moving parts and no noise at all, but rejected the idea as I wanted to keep costs down. Using a 2.5" drive seemed the better option, then I'd just need a 5V supply big enough to power both devices. I have one of those - it used to power an external SCSI magneto-optical drive and is rated at 5V, 2.5A. More than enough. A quick visit to Ebay got me a nice little Freecom 160GB USB drive, big enough to hold all my music with a bit of expansion room

Construction
Holding the Rasperry Pi board is a little awkward.  2 of the corners have some sort of connector in them and there are no convenient mounting holes.  My solution was to make some pillars out of plastic rod, attach them to the lid of the USB drive case with countersunk screws from the inside, and cut suitable slots in them so as not to interfere with the connectors whilst allowing the corners of the Raspberry Pi board to be held.

A length of sheet steel (actually from part of an old PC case) forms a mounting plate for the power input, fuse and switch. It was bent along the edges for rigidity, except for a section at each end which wrap around 2 of the plastic pillars to hold it in place.  The power connection to the Raspberry Pi board is made directly to the supply decoupling capacitor, bypassing the boards thermal fuse.  An alternative fuse is therefore a good idea.


Here's the back of the USB drive - I just used a short (ish) USB lead to connect to the Raspberry Pi.  The power lead to the USB drive shares the power supply to the Raspberry Pi.


I've also drilled & tapped the top ends of the pillars, so I can add a lid, or even a complete cover, later.

It is working very well, no hiccups or dropouts and is very quiet.  As soon as I can get my hands on another Raspberry Pi, I'm going to leave this one dedicated to being a Pi Server.

Thanks to Thomas Ruehl for his excellent work with the software, Logitech for keeping their media server software open source, the Raspberry Pi foundation and ebay user expressit for getting the USB drive to me very quickly.

1 comment:

  1. I love it! I have a pi and have it working with get_iplayer right now and hope to get XBMC and now maybe even the Logitech streamer going on it...

    ReplyDelete