Reader small image

You're reading from  Raspberry Pi Android Projects

Product typeBook
Published inSep 2015
Reading LevelBeginner
Publisher
ISBN-139781785887024
Edition1st Edition
Languages
Right arrow
Author (1)
Gökhan Kurt
Gökhan Kurt
author image
Gökhan Kurt

Gkhan Kurt has been trying to keep up with the the latest developments in technology and IT in his 15-year-long development career. For the past 4 years, he has been working at IFS Labs, one of the top innovation departments of the Swedish software industry. Currently, he is involved in the Internet of Things and has been developing prototype IoT implementations using Raspberry Pi. He has a master's of science degree from Chalmers University of Technology and a bachelors degree from the Middle East Technical University. You can connect with him on Twitter and on LinkedIn.
Read more about Gökhan Kurt

Right arrow

Chapter 4. Turn Your Pi into a Media Center

We have been administering our Pi and implementing useful projects in the previous chapters. In this chapter, we will use our Pi more as a source of entertainment and turn it into a media center. The topics covered are as follows:

  • Installing and setting up a media center on the Pi

  • Connecting to a media center via remote control from Android

  • Getting more from your media center

  • Installing a media center using NOOBS

Installing and setting up a media center on Pi


The media center software we've chosen for the purpose of this project is Kodi, formerly known as XBMC. It is open source and widely used with lots of add-ons.

As usual, we will start by installing the necessary software on our Pi using the apt-get command:

sudo apt-get install kodi

Then, we'll run the kodi-standalone executable, which will start Kodi and show its user interface on the HDMI port of the Pi. It is, therefore, important that you connect the Pi to a screen using the HDMI port instead of a remote desktop to see Kodi's user interface. Now, you can connect a USB keyboard or mouse to navigate inside Kodi.

Starting Kodi on boot

We definitely do not want to run a command to start the media center, no matter how easy it is to run commands from Android, as discussed in previous chapters. For this reason, we need to start the command on startup using the crontab -e command. Add the following line at the end of the file the crontab command command...

Connecting to the media center via remote control from Android


The main problem with the current setup is that you can only control the media center using a connected keyboard or mouse, making it not as comfortable to use as a media center should be. However, there is a remote control for Kodi on Android, called Kore, that makes it really easy to remotely control the media center. You can download it from Google Play. Its official name is Kore, Official Remote for Kodi and it is published by the XBMC Foundation, which is a nonprofit organization that operates the Kodi Media Center project.

Before you can connect the remote control application on Android to the Kodi installation on the Pi, you need to make some setup changes on Kodi. Go to the SYSTEM menu in Kodi, and then Settings, Services, and Webserver. Here, you should select Allow control of Kodi via HTTP. Then go to the Remote control settings in same menu and enable the Allow programs on this system to control XBMC and Allow programs...

Getting more from your media center


There are many things a media center can be used for. You can, for example, download add-ons that give you access to lots of online content, such as YouTube, Khan Academy, and TED Talks.

Watching videos using Kodi on an Android device

Another interesting thing you can do is to upload video from your phone to the Pi using the previously discussed AndFTP app from Chapter 2, Server Management with Pi, and then watch movies using the media center. You need to add a directory on to the Pi where you will upload these files as a media location in Kodi. Go to Videos | Files | Files, and then navigate to Add Videos.... Here, you should first select Browse, and then Root filesystem. Note that we were using /home/pi as the target for uploads in Chapter 2, Server Management with Pi. It should work even in this case. Browse down to this location and click on OK on all three pop ups. You should now see the Pi in the list of Videos on Kodi. You can even add this folder...

Installing the media center using NOOBS


Another option for installing the media center onto the Pi is using NOOBS. This way, users can very easily install the media center without worrying about details related to Raspbian OS, as we did in this chapter. We have already covered the NOOBS installation in Chapter 1, Make a Remote Desktop Connection to Your Pi from Anywhere. However, in Chapter 1, Make a Remote Desktop Connection to Your Pi from Anywhere, we used the offline installation option. We can use the online installation option instead. You should download the online NOOBS installer from http://downloads.raspberrypi.org/NOOBS_lite_latest. This ZIP file is much smaller but you need to connect the Pi to an Ethernet network before you begin installation. Extract the contents of the file to an SD card and restart your Pi with this SD card inserted. Now, you will see a list of operating systems to install. The list contains two media centers as well. These are OpenELEC and OSMC. Both are...

Summary


This chapter was short, but fun. We have learned to install on our Pi and set up one of the most widely used media centers and control it remotely from our Android device.

In the next chapter, we will get our hands dirty and begin some Python and Android programming, and make use of even more connection possibilities between the Pi and Android.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Raspberry Pi Android Projects
Published in: Sep 2015Publisher: ISBN-13: 9781785887024
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Gökhan Kurt

Gkhan Kurt has been trying to keep up with the the latest developments in technology and IT in his 15-year-long development career. For the past 4 years, he has been working at IFS Labs, one of the top innovation departments of the Swedish software industry. Currently, he is involved in the Internet of Things and has been developing prototype IoT implementations using Raspberry Pi. He has a master's of science degree from Chalmers University of Technology and a bachelors degree from the Middle East Technical University. You can connect with him on Twitter and on LinkedIn.
Read more about Gökhan Kurt