Install Kodi on Raspberry Pi Use OSMC

Kodi is one of the most popular ways to play media on your Raspberry Pi. It supports a large number of different media formats, and you can use this media center software to play music, videos, and even show your images.

With Kodi, you can scan and sort all your media files. It will download information about your files and present it to you in an attractive manner.

You can install Kodi directly on your Raspberry Pi system, or you can just use a distribution with Kodi pre-installed, such as OSMC and LibreELEC.

In this tutorial, we will show you how to install and set up OSMC Media Center.

../_images/kodi0.png

OSMC is an operating system distribution that uses Kodi media center software.

One of the advantages of OSMC is that it is actively maintained and built on top of a full operating system, allowing it to be easily extended beyond its built-in Kodi functionality. For example, we can easily set up Netflix on it because we can easily access the backend.

For the best experience with Kodi, we recommend that you use the Raspberry Pi 4 or newer. The stronger processor and increased RAM will help Kodi run at its best.

Components List

Required

  • Pironman

  • Micro SD card (8GB+)

  • Ethernet cable or Wi-Fi

  • HDMI cable

  • Monitor

  • Keyboard and mouse

Optional

  • M.2 SATA SSD

Install the OSMC Image

You will learn how to install OSMC image on a Micro SD card in this section. Traditionally, burning tools used to be Etcher and Win32 disk imager, but Raspberry Pi has now developed Raspberry Pi Imager, which is an all-in-one image and tool that makes image installation easy.

  1. If you don’t have Raspberry Pi Imager, please download it.

  2. Open Raspberry Pi Imager, and click CHOOSE OS.

    ../_images/kodi1.png
  3. Click the Media player OS button. This button will bring up 2 images for Kodi.

    ../_images/kodi2.png
  4. Here we choose OSMC.

    ../_images/kodi6.png
  5. Raspberry Pi 0/1, 2/3, 4/400 versions are provided; please select the appropriate version.

    ../_images/kodi7.png
  6. After selecting the appropriate drive, then click Write.

    ../_images/kodi8.png
  7. Once the installation success message appears, you can pull out the Micro SD.

    ../_images/kodi9.png

Initial Setup of OSMC on the Raspberry Pi

Now that we have installed OSMC to an SD card, we will walk you through the process of its initial set up process.

  1. Now pull out the Micro SD card and insert it into the card slot of the Piron.

    ../_images/connect_power.jpg
  2. Connect your display to the Pironman with the HDMI cable, then turn it on with the power switch.

  3. You will be greeted with the following screen when you launch OSMC for the first time. Please wait until the setup process is complete before continuing with our OSMC setup guide.

    ../_images/kodi10.png
  4. Once the installation is complete, you will need to reboot Pironman. You can reboot by long pressing the power switch or by re-plugging the power cable.

  5. The configuration page will appear once you have rebooted, and it will ask you to select the language. Select Yes to continue the setup after selecting a language for OSMC.

    ../_images/kodi11.png
  6. Next, you will be asked to select the time zone. Make sure to select the relevant time zone where you live, as this will help ensure that the time is correct.

    ../_images/kodi12.png
  7. You will be asked if you would like to rename your device here. Default device name is osmc and it is recommended to change to another name.

    ../_images/kodi13.png
  8. You can disable or enable the SSH service in this section. OSMC’s setup tool will enable SSH by default. Click Accept to continue the installation.

    ../_images/kodi14.png
  9. In this step, you will be asked to agree to OSMC’s and Kodi’s terms of service. Please select the Continue option after reading the license and agreeing to it.

    ../_images/kodi15.png
  10. Select a theme of your choice. For this guide, we will use the default OSMC theme.

    ../_images/kodi19.png
  11. Now you will be asked if you want to sign up for OSMC’s newsletter. For this guide, we will continue using the No thanks option.

    ../_images/kodi20.png
  12. At this point, you have now finally completed the initial configuration process of OSMC on your Raspberry Pi. You can take yourself to the Kodi main screen by selecting the Exit option.

    ../_images/kodi21.png

