Problems configuring a IR remote

I have a problem with configuring a IR TV remote to work with KODI 21 on Odroid N2.

I tried to follow this guide but didn’t success.

Whats working: after stopping eventlircd I get scancodes received with ir-keytable -p NEC -t. I see:

Protocols changed to nec 
Testing events. Please, press CTRL-C to abort.
2385.587943: event type EV_MSC(0x04): scancode = 0x211
2385.587943: event type EV_SYN(0x00).
2386.650818: event type EV_MSC(0x04): scancode = 0x245
2386.650818: event type EV_SYN(0x00).
2387.499285: event type EV_MSC(0x04): scancode = 0x241
2387.499285: event type EV_SYN(0x00).

when pressing a few keys. Seems ok?

My .config/rc_maps is:

nec     *               XORO.cfg

.config/rc_keymaps/XORO.cfg:

# table XORO.cfg, type: NEC
0x240 KEY_MUTE
0x264 KEY_END
0x208 KEY_CONTEXT_MENU #KEY_PVR
0x24a KEY_PAUSE
0x265 KEY_STOP
0x265 KEY_POWER
0x20d KEY_RECORD
0x213 KEY_RED
0x217 KEY_GREEN
0x21b KEY_YELLOW
0x21f KEY_BLUE
0x250 KEY_MENU
0x24b KEY_EXIT
0x24d KEY_LEFT
0x241 KEY_UP
0x25d KEY_RIGHT
0x245 KEY_DOWN
0x211 KEY_OK
0x258 KEY_INFO
0x201 KEY_BACK
0x251 KEY_VOLUMEUP
0x259 KEY_VOLUMEDOWN
0x254 KEY_CHANNELUP
0x25c KEY_CHANNELDOWN
0x248 KEY_EPG
0x262 KEY_TEXT
0x212 KEY_1
0x216 KEY_2
0x202 KEY_3
0x21a KEY_4
0x21e KEY_5
0x203 KEY_6
0x20f KEY_7
0x20b KEY_8
0x207 KEY_9
0x244 KEY_0

After starting eventlircd and kodi nothing works.

What did I do wrong?

meson-ir * XORO.cfg

If still doesn’t work try without .cfg in file and filename.

sample: remotes/MesonIR/Xoro HST 260 at master · CoreELEC/remotes · GitHub

Thank you, but it did not help.

I made the changes you suggested (meson-ir in rc_maps and leaving out .cfg in rc_maps and the file name). No success.

If ir-keytable -p NEC -t works, why do I have to set meson-ir?

I even tried it with the example from the link you provided. It did not work.

There seems to be several different methods to make an IR remote available in CoreELEC.

What is the recommended method for CoreELEC (official): 21.2-Omega?

There are two IR drivers, meson-ir and amremote. meson-ir uses software decoding and covers more IR protocols. amremote uses hardware decoding and is slightly more responsive. NEC is compatible with amremote.

Thank you, that may help solving the issue.

Tried it, but something went wrong.

# ir-keytable -u
Protocols changed to irmp
Waiting for IRMP decode event. Please, press CTRL-C to abort.
Received IRMP code: remotewakeup=‘0xbf40fd02’, decode_type=‘0x0’, remotewakeupmask=‘0xffffffff’
Received IRMP code: remotewakeup=‘0xbf40fd02’, decode_type=‘0x0’, remotewakeupmask=‘0xffffffff’

So far it looks good.

Pressing MUTE on the remote brings:

Received IRMP code: remotewakeup=‘0xbf40fd02’, decode_type=‘0x0’, remotewakeupmask=‘0xffffffff’
Received IRMP code: remotewakeup=‘0xbf40fd02’, decode_type=‘0x0’, remotewakeupmask=‘0xffffffff’

For a quick test I put this into .config/remote.conf:

# factory_code each device has it's unique factory code.
# pattern: custom_code(16bit)+index_code(16bit)
# example: 0xff000001 = 0xff00(custom cod) _ 0001 (index)

factory_code = 0xfd020001

work_mode = 0
repeat_enable = 1
repeat_delay = 130
repeat_peroid = 120
release_delay = 20
debug_enable = 1

key_begin

0x40 113 # MUTE

key_end

What did I miss here?

Looks fine, did you reboot to activate the amremote driver?

Also not sure it matters, but don’t leave blank lines here above/below the keys between key_begin/end:

key_begin
0x40 113 # MUTE
key_end

Thank you, that helped (a little…)

I have a working “MUTE” button on my remote.

Next step was trying to record the scan codes:

systemctl stop kodi
systemctl stop eventlircd
ir-keytable -u
/sys/class/rc/: No such file or directory 
No devices found 

The MUTE key still works.
How can I record key codes?

dmesg shows something like:
[ 554.506989@0]s meson-remote ff808040.meson-remote: scancode 8 undefined
[ 554.507000@0]s meson-remote ff808040.meson-remote: no valid key to handle

Why meson? The IR stuff begins to drive me crazy. :wink:

ir-keytable only works with meson-ir. Delete the remote.conf file and reboot CE to load meson-ir. Then get the scan codes for all the remote button. Fill out the rest of remote.conf, put it back in /storage/.config, then reboot to load it and amremote driver again.

Will try it, thanks. I’ll report if it is successful or not.

Sorry, I give up.

After recording all key codes of my remote I could not find out which event codes I need to do what it should do in KODI.

Thank you for your patience and your help; I stay with the 2.4GHz mini keyboard.

After the remote.conf is created, Kodi Keymap Editor can be used to easily map any button to any specific Kodi function.

Sorry for the late reply. Did not notice your answer.

Keymap Editor only works if this remote is the only one. I think I am going to use that for another kodi on Libreelec and a Raspberry.

There’s a list of Kodi shortcuts here. You can use the keyboard keys in the remote.conf file for the button mapping. But that won’t work with shortcuts that are a combination of two keys (ctrl+ some key).

If Kodi Keymap Editor only applies the mapping to one remote, can’t you re-enter the addon to reapply the mapping to a second remote by repeating the process with that remote?

It will overwrite commands but manually saving and editing gen.xml works. Tested many times.

I have repeated commands from two remotes added to gen.xml. One from cec remote and second from Bluetooth connected ur02

1 Like

Do you know how to make it work with the remote control to set the auto framerate switching on/off with a single button press?
Is it possible?
Or run a script to do that?
So I press xy button on remote >> AFR off
Xy button again >> AFR on

You’d need to figure out the json-rpc call to enable/disable that setting, put it into a script, use Kodi keymap editor to map an action to a button, then modify the keymap file to edit the entry to run your script instead.

So it’s probably possible, but you’ll need to put some effort into making it work.

1 Like

I need the first two things. I can handle the rest.

This command unfortunately does not change anything.

curl -s -X POST -H 'Content-Type: application/json' -d '{"jsonrpc": "2.0", "method": "Settings.SetSettingValue", "params": {"setting": "videoplayer.adjustrefreshrate", "value": 2}, "id": 1}' http://coreelecIP:8080/jsonrpc

value:0 >> disabled
value:2 >> on start/stop

But do nothing
CE19.5

You didn’t post what you got in Kodi debug log. Usually there is a hint what is wrong. Also you didn’t show output from curl command.

1 Like