Raspberry Pi 2 as media center

Raspberry Pi 2

Did you ever aks yourself if a new TV is really necessary only because of the "smartness" it offers?
The new Raspberry Pi 2 gives a clear answer:
Buy a Pi and it provides the smartness for a fraction of the costs.

Equipped with a 900MHz quad-core ARM Cortex-A7 CPU, a Full HDMI port and a VideoCore IV 3D graphics core, the new Pi comes with enough computing power to do the job. Linux and Kodi, the Open Source Home Theater Software, unleash the smartness.

Setting up your new multi media station is done in three easy steps.

Purchasing the hardware

Many stores offer the Pi as a starter kit which ensures you have large enough power supply and at least a housing that fits. If you want to support this page, please use the amazon link on the top. It points to a starter kit which will do the job.

The operating system the Pi runs on, is stored on a micro SD card. Most of these kits also include one with preinstalled NOOBS (New Out Of the Box Software). If you don't want to overwrite this with during the installation of Kodi, I suggest you add a spare one.  To easily interact with the Pi I recommend to buy a multimedia bluetooth keyboard.a as well.  The Logitech K400 worked out of the box.

Preparing the sd card

We will install OSMC which stands for Open Source Media Center. It is a Linux distribution based on Debian which umong others, brings Kodi to the Raspberry Pi 2.

  1. Put the micro sd card into a USB-reader and connect it to your computer
  2. Visit the OSMC download page and optain the downloader for your operating system. Simply scroll down and click on the download link for your OS.
  3. Install and run the downloader. Under linux I had to select the following options
    1. Language -> English
    2. Hardware to install OSMC on -> Raspberry Pi 2
    3. Version -> simply choose the latest
    4. Installation medium -> SD card
    5. How does the Pi access the web. -> wired if you use the ethernet port and wireless should you choose the usb WLAN adapter from the kit
    6. Device -> Select the device pointing to your sd card

Starting up Kodi

After we prepared the sd card, insert it into the sd card slot located at the bottom of the pi, connect the network cable, HDMI cable connected to your TV. Swith on the TV and connect the power supply to your Pi. On the first run, OSMC takes a few minutes tos finishing the installtion and after a short reboot you can enjoy your new home cinema solution.

Most questions on how to use Kodi are answered in the kodi wiki.

Sharing is Caring :-)

Please share this article if it was useful for you.

Appendix: Configuration beyond the Kodi UI (for experts only)

Connecting via ssh to the Pi (username and password are osmc), I configured the underlying LInux system as follows:

Always use HDMI

As a default, the HDMI port is only active if a TV/Monitor is detected. Should you turn on your TV after your PI, you first need to reboot. To avoid this we add the following two lines to /boot/config.txt file.

hdmi_force_hotplug=1
hdmi_drive=2

Mount the NAS via sshfs during startup

Sshfs allows you to mount your NAS using an encrypted connection. Quite handy if you are on a wireless network and nobody shall be able to read your traffic. To activate it the following steps are needed

  1. Install sshfs
    $ sudo apt-get update; sudo apt-get install sshfs
  2. Change one line in /etc/fuse.conf to
    enable user_allow_other
  3. Add your server and mount point to /etc/fstab
    USER@NAS:/DIRECTORY  /MOUNTPOINT  fuse.sshfs _netdev,user,idmap=user,transform_symlinks,identityfile=/home/osmc/.ssh/id_rsa,allow_other,default_permissions,uid=1000,gid=1000 0 0
    Replace USER, NAS, DIRECTORY and MOUNTPOINT with your values and adapt uid, gid if neede
  4. Generate the ssh-key mentioned above
    $ ssh-keygen
    Now add the content of  /home/osmc/.ssh/id_rsa.pub to your ~/.ssh/authorized_keys file on your NAS