Configuring Network in OSMC

In this section, we will show you how to configure the network for your device using the OSMC interface.

  1. Go to the Settings option.

    ../_images/kodi22.png
  2. Then go to the My OSMC menu.

    ../_images/kodi16.png
  3. Select Network. This menu also contains several other options that can help you configure OSMC on your Raspberry Pi.

    ../_images/kodi17.png
  4. You can configure WIFI in this option, or just plug in a network cable, after which you will see information about the connection and remember this IP address, which you will need to access OSMC remotely later in the guide.

    ../_images/kodi24.png

Files Transfer

Sometimes you may need to transfer files between your OSMC device and your computer in order to edit, add, or change files that already exist. Depending on your previous experience, there are many ways to transfer files. Some of these methods work right out of the box (if SSH is enabled). Some methods require additional OSMC features, such as a Samba (SMB) server or an FTP server.

SFTP

For the sake of simplicity, we will focus only on SFTP using FileZilla, since it works out of the box on all three platforms (Windows, macOS, and Linux) with no additional changes to OSMC (required the SSH has been enabled).

When you open FileZilla for the first time, you will not connect to anything, you will need to provide the host, username and password.

  • Host: sftp://ip-address-of-your-osmc

  • User name: osmc

  • Password: osmc (or the password specified by your user)

  • Port: can be left blank to use the default SSH port 22

Once you have entered these, simply click the Quick Connect button to establish a connection.

../_images/kodi37.png

Samba Server

You can also transfer files using SMB server, which is a more intuitive and useful way. But you need to go to OSMC and install this server first, as follows.

  1. Go to the My OSMC menu page and select the App Store icon.

    ../_images/kodi28.png
  2. Select Samba (SMB) Server.

    ../_images/kodi29.png
  3. Select Install.

    ../_images/kodi30.png
  4. Select Apply to start the SMB server installation.

    ../_images/kodi31.png
  5. A popup will appear in the upper right corner to prompt you to install. Once the installation is complete, you will be able to access your Raspberry Pi files from your own computer.

    ../_images/kodi32.png
  6. On Windows, use Win+R to open Run Box.

    ../_images/kodi33.png
  7. Type \\ip address in the input box.

    ../_images/kodi34.png
  8. Now you will see a shared drive called osmc.

    ../_images/kodi35.png
  9. Once you click in, you will see different folders and now you can transfer your music, videos or movies to them.

    ../_images/kodi36.png

Adding OSMC’s videos to Scrape

In this section, we will show you how to add a video folder for OSMC to scrape.

Scrapping video is a fairly simple process and is one of the main features of Kodi.

  1. First, we need to go to the Video menu.

    ../_images/kodi45.png
  2. Next, we need to select the Files submenu. This submenu will allow you to browse through the imported folders or add additional folders.

    ../_images/kodi38.png
  3. Next, select the Add video.. option. In this option, we will add folders for OSMC’s Kodi to scan into its library.

    ../_images/kodi39.png
  4. In this menu, you need to select the Browse or Add option.

    ../_images/kodi40.png
    • The Browse option will allow you to find folders via OSMC’s file browser.

    • Add option will allow you to manually input the path to the directory.

    • Whichever route you take, choose the folder where your TV shows and movies are stored, then click OK.

    • Make sure you separate movies and TV shows in separate folders.

    • This is because if they are contained in the same folder, Kodi’s scrapers will not be able to distinguish between them.

      ../_images/kodi41.png
  5. OSMC divides videos into three separate categories, Movies, Music Videos and TV Shows. Select the option that is most relevant to your video. The options you select will affect how OSMC obtains information from the video.

    ../_images/kodi43.png
  6. After selecting the type of media the catalog contains, you can now select OK. OSMC will automatically select a known good information provider that will be used to scrape your library.

    ../_images/kodi44.png

    OSMC will scan your video and search for its name in a database on the Internet. This scan allows it to retrieve posters, actors, messages and other interesting information about your video.

    After selecting Ok, the scrape process should start automatically. You should begin to see that your movie or TV show has been added to the OSMC interface

