Logitech Harmony - Some keys just wont work [NUC, Ubuntu 15.04, Kodi 14.2]
#1
HI

I have the following setup:
-Intel NUC 5i5RYH
-Ubuntu 15.04
-Kodi 14.2
-Logitech Harmony 555

I've managed to get the CIR working (Consumer IR device) and the remote works fine.
However, there are some keys that just wont work.

I've added the following devices using the harmony software:
Computer > Media Center PC > Microsoft > Windows Media Center SE
Computer > Media Center PC > Microsoft > MCE Keyboard
Computer > Media Center PC > Microsoft > XBMC

The problem is that I can't get the following keys to work (among others) - here are the problem keys and the harmony mapping:
[Remote Button - Device - Key]
Exit - MCE Keyboard - Backspace
Menu - MCE Keyboard - C
Stop - MCE Keyboard - X

Play, Pause, Rewind etc works (mapped to Windows Media Center SE commands)

If the remote simply mimic a keyboard there should be no need for a keymap - right (since the keyboard.xml keymap is quite extensive)?
It seems like it's they plain keyboard events that don't work - but an actual keyboard works perfect.

Any tips/trix?


Regards,
Mikael
Reply
#2
Have you tried using the keymap editor addon?
It makes it easier if your not sure on what's up... Like me
Reply
#3
Tongue 
(2015-07-07, 14:40)Steve_uk Wrote: Have you tried using the keymap editor addon?
It makes it easier if your not sure on what's up... Like me

Thanks - never thought of that.
I'll try that if I get totally stuyck, I would like to know more about how it actually works Big Grin
After some more thinking I think that the Harmony remote is the "MCE IR Keyboard/Mouse (nuvoton-cir)" device in /proc/bus/input/devices.
If I check the /proc/bus/input/devices I have the following devices:

Name="Sleep Button"
Name="Power Button"
Name="Power Button"
Name="MOSART Semi. 2.4G Keyboard Mouse"
Name="MOSART Semi. 2.4G Keyboard Mouse"
Name="Nuvoton w836x7hg Infrared Remote Transceiver"
Name="MCE IR Keyboard/Mouse (nuvoton-cir)"
Name="Video Bus"
Name="HDA Intel HDMI HDMI/DP,pcm=3"
Name="HDA Intel HDMI HDMI/DP,pcm=7"
Name="HDA Intel HDMI HDMI/DP,pcm=8"
Name="HDA Intel PCH Mic"
Name="HDA Intel PCH Headphone"

So - creating a keymap for the "MCE IR Keyboard/Mouse (nuvoton-cir)" might do the trick Smile


Regards,
Mikael
Reply
#4
If you want to know which one it is try this command :

Code:
ir-keytable

it should report something like

Code:
Found /sys/class/rc/rc0/ (/dev/input/event9) with:
        Driver mceusb, table rc-rc6-mce
        Supported protocols: NEC RC-5 RC-6 JVC SONY SANYO LIRC RC-5-SZ SHARP XMP other
        Enabled protocols: NEC RC-6
        Name: Media Center Ed. eHome Infrared
        bus: 3, vendor/product: 147a:e03e, version: 0x1201
        Repeat delay = 500 ms, repeat period = 125 ms

In this case Media Center Ed. eHome Infrared is the receiver

At the top you could see your event number (here 9)

Now you can

Code:
udevadm info -q all /dev/input/eventX

Replace X by your event number and you will get additional info.

(all of this under Openelec, but i assume it should also works for other distro)

You can also test your remote control buttons using

Code:
irw

Press some buttons and it will give you the key name associated with each button (ctrl+c to exit).

I don't know under Ubuntu, but in Openelec this key names are defined in rc6_mce keytable, then some remapping occurs in default.evmap files, it it then translated via lircmap.xml into kodi "internal kodi actions names" which are then parsed via remote.xml (pfff not an easy path). This of course for an MCE IR remote seen as a remote.
Reply
#5
Namoi: I'll give that a try!

I just tried enabling debugging in kodi and checked the kodi log file (~/.kodi/temp/kodi.log) for OnKey events.
Unfortunately the missing keys (guide, info, menu) did not show up at all in the log file so is seems there is no button events being fired.

Status of the ir-keytable

