Apple Remote A1156 + Intel NUC + Kodibuntu 14 (Helix) + ir-keytables

Since I’ve spent a lot of time studying how the hell could I reuse my dumped white Apple Remote again, I had to write a tutorial for NO ONE ever waste that amount of time again.

Since I tried several approaches, I advice you to don’t touch any LIRC stuff, or inputlirc. Stay with ir-keytables! It’s very simple!

Setup

Installing ir-keytable

List your IR receiver with the following command:

And you’ll see something like this:

 

With that info we can get the driver’s name (itecir), supported protocols and even the transceiver name,(ITE8713) that we’ll need later.

Keymapping

So we need to translate the keystrokes into actions, so we can test keystrokes with the following command:

 

Click on some keys on your remote and take notes of each hexadecimal code output that is shown on the console, like the following:

Those two, will be your addresses to the keys. So let’s create a mapping file. Actually we’ll need 2: one for ir-keytables, another for KODI (to be able to be translated to its internal commands). So let’s start with the ir-keytables mapping file:

And insert the keys you want (as these are my addresses, yours could be different, so pay attention to the previous test where I asked you to note down the hex addresses). Add keys like these:

Now we’ll create the KODI key mapping file:

 

And add the following:

Startup script

Now we just need to add a little startup script that will set the keymaps at startup. I used a service, but you can use whatever you want as long as it runs on startup:

Pay attention to your device id, you must have noted earlier: my NUC’s receiver is ITE8713.

If you opt for a /etc/init.d/ script, please enter the following commands:

 

Add the following text:

 

Check that with that command we’re enabling NEC/RC6 modules and applying the apple_remote keymap.

Now just make it executable:

 

And add it to the startup:

$ sudo update-rc.d make-ir-work defaults 99

The 99 means make-ir-work gets sequence number 99 at boot, the range starts on 1 and goes till 99, most boot scripts have smaller numbers, this ensures this script has all its dependencies ready.

And now it’s reboot time!

Smoke test

Make a smoke test, ensure that when running:

$ sudo ir-keytable -p NEC,RC6 -w /etc/rc_keymaps/apple_remote # adds a new mapping

You’ll see something like:

> Wrote 8 keycode(s) to driver

 

Have fun with your Apple Remote! The bad thing is… the remote hasn’t that much keys to play with KODI, but it saves an electronic piece from trash.

Sources

25
Jan 2015
POSTED BY
DISCUSSION 9 Comments
TAGS

9 Responses to : Apple Remote A1156 + Intel NUC + Kodibuntu 14 (Helix) + ir-keytables

  1. floppah says:

    Here is the key map for the Apple A1294 remote:

    ==> apple_remote <==
    # Apple Remote
    0x77e150a2 KEY_UP
    0x77e130a2 KEY_DOWN
    0x77e190a2 KEY_LEFT
    0x77e160a2 KEY_RIGHT
    0x77e13aa2 KEY_ENTER
    0x77e1c0a2 KEY_ESC
    0x77e1faa2 KEY_PLAY

  2. Maciek says:

    Hello

    When I use the method described by you, I have a problem when I entered the command
    sudo ir-keytable -p NEC, RC6 -w / etc / rc_keymaps / apple_remote # adds a new mapping

    I received the reply:
    ir-keytable: -w: (PROGRAM ERROR) Option have been recognized !?

    I am doing everything according to your description, I checked the other guides and always getting an error in the same place.
    What could be causing this?

  3. admin says:

    I guess you’re using a different version of ir-keytable that doesn’t accept the -w parameter.
    Can you please type this and check the available options?

    ir-keytable --help

  4. admin says:

    Many thanks for the contribution!

  5. Pingback: Intel NUC, Ubuntu 14.04 and Kodi

  6. Markus says:

    @Maciek – i had the same error as yours. The problem is the comment in apple_remote file. Remove the comment and the programm error is away 🙂

    Greetz Markus

  7. Kyle says:

    can I set it up for fast forwarding and rewinding by holding left and right?

  8. admin says:

    Currently, with my setup, no. Just handling single clicks 🙁

  9. Pingback: How to use an Apple remote with KODI on Ubuntu on an Intel NUC – My webacious outpourings

Leave a Reply

Your email address will not be published. Required fields are marked *