Configure a remote

A 38KHz IR receiver is built into the Pironman and is connected to the GPIO13 pin, so you can use the remote control to control your Kodi.

1. Configure IR receiver

  1. Go to the Settings -> My OSMC menu and select the Raspberry Pi icon.

    ../_images/kodi23.png
  2. Select Hardware Support, and add the pin number to 13 in gpio_pin.

    ../_images/kodi25.png

    Once set, you will be prompted to reboot to make this configuration effective.

2. Select a remote control

  1. Kodi supports many different remotes and you can follow the instructions to configure them. Now go back to the My OSMC menu and select the Remotes icon to go to the configuration page.

    ../_images/kodi26.png
  2. Choose the brand of remote you are using from the list.

    ../_images/kodi27.png

Kodi can now be controlled with your remote.

For more information, please refer to: https://osmc.tv/wiki/.

3. Manually add a remote

Manually configuring a remote is a way to get your .conf file that fits your remote, add it to the Remotes list, and select it as the one to use at this time.

i. Logging in via SSH

Now log in to the OSMC system remotely from your PC, the default name and password are osmc.

Windows users can download an SSH client called PuTTY here.

As an alternative, some Windows 10 installations provide access to a command line SSH client via “PowerShell” from the Windows Start Menu. If your Windows 10 system supports this, you can use the Linux instructions.

Linux and OS X users should have an SSH client already

You can find your device’s IP address in Settings -> Systems -> Network.

  • Windows

Run PuTTY and enter the IP address of your device and click OK. When prompted, enter osmc for both username and password.

../_images/kodi_remote1.png
  • Linux / OS X

Open a Terminal interface and run the following command:

ssh osmc@<ip address of your device>

You will be prompted to accept the SSH key if this is the first time you have connected to the device. Type yes.

ii. Create an LIRC configuration file

  1. Make sure you have set gpio_pin to 13 in OSMC via Settings -> My OSMC -> Raspberry Pi -> Hardware Support.

    ../_images/kodi25.png
  2. In the terminal, check if the Raspberry Pi detects your IR receiver with the following command.

    ls /dev/lirc*
    

    A port message like /dev/lirc0 should appear.

  3. Now to see if you can receive data from the remote.

    sudo mode2 --driver default --device /dev/lirc0
    
  4. Then press the button on the remote and see if a string of pulse data appears.

    osmc@osmc:/etc/lirc$ sudo mode2 --driver default --device /dev/lirc0
    Using driver default on device /dev/lirc0
    Trying device: /dev/lirc0
    Using device: /dev/lirc0
    Running as regular user osmc
    space 16777215
    pulse 9083
    space 4442
    pulse 628
    space 509
    pulse 626
    space 508
    pulse 596
    space 543
    pulse 593
    space 538
    
  5. Now stop lircd.

    sudo killall lircd
    
  6. Get all available KEY_codes to match them later.

    irrecord --list-namespace
    
  7. Now create a .conf configuration file that fits your remote.

    irrecord -d /dev/lirc0
    
    • All you need to do is to run the above command.

    • Press the Enter key twice.

    • Name the remote control

    • Press and hold a key to sample until Please enter the name .. appears. .

    • Refer to the previous command to define all the keys.

    ../_images/kodi_remote.png
    • After configuring all the keys on the remote, press Enter to exit. You can use the ls command to see if the .conf file you configured exists.

  8. Now go back to OSMC and click Settings -> My OSMC -> Remotes.

    ../_images/kodi_remote2.png
  9. Select the .conf file under your Home folder by Browse.

    ../_images/kodi_remote4.png
  10. Once selected, press OK to select and then confirm your change.

    ../_images/kodi_remote3.png

At this point you can use your remote to control OSMC.