Configuring an IR remote control with OpenElec 5.0

Since I switched from the Raspberry Pi to the HummingBoard for my HTPC and the CEC is not working any more, I decided to configure and use the IR port, that comes with the board, to works with my IR remote control. The main problem I faced is the missing/partial documentation on the OpenElec wiki and the info scattered across multiple forums. Therefore, after a lot of time in searching and various trials and errors, I was able to create all the steps necessary to accomplish the task. There are a couple things to watch out that wasted a lot of my time, but you now should be safe :).

Test the IR port and find the correct protocol

First, we need to stop the XBMC service and the eventlircd. Connect to your OpenELEC (look here if you do not know how) and type these two commands:

systemctl stop xbmc.service
killall eventlircd

The screen of your TV should have go black, because we have completely stopped Kodi. We need to do that or we will not be able to get the scan codes of our remote. Now launch this command to see if your IR port is correctly seen by the system and which protocols it supports:


You should get a response like the one below:


We now know what protocols are supported, enabled and the name of the device (rc0 in the screenshot). To discover the protocol that works correctly with your remote, you should type this command for each one enabled:

ir-keytable -s rc0 -p <protocol> -t

rc0 is my device, be sure to use the one you get from the previous command. <protocol> is the protocol you are testing. You will know immediately if the protocol is the right one because, when pressing the keys of your remote, you will see the scan codes identified in the console, otherwise nothing will happen. My remote works with the NEC protocol and below you can see the scan codes.

scan codes

Prepare the file

Now that we have the scan codes, we must insert them in a file with this format

# table myremote, type: NEC

0x70760 KEY_UP
0x70761 KEY_DOWN
0x70762 KEY_RIGHT
0x70765 KEY_LEFT
0x70768 KEY_ENTER
0x7072d KEY_EXIT
0x7071f KEY_INFO
0x70746 KEY_STOP

A couple things to note:

  • myremote is the name I used also for my file, insert whatever you like
  • type is the protocol name
  • the key list to associate the scan codes to, can be found here
  • If you are using windows to create your file, be sure to save it with Linux lines ending or you will get an error when trying to use it. With Sublime Text you can find the option in View -> Line Endings -> Linux


Now that you have your file ready, copy it to /etc/rc_keymaps/ with your preferred file browser, just insert the IP address of OpenELEC and navigate to *\\Configfiles


To test if it is working correctly, use this command

ir-keytable -s rc0 -c -p NEC,RC-5,RC-6,JVC,SONY -w /etc/rc_keymaps/myremote

Replace myremote with the name of your file and, if everything is correct, you will get something like the image below:


If you now execute the test command again, you should get the scan codes and the key maps associated to them:


Creating the

Now that everything works, we need to do one last step. Launch the command at boot. Go to /storage/.config/ (or \\Configfiles from your file browser) and create a file named and paste the following line

ir-keytable -s rc0 -c -p NEC,RC-5,RC-6,JVC,SONY -w /etc/rc_keymaps/myremote

As I wrote before, remember to replace rc0 with your device and myremote with your file name. Reboot your box and you are done. If you need it, here you can find my file.

Update 14/03/2015

Since the version 5.0.2, my IR remote started working erratically. I solved the problem by delaying the load of the and forcing the “executable” permission.
Connect to your box via SSH and go to /storage/.config. From there edit the with nano and change it like this:

#! /bin/sh
sleep 5;
ir-keytable -s rc0 -c -p NEC,RC-5,RC-6,JVC,SONY -w /etc/rc_keymaps/myremote

Save and give it the executable permission:

chmod +x

By giving 5 seconds of delay, everything works like a charm.

  • Pingback: Ambilight from any video source with a Raspberry (part 3)()

  • Do De


    I have a xbox 360 remote control and there’s a strange thing with it.
    The “red” button and the “Last” button have the same scancode. This means that I can not assign different actions for those buttons.
    The same strange thing happens with “yellow” button and “guide” button.

    Is there any way I can fix this behavior? How can I force it to have different scancodes for these buttons?

    Thanks in advance.

    • As far as I know that should not happen. Stupid question, have you tried with all the protocols supported by your IR receiver?. Maybe the problem is the protocol

      • Do De


        I tried all protocols and only RC-6 is working.

        Still no clue.

        • Sorry, I do not know how to help you, sorry.

          • Do De

            It seams that I’m not the only one facing such problem with this remote.
            I’ll contact Microsoft to find a solution.

            Thanks for your help.