Code:
mystiqu@NUC:~/.kodi$ sudo ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event5) with:
        Driver nuvoton-cir, table rc-rc6-mce
        Supported protocols: NEC RC-5 RC-6 JVC SONY SANYO LIRC RC-5-SZ SHARP XMP other
        Enabled protocols: RC-6 LIRC
        Name: Nuvoton w836x7hg Infrared Remote
        bus: 25, vendor/product: 1050:00c3, version: 0x0033
        Repeat delay = 500 ms, repeat period = 125 ms

Code:
mystiqu@NUC:~/.kodi$ devadm info -q all /dev/input/event5

P: /devices/pnp0/00:01/rc/rc0/input8/event5
N: input/event5
E: BACKSPACE=guess
E: DEVNAME=/dev/input/event5
E: DEVPATH=/devices/pnp0/00:01/rc/rc0/input8/event5
E: ID_INPUT=1
E: ID_INPUT_KEY=1
E: MAJOR=13
E: MINOR=69
E: SUBSYSTEM=input
E: USEC_INITIALIZED=62947
E: XKBLAYOUT=se
E: XKBMODEL=pc105

The problem was that when using irw it does not report anything at all - not even for the working buttons on the remote Huh
Any clues?

Regards,
Mikael
Reply
#6
TBH i don't know if Lirc is used on Ubuntu, but you can try first to kill it.

Code:
killall lircd

