How to Set Up Custom Remote in OpenElec (NUC)
#1
I have seen some guides on setting up custom IR remote commands (mainly http://forum.xbmc.org/showthread.php?tid=104541 ). However, with OpenElec on my i3 Haswell NUC, things were a bit flaky so I outlined my process. My motivation was to set up a unique set of remote commands because I am using a Xbox 360 as a Media Center Extender for my CableCard on the same TV, so the remote commands would cross up the devices when one was running in background while the other was in use. I got fed up and decided to do this when I somehow changed the channel lineup on my Cablecard while trying to navigate around XBMC.

Basically, I generated a custom rc_keymap file then edited my /storage/.config/autostart.sh file to point to this.

To generate a custom rc_keymap file, my first step was to add a device to my Harmony 300 remote. This step is not necessary if you already have a remote that has commands that can be read by OpenElec. I ended up choosing the Sony KDL-55EX700 TV for this, because it was the first device I tested with my Harmony that OE actually showed IR commands for. Unfortunately, this device does not have Play/Pause/Stop/FF/Rew buttons, so I manually assigned other buttons from this remote in place of those commands (InputHDMI1,2,3,4 and InputNext). The buttons I added were arbitrary, because all I really cared about is assigning commands to various remote codes.

The next step was to grab the remote codes for the buttons from OpenElec. I did this by using the command "ir-keytable -t", pressing a remote button, and seeing what OpenElec said the IR code was. When I first tried this with my original MCE remote, no command codes were being shown, even though XBMC was responding to the commands. I found this is due to LIRC, and once I ran the command "killall eventlircd", the command codes started showing up. Thanks to post at http://forum.xbmc.org/showthread.php?tid=164020 for that tidbit. I grabbed the codes for all the various buttons I typically use and assigned them to a rc_keymap file, as they are in /etc/rc_keymaps. I saved the following file, pasted below, as /storage/.config/sony (because /etc/rc_keymaps/ are read only O/S files):

Code:
# table sony, type: SONY
0x10075 KEY_DOWN
0x10074 KEY_UP
0x10034 KEY_LEFT
0x10033 KEY_RIGHT

0x10065 KEY_ENTER
0x10060 KEY_C # MENU
0x970023 KEY_BACK

# THESE KEYS HAVE BEEN REASSIGNED IN MYHARMONY.COM
0x1a005a KEY_PLAY          # INPUTHDMI1
0x1a005b KEY_PLAYPAUSE     # INPUTHDMI2
0x1a005c KEY_X             #  (STOP) INPUTHDMI3
0x1a005d KEY_REWIND        # INPUTHDMI4
0x10025 KEY_FASTFORWARD    # INPUTNEXT

0x10000 KEY_1
0x10001 KEY_2
0x10002 KEY_3
0x10003 KEY_4
0x10004 KEY_5
0x10005 KEY_6
0x10006 KEY_7
0x10007 KEY_8
0x10008 KEY_9
0x10009 KEY_0
# USING REMOTE CODES FROM SONY KDL-55EX700

A few notes on the keymap I generated in respect to OpenElec and how the files are typically set up in other how-to guides:
1. I tried using KEY_NUMERIC_0 through KEY_NUMERIC_9, but those buttons did not respond in XBMC
2. The KEY_STOP and KEY_MENU commands did not work, so I had to replace them with KEY_X and KEY_C
3. The KEY_X and KEY_C commands still did not respond after restart until I entered the command "killall eventlircd" (but all other commands worked)

After I did this, I added the following 2 lines to my autostart.sh file (leaving in the legacy modprobe commands for getting the IR to work):
Code:
ir-keytable -c -w /storage/.config/sony
killall eventlircd

This ended up working like a charm. The Harmony remote even seems to work better now (less lag), and I don't have to worry about commands interfering between devices. However, one thing I have not been able to figure out is how to properly set the repeat delay/period. Using the command ir-keytable -D 10000 -P 10000, OpenElec says the delay and period have been set to 10,000ms, but there is no noticeable change in XBMC, as my remote is very touchy to any prolonged button presses. I'm not sure where that value is actually set for XBMC.
Reply
#2
How do you send a discrete on signal to the nuc openelec isn't yet booted? You have to have a remote that natively sends that ir6 signal correct?
Reply
#3
I have a follow-up question to my guide. I have just upgraded from OpenElec 4.0.5->4.0.7, and the majority of my custom remote buttons still work (play, pause, ff, rew, up down left right, enter). However, some keys no longer work: KEY_X (stop), KEY_1-0 (numeric keypad), KEY_BACK, KEY_C (Menu). I am still using the original keytable from the first post.

Is there some change to OpenElec 4.0.7 that would be causing this? When I check the remote codes in SSH via "ir-keytable -t", they are still showing up as before (see examples below) but for some reason XBMC is not recognizing them anymore. I also checked to make sure the killall eventlircd events was applied, which they are. Lastly, I tried changing KEY_X to KEY_STOP and re-loaded the keytable, but that did not work, and I tested to make sure that an "X" keypress on a keyboard still produced a STOP on my videos, which it does. I changed KEY_1 to KEY_NUMERIC_1, that also did not work.

Code:
OpenELEC:~/.xbmc/userdata/keymaps # ir-keytable -t
Testing events. Please, press CTRL-C to abort.
1405868947.480533: event MSC: scancode = 970023
1405868947.480533: event key down: KEY_BACK (0x009e)
1405868947.480533: event sync
1405868947.517209: event MSC: scancode = 970023
1405868947.517209: event sync
1405868947.571848: event MSC: scancode = 970023
1405868947.571848: event sync
1405868947.635333: event MSC: scancode = 970023
1405868947.635333: event sync
1405868947.884137: event key up: KEY_BACK (0x009e)
1405868947.884137: event sync
1405869015.113550: event MSC: scancode = 10060
1405869015.113550: event key down: KEY_C (0x002e)
1405869015.113550: event sync
1405869015.153071: event MSC: scancode = 10060
1405869015.153071: event sync
1405869015.194581: event MSC: scancode = 10060
1405869015.194581: event sync
1405869015.239596: event MSC: scancode = 10060
1405869015.239596: event sync
1405869015.487492: event key up: KEY_C (0x002e)
1405869015.487492: event sync
Reply
#4
Did you ever figure this out? I am having a similar problem with openelec Kodi. The keys all test perfect in openelec but none other than a few (play,stop, up, down, etc) don't work in Kodi. And I can find no solution.
Reply

Logout Mark Read Team Forum Stats Members Help
How to Set Up Custom Remote in OpenElec (NUC)0