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
|
1 |
$ sudo apt-get install ir-keytable |
List your IR receiver with the following command:
|
1 |
$ sudo ir-keytable |
And you’ll see something like this:
|
1 2 3 4 5 6 7 |
Found /sys/class/rc/rc0/ (/dev/input/event4) with: Driver <strong>ite-cir</strong>, table rc-rc6-mce Supported protocols: <strong>NEC</strong> RC-5 <strong>RC-6</strong> JVC SONY SANYO LIRC other Enabled protocols: NEC RC-6 Name: <strong>ITE8713</strong> CIR transceiver bus: 25, vendor/product: 1283:0000, version: 0x0000 Repeat delay = 500 ms, repeat period = 125 ms |
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:
|
1 |
$ sudo ir-keytable -p NEC,RC6 -t |
Click on some keys on your remote and take notes of each hexadecimal code output that is shown on the console, like the following:
|
1 2 |
1422203031.291478: event type EV_MSC(0x04): scancode = <strong>0x77e190e6</strong> 1422203032.349079: event type EV_MSC(0x04): scancode = <strong>0x77e130e6</strong> |
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:
|
1 |
$ sudo vim /etc/rc_keymaps/apple_remote |
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:
|
1 2 3 4 5 6 7 8 |
==> apple_remote <== # Apple Remote 0x77e150e6 KEY_UP 0x77e130e6 KEY_DOWN 0x77e190e6 KEY_LEFT 0x77e160e6 KEY_RIGHT 0x77e1a0e6 KEY_ENTER 0x77e1c0e6 KEY_ESC |
Now we’ll create the KODI key mapping file:
|
1 |
$ vim ~/.kodi/userdata/Lircmap.xml |
And add the following:
|
1 2 3 4 5 6 7 8 9 10 11 |
<lircmap> <remote device="Apple_Remote_A1156"> <up>KEY_UP</up> <down>KEY_DOWN</down> <left>KEY_LEFT</left> <right>KEY_RIGHT</right> <play>KEY_PLAY</play> <menu>KEY_MENU</menu> <select>KEY_OK</select> </remote> </lircmap> |
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:
|
1 |
$ sudo vim /etc/init.d/make-ir-work |
Add the following text:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#!/usr/bin/env bash echo 'Modprobing...' modprobe -r nuvoton_cir sleep 1 echo 'Echoing...' echo "auto" > /sys/bus/acpi/devices/<strong>ITE8713</strong>:00/physical_node/resources #sleep 1 echo 'Modprobing...' modprobe nuvoton-cir sleep 1 echo 'Clearing the old keytable...' ir-keytable -c sleep 1 echo 'Injecting the new keytable...' ir-keytable -p NEC,RC6 -w <strong>/etc/rc_keymaps/apple_remote</strong> echo 'Done.' |
Check that with that command we’re enabling NEC/RC6 modules and applying the apple_remote keymap.
Now just make it executable:
|
1 |
$ sudo chmod a+x /etc/init.d/make-ir-work |
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.

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
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?
I guess you’re using a different version of ir-keytable that doesn’t accept the
-wparameter.Can you please type this and check the available options?
ir-keytable --helpMany thanks for the contribution!
Pingback: Intel NUC, Ubuntu 14.04 and Kodi
@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
can I set it up for fast forwarding and rewinding by holding left and right?
Currently, with my setup, no. Just handling single clicks 🙁
Pingback: How to use an Apple remote with KODI on Ubuntu on an Intel NUC – My webacious outpourings