Then to be on the safe side try kill eventlircd (absolutely not sure ubuntu use this one.

Code:
killall eventlircd

Now you can try at the kernel level if some scancodes are genrated by you remote buttons by this

Code:
ir-keytable -t
Reply
#7
Btw, i assume you read the guide here to setup your harmony, but it is more for windows user.

I just use one device in mine and it is "media center pc".

It is recognized as a remote, not a keyboard. Hence you just need to deal with remote.xml at the end. If you mixup devices, some will be seen as keyboard inputs, others as remote. You will have to make changes in both remote and keyboard.xml and you will have to check each time which device send the command.

Do it simple : one device. There are enough available scancodes to map wathever you want on your remote (assuming it recognizes long key press.)
Reply
#8
Hi

Lirc is used (based on output from ir-keytable: /sys/class/rc/rc0/protocols protocol lirc (enabled) )
I didn't get any output from the info7menu/guide keys, but I got it from the keys that work (OK / Enter and Down in this case)

Code:
1436289492.658345: event type EV_MSC(0x04): scancode = 0x800f040b
1436289492.658345: event type EV_KEY(0x01) key_down: KEY_ENTER(0x0001)
1436289492.658345: event type EV_SYN(0x00).
1436289492.762480: event type EV_MSC(0x04): scancode = 0x800f040b
1436289492.762480: event type EV_SYN(0x00).
1436289492.887319: event type EV_MSC(0x04): scancode = 0x800f040b
1436289492.887319: event type EV_SYN(0x00).
1436291654.015864: event type EV_MSC(0x04): scancode = 0x800f041f
1436291654.015864: event type EV_KEY(0x01) key_down: KEY_DOWN(0x0001)
1436291654.015864: event type EV_SYN(0x00).
1436291654.119092: event type EV_MSC(0x04): scancode = 0x800f041f
1436291654.119092: event type EV_SYN(0x00).
1436291654.245754: event type EV_MSC(0x04): scancode = 0x800f041f
1436291654.245754: event type EV_SYN(0x00).
1436291654.497412: event type EV_KEY(0x01) key_up: KEY_DOWN(0x0001)
1436291654.497412: event type EV_SYN(0x00).

There is a lirc.conf in /etc/lirc/ which includes another conf file for a logitech remote
Code:
#Configuration for the Logitech/AST remote:
include "/usr/share/lirc/remotes/logitech/lircd.conf.logitech"

mystiqu@NUC:~/.kodi/userdata$ cat /usr/share/lirc/remotes/logitech/lircd.conf.logitech
Code:
#
#
# contributed by Isaac Lauer
#
# brand:             Logitech
# model:             Value Infrared Remote Control
# supported devices:
#

begin remote

  name  Logitech
  bits           8
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100

  one             0   833
  zero          833     0
  pre_data_bits   8
  pre_data       0xA0
  gap          29858
  repeat_bit      0

      begin codes
          KEY_POWER                    0x0000000000000002
          KEY_1                        0x0000000000000015
          KEY_2                        0x0000000000000016
          KEY_3                        0x0000000000000014
          KEY_4                        0x0000000000000018
          KEY_5                        0x0000000000000019
          KEY_6                        0x0000000000000017
          KEY_7                        0x000000000000001C
          KEY_8                        0x000000000000001B
          KEY_9                        0x000000000000001A
          KEY_0                        0x000000000000001D
          KEY_PAUSE                    0x0000000000000013
          KEY_EJECTCD                    0x0000000000000011
          SEEK-                    0x000000000000000E
          KEY_PLAY                     0x000000000000000F
          SEEK+                    0x0000000000000010
          KEY_STOP                     0x0000000000000012
          KEY_HELP                     0x0000000000000001
          KEY_CHANNELDOWN                      0x000000000000000D
          KEY_CHANNELUP                      0x000000000000000A
          KEY_VOLUMEDOWN                     0x000000000000000C
          KEY_VOLUMEUP                     0x0000000000000009
          *                        0x000000000000001F
          #                        0x000000000000001E
          KEY_MUTE                         0x000000000000000B
          BUTTONL_DOWN             0x0000000000000039
          BUTTONR_DOWN             0x000000000000003A
          KEY_UP                   0x0000000000000038
          KEY_ENTER                        0x0000000000000008
          KEY_CLOSE                        0x0000000000000023
          KEY_TV                           0x0000000000000004
          GDE                      0x0000000000000005
          KEY_CD                           0x0000000000000006
          MSG                      0x0000000000000007
          KEY_PHONE                        0x0000000000000003
          MOUSE_N                  0x0000000000000040
          MOUSE_NNE                0x0000000000000041
          MOUSE_NE                 0x0000000000000042
          MOUSE_NEE                0x0000000000000043
          MOUSE_E                  0x0000000000000044
          MOUSE_SEE                0x0000000000000045
          MOUSE_SE                 0x0000000000000046
          MOUSE_SSE                0x0000000000000047
          MOUSE_S                  0x0000000000000048
          MOUSE_SSW                0x0000000000000049
          MOUSE_SW                 0x000000000000004A
          MOUSE_SWW                0x000000000000004B
          MOUSE_W                  0x000000000000004C
          MOUSE_NWW                0x000000000000004D
          MOUSE_NW                 0x000000000000004E
          MOUSE_NNW                0x000000000000004F
          MOUSE_N                  0x0000000000000050
          MOUSE_NNE                0x0000000000000051
          MOUSE_NE                 0x0000000000000052
          MOUSE_NEE                0x0000000000000053
          MOUSE_E                  0x0000000000000054
          MOUSE_SEE                0x0000000000000055
          MOUSE_SE                 0x0000000000000056
          MOUSE_SSE                0x0000000000000057
          MOUSE_S                  0x0000000000000058
          MOUSE_SSW                0x0000000000000059
          MOUSE_SW                 0x000000000000005A
          MOUSE_SWW                0x000000000000005B
          MOUSE_W                  0x000000000000005C
          MOUSE_NWW                0x000000000000005D
          MOUSE_NW                 0x000000000000005E
          MOUSE_NNW                0x000000000000005F
          MOUSE_N                  0x0000000000000060
          MOUSE_NNE                0x0000000000000061
          MOUSE_NE                 0x0000000000000062
          MOUSE_NEE                0x0000000000000063
          MOUSE_E                  0x0000000000000064
          MOUSE_SEE                0x0000000000000065
          MOUSE_SE                 0x0000000000000066
          MOUSE_SSE                0x0000000000000067
          MOUSE_S                  0x0000000000000068
          MOUSE_SSW                0x0000000000000069
          MOUSE_SW                 0x000000000000006A
          MOUSE_SWW                0x000000000000006B
          MOUSE_W                  0x000000000000006C
          MOUSE_NWW                0x000000000000006D
          MOUSE_NW                 0x000000000000006E
          MOUSE_NWW                0x000000000000006F
      end codes

end remote

If this file somehow is in play, the KEY_CLOSE should be the exit button on the remote.
But, it's all guessing right now... the actual key codes (0xYYYYYYY) does not match any of the scancodes from the ir-keytable test Confused
Reply
#9
The basics key always work AFAIK.
If eventlircd isn't envolve (try by killing it, it will teport no such file bla bla), your best chances is in lircmap.xml (or doing a lirc.conf) but that last option shouldn't arise.
Try to do a new setup with just a "media center pc" first.

Now it's late here, i can't help you right now, but tomorrow is another day.

But if lirc is envolve you should have a response from irw IMHO.
Reply
#10
I just say this because using an mce remote should work out of the box.
No go back to the rc6 protocol used by that kind of remote when used as... a remote (not a keyboard) and it should work.

Edit: you just add an entertainment device, you choose microsoft, you choose media center pc (AFAIR).
Reply
#11
I'm grateful for every tip Smile

I've added a device just as you suggested - but only the "standard" buttons work.
Quote:Computer > Media Center PC > Microsoft > Windows Media Center SE
Computer > Media Center PC > Microsoft > MCE Keyboard

The remote uses the RC-6 protocol, which became clear when I tried and disabled it using ir-keytable

disable RC-6
Code:
ir-keytable -p LIRC

enable RC-6 again
Code:
ir-keytable -p LIRC,RC-6

I also found an rc keymap fil in /lib/udev/rc_keymaps/rc6_mce which seem to be in use.
If I clear all keymaps using ir-keytable -c, all the buttons stop working.

clear keymaps
Code:
ir-keytable -c

add keymaps again
Code:
ir-keytable -w /lib/udev/rc_keymaps/rc6_mce

/lib/udev/rc_keymaps/rc6_mce
Code:
# table rc6_mce, type: RC6_MCE
0x800f0400 KEY_NUMERIC_0
0x800f0401 KEY_NUMERIC_1
0x800f0402 KEY_NUMERIC_2
0x800f0403 KEY_NUMERIC_3
0x800f0404 KEY_NUMERIC_4
0x800f0405 KEY_NUMERIC_5
0x800f0406 KEY_NUMERIC_6
0x800f0407 KEY_NUMERIC_7
0x800f0408 KEY_NUMERIC_8
0x800f0409 KEY_NUMERIC_9
0x800f040a KEY_DELETE
0x800f040b KEY_ENTER
0x800f040c KEY_SLEEP
0x800f040d KEY_MEDIA
0x800f040e KEY_MUTE
0x800f040f KEY_INFO
0x800f0410 KEY_VOLUMEUP
0x800f0411 KEY_VOLUMEDOWN
0x800f0412 KEY_CHANNELUP
0x800f0413 KEY_CHANNELDOWN
0x800f0414 KEY_FASTFORWARD
0x800f0415 KEY_REWIND
0x800f0416 KEY_PLAY
0x800f0417 KEY_RECORD
0x800f0418 KEY_PAUSE
0x800f0419 KEY_STOP
0x800f041a KEY_NEXT
0x800f041b KEY_PREVIOUS
0x800f041c KEY_NUMERIC_POUND
0x800f041d KEY_NUMERIC_STAR
0x800f041e KEY_UP
0x800f041f KEY_DOWN
0x800f0420 KEY_LEFT
0x800f0421 KEY_RIGHT
0x800f0422 KEY_OK
0x800f0423 KEY_EXIT
0x800f0424 KEY_DVD
0x800f0425 KEY_TUNER
0x800f0426 KEY_EPG
0x800f0427 KEY_ZOOM
0x800f0432 KEY_MODE
0x800f0433 KEY_PRESENTATION
0x800f0434 KEY_EJECTCD
0x800f043a KEY_BRIGHTNESSUP
0x800f0446 KEY_TV
0x800f0447 KEY_AUDIO
0x800f0448 KEY_PVR
0x800f0449 KEY_CAMERA
0x800f044a KEY_VIDEO
0x800f044c KEY_LANGUAGE
0x800f044d KEY_TITLE
0x800f044e KEY_PRINT
0x800f0450 KEY_RADIO
0x800f045a KEY_SUBTITLE
0x800f045b KEY_RED
0x800f045c KEY_GREEN
0x800f045d KEY_YELLOW
0x800f045e KEY_BLUE
0x800f0465 KEY_POWER2
0x800f046e KEY_PLAYPAUSE
0x800f046f KEY_PLAYER
0x800f0480 KEY_BRIGHTNESSDOWN
0x800f0481 KEY_PLAYPAUSE

This corresponds with the keycodes from ir-keytable -t (e.g. 0x800f040b KEY_ENTER).
I can't find any menu, info etc buttons here though.. :/

I'm not really sure how to proceed from this,most people only have to add a Media Center PC device or two and then everything works Tongue
Unfortunately there will be some inactivity from me now as I can't continue this until thursday evening Confused
Reply
#12
I don't know how it works on ubuntu, my little knowledge are based on my experience of Openelec.
On Openelec, there's a third "layer" which is eventlircd. Could you have a look if you have an 98-eventlircd.rules file in /lib/udev/rules.d or at least an eventlircd.d folder (this one is in /etc/ on Openelec).
If it exist you can try

Code:
eventlircd -f --evmap=/etc/eventlircd.d --socket=/run/lirc/lircd --release=:_UP -vvv

the emplacement of eventlircd.d and lircd depends of your distro of course, so change them accordingly and you must have a 98-eventlircd.rules file AFAIK.

You could also try to kill (killall lircd) and check if irw doesn't work to be sure (no such file... bla bla).
Now the keystrokes should pass directly from ir-keytable to kodi, so to test this just modify your rc6_mce file with something easy like swapping left and right key and see if it works under kodi (i don't know if you need to reboot).
If it works, try to add the context menu by replacing KEY_DVD by KEY_C and see if it works. If it does, you can remap all your keys via rc6_mce like so using keyboard key names (but in my experience not all the keys are mappable, the KEY_TAB and a lot others doesn't seem to work, but all the letters will).

But it's a dirty hack, it should work with lircd or better eventlircd.
Reply
#13
I don't have eventlircd or any 98-eventlircd.rules file in /lib/udev/rules.d
I also tried recording all the buttons to create my own lircd conf file for the remote, but the irrecord just ended up with a "something went wrong" error message :/

Code:
irrecord -f -d /dev/lirc0 /etc/lirc/lircd.logitech555.conf

When using ir-keytable I could not get all the scan codes for every button on the remote - if it wasn't mapped in the rc6_mce file and tied to a Windows Media Center SE event, it did not output anything.
e.g. if a button was programmed to output a MCE Keyboard event (in the harmony software) I got the correct character output, but not the actual scancode :/
I thought that if I at least could identify all the scancodes for the buttons, then I would at least know that I had a proper rc6_mce map file.

Anyway - as a last resort I killed lirc and continued on the road to remote hell...
I tried to remap some already working keys in /lib/udev/rc_keymaps/rc6_mce, e.g. changed from KEY_PLAY to KEY_SPACE - but that made the button do nothing instead.

From
Code:
0x800f0416 KEY_PLAY

To (tested a few others as well, always "disabled" the button)
Code:
0x800f0416 KEY_SPACE

Finally I programmed the remote to use MCE Keyboard instead for the buttons that did not work.
This way I got the result I wanted - even though I would really liked to get a working Lirc setup instead.

The problem now is that many of the keys (I, M, X, Backspace and TAB) repeats itself really fast so they are pretty useless at the moment.
It does that both in Kodi and when using ir-keytable (one fast button press usually results in 3 characters).

Is there any way to solve the repeating keys issue?
Or did I something crazy when just switching the from e.g. KEY_PLAY to KEY_SPACE? (may should have updated something in remote.xml in /usr/share/kodi/system/keymaps) ?
Reply
#14
When using Lirc, the sequence is as follows - if understood correctly Wink : lircd.conf -> Lircmap.xml -> Kodi map file (remote.xml in this case).

But, if not using Lirc and only the rc6_mce map file - are those commands sent straight to Kodi?
i.e. Should my 0x800f0416 KEY_SPACE line in rc6_mce have a korresponding <key_space>Action</key_space> tag in remote.xml?

In that case I made a boo boo Wink
Reply
#15
For irrecord i had the same problem. Just do it again. It will read your file and just ask you to press the key. Avoid the prevchannel (harmony app name) key (the one which looks like back) or remap it to back in harmony. It's this one which send something unrecognized.

If you go via ir keytable you can also set a delay (when ssh ir-keytable you can see the delay).

But you are right to want it working via Lirc.
Reply

Logout Mark Read Team Forum Stats Members Help
Logitech Harmony - Some keys just wont work [NUC, Ubuntu 15.04, Kodi 14.2]0