Thursday, May 23, 2024

Home Media Centre with Raspberry Pi

Raspberry Pi and your LED/LCD TV could be a very interesting combination to try out various DIY projects at home. One such great project is converting your LED/LCD TV into a smart TV and/or a local home media centre.

Fig. 1: Home media centre with Raspberry Pi
Fig. 1: Home media centre with Raspberry Pi

The overall process of turning your LED TV into a smart TV and/or home media centre is mentioned below. But before we start, it is assumed that you are familiar with home-networking concepts of IP address, secure shell (SSH) and Telnet access for Raspberry Pi, setting up OS image on SD card to boot Raspberry Pi, etc.

Choosing the best XBMC implementation

XBMC is an open source initiative that aims at providing a central media centre for various home- and/or Internet-based content consumption. XBMC is available across OS and hardware platforms. Various XBMC implementations are available for Raspberry Pi such as OpenELEC, raspbmc and XBian. I chose raspbmc based on some basic research on the Internet. There are numerous blogs and YouTube videos available to make your own opinion and try out a different variant.

Step 1: Installation and set up of XBMC on Raspberry Pi

Estimated time: 10-15 minutes (also depends on the speed of your Internet connection)

As mentioned earlier, I choose to go with raspbmc for my setup. Depending on your home PC or laptop OS, there are different instructions/steps available on to install the raspbmc image on your SD card. The basic steps are:

- Advertisement -
  1. Take a blank SD card. Recommended is a Class 10 (for better performance) and at least with 4GB of space. I used a Class 10 SD card with 16GB of space for my setup.
  2. Visit and read proper instructions (i.e., for windows, OSX or Linux) and download the image of raspbmc.
  3. Move the raspbmc image to the SD card. Please note that this will reformat the SD card and you would lose all your previous content, if any.

Now you are ready to plug the SD card to your Pi and boot it up. Since there are numerous articles and videos available online for setting/installing raspbmc, it is not important to delve into those steps here.

Step 2: Booting up and initial configuration of raspbmc.

Estimated time: 20-40 minutes (also depends on the speed of your Internet connection)

Please note that in Step 1 only a basic bootable image gets recorded on your SD card. Full raspbmc will set up after you plug it in Raspberry Pi and turn the power on. Hence it is necessary to use high-speed broadband connection and have a wired LAN (RJ-45) cable ready to be plugged in the Raspberry Pi before you boot it up. Again, there are numerous self-help videos available on YouTube and Internet with screen-by-screen coverage which can be followed here. At a high level, below are the steps which I carried out:

- Advertisement -
  1. Plug in the raspbmc formatted SD card in the Raspberry Pi
  2. Plug in the network cable (with access to high-speed broadband Internet connection without any username/password).
  3. Plug in USB keyboard and mouse to be able to navigate and interact with XBMC interface once it is set up.
  4. Plug in the HDMI cable to Raspberry Pi’s HDMI output port and the other end to your LCD/LED TV’s HDMI input port.
  5. Now plug in your USB 5V power cable to the Raspberry Pi USB port and switch it on.
Fig. 2: Remote control app on iPhone
Fig. 2: Remote control app on iPhone

As you switch it on, the bootable image will start up and will show a series of boot log statements on your LCD/LED TV. Now just sit back and watch as it boots up, then connect to raspbmc/XBMC site and start downloading rest of the XBMC package content into your SD card. It will repartition and set up the packages on its own. There will be two to three self-restarts before the XBMC welcome screen pops up.

Step 3: Establishing Wi-Fi connectivity for XBMC.

Once you see the XBMC welcome screen, do some basic configuration and set up Wi-Fi connectivity, which will bail you out from the need of having a permanent wired LAN connection for Raspberry Pi and your TV.

  1. Plug in your Wi-Fi dongle (I used a nano Wi-Fi dongle with 802.11n support) into the USB port. Now there are only two USB ports in Raspberry Pi, so you will have to use a USB port hub to get extra USB ports available to plug in Wi-Fi dongle in addition to the existing USB keyboard and mouse. Please note that the USB hub should have its own power supply.
  2. Go to ‘Program’ menu option in the XBMC screen and click to enter.
  3. Then select ‘Addons’ option and click on ‘Get More…’
  4. After a while, the screen will refresh and present a list of program add-ons which you can install and try out. The one which we are interested in is ‘Network Manager.’
  5. Select ‘Network Manager’ and in the subsequent screen, click on ‘Install.’
  6. Once the installation is complete, XBMC will show ‘Network Manager Add-on Enabled’ message at the bottom of the screen.
  7. You can exit out by a ‘right-click’ or use ‘Home’ icon at the right-bottom corner.
  8. Go back to ‘Program→Add-ons’ and select ‘Network Manager’ which is now listed under available/enabled add-ons.
  9. A window will appear listing a ‘default Wi-Fi network.’ Click on ‘Add’ button and enter the add-on. This will display a list of available Wi-Fi connections in your range.
  10. Select your Wi-Fi network and enter the secret/pass key (if Wi-Fi network is protected) and close the window using ‘x’ button on the top-right corner.
  11. The selected network shall appear in the previous pop-up screen with status connected. You would also see a ‘Network connected and xx.xx.xx.xx IP address’ message at the bottom of the XBMC screen.

