A while back I finally got my 512MB revision 2 model Raspberry Pi to successfully run OpenELEC. The picture to the right shows it running, using a shared network mount to access all of my media files.
Some folks requested a write-up detailing how I put everything together, so I’m going to try and provide a generalized walkthrough for those with the initiative to do something like this. Although I’m not assuming you’re a Linux guru, there’s some technical aspects to this - but it’s worth the effort.
Introduction
Why?
Doing this is worthwhile because the final product is:
- Cheap. If you buy everything needed, it’ll only cost about $50~60. $35 is the lower bound.
- Versatile. The controller works on iOS or Android, and can read media in a variety of ways.
- Freakin sweet. fo real though.
I’ve even got an Apple TV as well, and I found making this HTPC was worth the effort and didn’t duplicate too much of my Apple TV’s functionality.
Parts
There are a few different components to this set-up, so here is the high-level run down:
- The Raspberry Pi is the hardware we’ll build the HTPC on. The Raspberry Pi foundation has recently upgraded the model to revision 2, which doubles the RAM - very nice. In addition, there are lots of other things you can do with a Raspberry Pi aside from making an HTPC should you want to repurpose it.
- OpenELEC makes an OS image for the Raspberry Pi that uses XBMC for a media center front-end. XBMC is a mature project that has a lot of great features.
- I’m using an Asus RT-N66U with Tomato USB firmware, but there are multiple options you can use for file sharing. Tomato USB router set up is a whole other blog post.
Here’s what you’ll need in terms of actual equipment. Note that if you already have hardware that fills one of these requirements (like an SD card or Android charger that fits the Pi) you don’t necessarily need all of these.
I’ve bought my boards through MCM Electronics, who have been pretty good about shipping them quickly. Because Raspberry Pi’s are in such high demand, some suppliers can take forever, but MCM is pretty consistent. They also have a dedicated Raspberry Pi page, which can help with a lot of this.
- $35 - The Raspberry Pi model B board (the revision 2 512MB board is needed, revision 1 has issues running over HDMI and powering the wireless-N adapter simultaneously)
- $9 - A Pi-compatible SD card
- $7 - Micro USB power supply
- $8 - A case for the pi (optional, I like having one)
- $15 - Wireless-N adapter if you don’t have a cable that’ll reach your router
Aside from these essentials, there are some miscellaneous things I didn’t include that you’ll need to take in to account to make sure you can complete everything:
- USB Keyboard for the initial setup (so that you can configure wireless and get everything ready for your remote app. Once you’ve got the remote configured, you won’t need this any more)
- A display to connect the Pi to (and the cable to do so.) I have a HDMI cable connected to my TV.
I’m also assuming that there’s a wireless-N network available for the adapter to use (if you have an ethernet cable that can reach your router, that’ll work too.)
How-To
In order to get this thing up and running, let’s start with the Raspberry Pi.
The Pi
The first step is installing OpenELEC. There are pretty straightforward steps for OS X or Linux, but there’s an additional tutorial explaining how to install it on Windows as well.
After you’ve got OpenELEC installed on the SD card, assemble your Pi. Put the Pi in the case (if you have one), insert the SD card, and connect the HDMI cable, keyboard, AC adapter, and your network adapter (either an ethernet cable or the wireless-N USB dongle.) OpenELEC is fairly hands-off, so once you finally plug the power in (note that there’s no switch for power on the Pi - just plug/unplug the power), you should see an interface on the screen you’ve connected it to (wait a while for it to show up, it can take a minute to load.)
With an ethernet cable, networking should work right off the bat. If you’ve got the wireless adapter, the Pi should recognize the hardware itself but may need wifi configuration. The following should get networking started with a wireless adapter:
- With the Pi up, use the keyboard to navigate to Programs → OpenELEC OS Settings
- Go to the Networking tab at the top (there may be multiple networking tabs, choose the first)
- There should be a field that has eth0 selected. Click the arrows until wlan0 is there instead
- Enter the SSID for your wireless network (the network name)
- Enter your password in the correct field (I hope you’re using a WPA2-protected network…)
- Click OK then reboot the Pi. Hit escape on your keyboard a few times to get back to the XBMC home screen and then click on the power button in the lower corner to restart the Pi
Once that’s done, networking should be up.
OpenELEC Tweaks
Now your Pi is operational. The next step is to clean up a few things on OpenELEC.
XBMC Remote
You don’t want to use a keyboard constantly with XMBC, so setting up a remote app with your smartphone is a good idea.
- Navigate to System → Networking → Services
- Enable “Allow Control of XBMC via HTTP”
- Take note of or change the user name
- Enter a password
- Restart the Pi again
Once it restarts, you’ll need to find the IP address of the Pi (find it by looking at System → System Info.) Search either the App Store or the Android Marketplace for an XBMC remote. Personally, I’ve got an iPhone so I got this remote and it works really well.
In your new app for XBMC, enter the IP address you found for the XBMC server and your username and password, if you changed those (these settings will work differently with each different app out there, so just use your best judgement.)
With the remote configured, you should now be able to control all aspects of the Pi through your XBMC app (as long as you’re connected to the same network as the Pi - basically, as long as you can reach the Pi’s IP address.) At this point the keyboard isn’t needed any more.
Other Settings
Expore some of the options that OpenELEC has. Among these I would recommend looking at:
- Change OpenELEC to update automatically. This is found through Programs → OpenELEC OS Settings. Doing so makes the HTPC more hands-off.
- Set the Pi to automatically sleep/hibernate through the same menu. It’ll save some wear and tear on the SD card, which has a limited number of writes.
- Ensure your video settings are correct. Set the highest resolution your display can support, then tweak the display to fit the picture to the display.
Now we come to the most important part: getting media on XBMC.
Multimedia
There are a few different options to get videos on the Pi.
I have a network share that provides access to all of my media files. I’m going to build a dedicated NAS this summer, but for now this is a fairly simple set up: I have an external 1TB HDD connected via USB to my router, which can directly share directories over SMB. This means that I open OpenELEC, select Video, and add a new source by browsing my network for the share with my videos on it. OpenELEC will actually try to autodetect the content and download metadata for it, which is awesome.
If something like that sounds appealing to you, then you can pretty easily share a folder on Windows and add a new source to OpenELEC. Sharing folders through Windows is a bit beyond the scope of this post, but in order to start try reading up on it here.
Another option is to load up all of your media onto an external drive and connect it directly to one of the Pi’s USB ports. After the media is on the drive, connecting it to the Pi just needs to be followed by adding your media (go to the Video main menu option and then add a new source, browsing to the drive you connected to find media files - just find the name of the drive in the window that opens up.)
If there’s one weakness to this set up, it’s this part - you need some pre-existing media to make it work, unlike the Apple TV wherein apps like Netflix and Hulu Plus allow you to use some pre-existing subscriptions to access media. However, if you have a movie collection on some digital media, this is a very good way to use it.
Conclusion
What I’ve covered here is fairly high-level, and there’s a bit more to configure if you want more functionality.
If there are any other points of this setup that anyone would like me to further elaborate upon, send me an email and I’ll either revise this post or do another writeup along the topic that needs clarification.