Wednesday, June 19, 2013

My Journey with the Raspberry Pi

So in an effort to clean my blog up and stop having posts that cover multiple topics which is bad for searching and finding useful information, I'm consolidation topics. This is a consolidation of previous posts on information on the Raspberry Pi.



So in early May this year, I order my Raspberry Pi. I ordered it from the Element14 and also got some accessories at the same time. In hind sight I shouldn't have bought one of these, the memory card, as I found out later its quite easy to download the images and then flash them onto a SD card for use.

Anyway, I had decided that I had two possible uses for my Raspberry Pi. These were for a file server or as a media streaming device. I don't have any need to use it for playing with electronics like it was originally was designed for, as I had already been playing with AVR chips (same type as used for arduino) and had bought an ARM development kit in the same order.

So I decided I would test it out as an Airplay server first then add on a file server (AFP/netatalk). I had ordered Raspbian on a SD card when I bought the Raspberry Pi. The Raspberry Pi was very easy to setup and comes with a nice installation procedure. The only thing I didn't do at install and then regretted was setting overscan. This was because once I restarted after installation, I couldn't see the command prompt or the left hand side of the screen (I had it plugged into my TV via HDMI). This was easy fixed though by changing the config.txt file on the SD card. AirPlay was easy to setup using Shairport (there are lots of blogs on how to do this) and HDMI was easy to setup too. I thought HDMI wasn't working at first until I tried using HDMI audio on my tv and it magically started working. It turns out my Yamaha Receiver only has pass through HDMI audio which I didn't realise when I bought it. So for now I'm using the DAC for audio out as I'm only doing the setup on the TV for this usage. The audio isn't as bad as people make it out to be, it just isn't as fast as it could be and so doesn't output very fast music very well.

So I then installed netatalk to act as a Time Machine server. This all went smoothly and I added a few things to my configuration that the online guides don't mention. These were, that I setup TimeMachine with a quota so it wouldn't use all the disc space and also user and password protected shares. I also disabled avahi (mdns). In my opinion it just uses network bandwidth for not much gain. I can easily type in the address of the server plus mdns does not work over subnets.

Using TimeMachine made me realise a major downside with using a Raspberry Pi. This is that due to the Ethernet and External HD both being on the same USB controller, its bloody slow! For example, It took the equivalent of 2 days to backup my laptop with 250GB of data which would take a few hours if the external HD was plugged in directly. So I don't think it is such a great option for backing up large amounts of data.

Due to this speed issue, I decided I would change over use to a media server for the TV. I might consider using a Raspberry Pi in the future for file storage but not for system backups, maybe as a code/SVN server.

So I have now installed xbian on another SD card and am currently using this. This took a bit of effort to setup as it comes with only the bare minimum unlike alternatives such as Raspbmc. Extra things I needed to setup from the command line were, time using ntp, proxy, static network and adding some extra users. All was relatively easy, but I needed to install apititude as wasn't installed by default and replaced vi with vim (vi is a pet peeve of mine).

Even though the proxy was set in XBMC and in linux itself sections of code were still ignoring this setting. I had a stroke of genius after finding it was ignoring the proxy settings though. This was to setup iptables and use its routing capabilities to route any traffic that was trying to go out directly on port 80 to be redirected to the proxy server. It now works great.

I added some extra plugs-in like, ABC iView, YouTube, Vimeo and a couple of other random plug ins.

So far I've been using my phone to control XMBC but as I want my parents to be able to use the device I'm going to set it up with an IR receiver and configure it for a remote. I'm hoping that if I go to the tip shop, they should have plenty of old remotes that I can use.

The other thing with the Raspberry Pi and XMBC is I'm thinking I might try and make a plug in that can stream Beyonwiz content via their WizPNP protocol. There are plenty of open source implementations of this protocol so shouldn't be too hard. My sole reason for doing this is so we can use a Raspberry Pi to stream video off to another TV rather than buying a new Beyonwiz which I don't think they are even updating any more.

After playing with XMBC for a while now, I think if I was to buy a PVR now, I would use a XMBC device seeing how well it works on the Raspberry Pi.

I'll update this post when I get the remote fixed up which will should be soon now that my last exam is tomorrow.