Now you are all set with a Wi-Fi network connection and you can safely unplug the wired LAN cable.

At this point, it is advised to shut down or reboot the Raspberry Pi using the ‘power off’ icon on the bottom-left corner of the XBMC screen. In this way, all software updates, installations and configurations would be saved and will be available on the next start-up.

Step 4: Making smartphone/And-roid phone as a remote control

Now it is time to control the entire XBMC screen and menu options remotely with your own Android- or IOS-powered phone. It is assumed that you have an android-powered touch phone or an iPhone, and you know how to connect it to your home Wi-Fi network and locate and install apps from respective app stores.

  1. Search for XBMC remote app in the respective app marketplace. You will see numerous apps listed. You can install any free app.
  2. Open the app, go to settings and enter the connection details (IP address) as shown for your Raspberry Pi + XBMC. You can check your XBMC IP address through ‘System→System Info’ menu option also.
  3. Next, on your XBMC go to ‘System→Services’ options screen and enable ‘Remote control’ option and services.
  4. Press connect the XBMC remote app on your phone.

Now you can navigate the XBMC and even unplug the USB keyboard and mouse using Raspberry Pi.

Step 5: Setting up some add-ons and accessing YouTube

Next, you may explore some of the cool add-ons and embellish your raspbmc setup with nice functions. You can explore various music add-ons to listen to online radio or MP3 sources over Internet, or picture add-ons such as ‘Picasa’ or ‘Flickr’ to view online photo albums. Also, there are various add-ons under video menu, which will bring the huge pool of video content to your TV from sources like live TV sites, or Discovery Channel or NASA videos or Khan Academy or YouTube. Then there are a host of program add-ons which bring in functionalities like accessing your mail, IRC Chat or Facebook content, or even some games like Sudoku and Tetris.

Note that watching and accessing online content requires decent bandwidth speed (around 2 Mbps or more) and lot of monthly data usage; so make sure you have both in abundance.

Troubleshooting tips

During setup I faced a couple of issues and so thought of listing down some of them under this section as there is no single online article or video which comprehensively captures these issues. The solution to these issues is located across various community forums and discussion boards, and extensive research is needed to get the right answers.

1. Intermittent hang-up of Raspberry Pi

A couple of times during setup, Raspberry Pi becomes unresponsive—requiring it to be turned off and on to resume the setup/configuration. After a bit of R&D, I found that the issue is related to a poor or unstable 5V DC supply. So please make sure that you have plugged in a reliable 5V DC supply in Raspberry Pi with significant amperage. Refer to the link for more details:

2. No HDMI output.

Whilst powering on Raspberry Pi, if your LCD/LED TV is not on, or is running from a different HDMI input source, Raspberry Pi/raspbmc does not send any output on its HDMI port, even when you switch the HDMI in TV to the one plugged in from Raspberry Pi.

This gets resolved by making the below-mentioned entries in the /boot/config.txt file in raspbmc.


You need to SSH/Telnet into raspbmc using ‘pi’ user id (default password is raspberry) and do a ‘sudo vi/boot/config.txt’ to edit it.

3. Issue with Bluetooth/wireless keyboard

Later on I also bought a wireless keyboard with touchpad (Logitech K400r) to comfortably browse and explore raspbmc. You need to plug the USB dongle (Bluetooth or the one that comes with your wireless keyboard) and the keyboard connects automatically. However, on subsequent restarts, sometimes the wireless keyboard stops connecting. This gets resolved by making the below-mentioned entries in /etc/rc.local:

sleep 2
rmmod hid-logitech-dj
sleep 3
modprobe hid-logitech-dj
exit 0

Other possibilities to explore

  1. Connecting to Facebook and accessing your Facebook feeds from your TV.
  2. Setting up your favourite RSS news feeds which would scroll on your XBMC console.
  3. Configuring a USB TV tuner card in your Raspberry Pi and leverage the TV headend server, which is now in-built in the XBMC package. This gives you immense control on playing and recording a variety of free-to-air TV channels
  4. Configuring your personal pictures and/or videos or movies through a shared storage (home network storage) and access from your XBMC.
  5. Play your video from your iPhone/Android phone, laptop or iMac/MacBook and stream it via Airplay on to your LED TV through raspbmc.
  6. In case you have home automation setup, there are some nice add-ons to explore which bring entire home automation control panel to your LED TV.

I have not explored all the possibilities here, but there are numerous articles, blogs and self-help videos available online to get you going.

Nikhil is an architect working with a leading software development and service provider. He is based at Pune and has keen interest in technology and computers


Unique DIY Projects

Electronics News

Truly Innovative Tech

MOst Popular Videos

Electronics Components