Ok button doesn't work on H1 remote

  • Ya, it comes with a usb dongle. Thanks a lot

    rpi3:~ # lsusb

    Bus 001 Device 005: ID 046d:c52b Logitech, Inc. Unifying Receiver

    Bus 001 Device 004: ID 25a7:5704

    Bus 001 Device 006: ID 0c45:800a Microdia Vivitar Vivicam3350B

    Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter

    Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub

    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    rpi3:~ # dmesg | paste

    OYWN

    rpi3:~ # cat /proc/bus/input/devices

    I: Bus=0003 Vendor=25a7 Product=5704 Version=0101

    N: Name="2.4G Smart Remote"

    P: Phys=usb-3f980000.usb-1.3/input0

    S: Sysfs=/devices/platform/soc/http://3f980000.usb/usb1/1-1/1-1.3…01/input/input0

    U: Uniq=

    H: Handlers=sysrq kbd event0

    B: PROP=0

    B: EV=10001f

    B: KEY=3f 3007f 0 0 0 0 483ffff 17aff32d bf544446 0 0 1 130f93 8b17c007 ffff7bfa d941dfff febeffdf ffefffff ffffffff fffffffe

    B: REL=40

    B: ABS=1 0

    B: MSC=10

    I: Bus=0003 Vendor=25a7 Product=5704 Version=0101

    N: Name="2.4G Smart Remote"

    P: Phys=usb-3f980000.usb-1.3/input1

    S: Sysfs=/devices/platform/soc/http://3f980000.usb/usb1/1-1/1-1.3…02/input/input1

    U: Uniq=

    H: Handlers=mouse0 event1

    B: PROP=0

    B: EV=17

    B: KEY=1f0000 0 0 0 0 0 0 0 0

    B: REL=103

    B: MSC=10

    I: Bus=0003 Vendor=046d Product=4024 Version=0111

    N: Name="Logitech K400"

    P: Phys=usb-3f980000.usb-1.5:1

    S: Sysfs=/devices/platform/soc/http://3f980000.usb/usb1/1-1/1-1.5…06/input/input2

    U: Uniq=

    H: Handlers=sysrq kbd leds mouse1 event2

    B: PROP=0

    B: EV=12001f

    B: KEY=3007f 0 0 0 0 483ffff 17aff32d bf544446 0 0 ffff0001 130f93 8b17c007 ffff7bfa d941dfff febeffdf ffefffff ffffffff fffffffe

    B: REL=1c3

    B: ABS=1 0

    B: MSC=10

    B: LED=1f

    I: Bus=0003 Vendor=0c45 Product=800a Version=0101

    N: Name="USB USB Device"

    P: Phys=usb-3f980000.usb-1.2/input0

    S: Sysfs=/devices/platform/soc/http://3f980000.usb/usb1/1-1/1-1.2…07/input/input3

    U: Uniq=

    H: Handlers=sysrq kbd leds event3

    B: PROP=0

    B: EV=12001f

    B: KEY=3f 3007f 0 0 0 0 4c3ffff 17aff32d bf544446 0 0 1 130f93 8b17c007 ffff7bfa d951dfff febeffdf ffefffff ffffffff fffffffe

    B: REL=40

    B: ABS=1 0

    B: MSC=10

    B: LED=1f

    I: Bus=0003 Vendor=0c45 Product=800a Version=0101

    N: Name="USB USB Device"

    P: Phys=usb-3f980000.usb-1.2/input1

    S: Sysfs=/devices/platform/soc/http://3f980000.usb/usb1/1-1/1-1.2…08/input/input4

    U: Uniq=

    H: Handlers=mouse2 event4

    B: PROP=0

    B: EV=17

    B: KEY=1f0000 0 0 0 0 0 0 0 0

    B: REL=103

    B: MSC=10

    I: Bus=0003 Vendor=0c45 Product=800a Version=0101

    N: Name="USB USB Device"

    P: Phys=usb-3f980000.usb-1.2/input3

    S: Sysfs=/devices/platform/soc/http://3f980000.usb/usb1/1-1/1-1.2…0A/input/input5

    U: Uniq=

    H: Handlers=js0 event5

    B: PROP=0

    B: EV=1b

    B: KEY=7fff0000 0 0 0 0 0 0 0 0 0

    B: ABS=100 3063f

    B: MSC=10

    I: Bus=0000 Vendor=0000 Product=0000 Version=0000

    N: Name="lircd-uinput"

    P: Phys=

    S: Sysfs=/devices/virtual/input/input6

    U: Uniq=

    H: Handlers=sysrq kbd event6 rfkill

    B: PROP=0

    B: EV=100003

    B: KEY=ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe

    I: Bus=0000 Vendor=0000 Product=0000 Version=0000

    N: Name="eventlircd"

    P: Phys=/dev/input/event6

    S: Sysfs=/devices/virtual/input/input7

    U: Uniq=

    H: Handlers=event7

    B: PROP=0

    B: EV=3

    B: KEY=ff ffffffff 0 0 0 0 f 0 0 0 0 0 0 3fdff 7fff8fff ff03ff 0 0 0 0 0 0 0 0

  • Could you try downloading this file 98-eventlircd.rules to /storage/.config/udev.rules.d/98-eventlircd.rules and then reboot

    Code
    wget -O /storage/.config/udev.rules.d/98-eventlircd.rules http://www.horus.com/~hias/tmp/libreelec/24gsmartremote/98-eventlircd.rules

    This'll add the following block to the usb section of eventlircd udev rules file so that eventlircd will pick up input from your remote

    Code
    # 2.4G Smart Remote with keyboard and mouse inputs
    ENV{ID_VENDOR_ID}=="25a7",  ENV{ID_MODEL_ID}=="5704", ENV{ID_INPUT_KEYBOARD}=="?*",
      ENV{eventlircd_enable}="true"

    Please check if the keyboard part of your remote still works, I fear shift, control, caps etc will then be non-functional.

    so long,

    Hias

  • Sorry, had a stupid little bug in the rule - missed the "\" at the end of the first line

    Code
    # 2.4G Smart Remote with keyboard and mouse inputs
    ENV{ID_VENDOR_ID}=="25a7",  ENV{ID_MODEL_ID}=="5704", ENV{ID_INPUT_KEYBOARD}=="?*", \
      ENV{eventlircd_enable}="true"

    I fixed the file, could you re-download and try again?

    so long,

    Hias

  • Sorry, that still doesn't work. The new config killed my other remote and the "OK" button still doesn't work

    I have unplugged the dongle for the other remote. Here's with the udev config installed:

    rpi3:~ # lsusb

    Bus 001 Device 005: ID 046d:c52b Logitech, Inc. Unifying Receiver

    Bus 001 Device 007: ID 0c45:800a Microdia Vivitar Vivicam3350B

    Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter

    Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub

    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    rpi3:~ # dmesg | paste

    hdGd

    rpi3:~ # cat /proc/bus/input/devices

    I: Bus=0003 Vendor=046d Product=4024 Version=0111

    N: Name="Logitech K400"

    P: Phys=usb-3f980000.usb-1.5:1

    S: Sysfs=/devices/platform/soc/http://3f980000.usb/usb1/1-1/1-1.5…06/input/input2

    U: Uniq=

    H: Handlers=sysrq kbd leds mouse1 event2

    B: PROP=0

    B: EV=12001f

    B: KEY=3007f 0 0 0 0 483ffff 17aff32d bf544446 0 0 ffff0001 130f93 8b17c007 ffff7bfa d941dfff febeffdf ffefffff ffffffff fffffffe

    B: REL=1c3

    B: ABS=1 0

    B: MSC=10

    B: LED=1f

    I: Bus=0000 Vendor=0000 Product=0000 Version=0000

    N: Name="lircd-uinput"

    P: Phys=

    S: Sysfs=/devices/virtual/input/input7

    U: Uniq=

    H: Handlers=sysrq kbd event7 rfkill

    B: PROP=0

    B: EV=100003

    B: KEY=ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe

    I: Bus=0000 Vendor=0000 Product=0000 Version=0000

    N: Name="eventlircd"

    P: Phys=/dev/input/event7

    S: Sysfs=/devices/virtual/input/input8

    U: Uniq=

    H: Handlers=event8

    B: PROP=0

    B: EV=3

    B: KEY=ff ffffffff 0 0 0 0 f 0 0 0 0 0 0 3fdff 7fff8fff ff03ff 0 0 0 0 0 0 0 0

    I: Bus=0003 Vendor=0c45 Product=800a Version=0101

    N: Name="USB USB Device"

    P: Phys=usb-3f980000.usb-1.2/input0

    S: Sysfs=/devices/platform/soc/http://3f980000.usb/usb1/1-1/1-1.2…0B/input/input9

    U: Uniq=

    H: Handlers=sysrq kbd leds event0

    B: PROP=0

    B: EV=12001f

    B: KEY=3f 3007f 0 0 0 0 4c3ffff 17aff32d bf544446 0 0 1 130f93 8b17c007 ffff7bfa d951dfff febeffdf ffefffff ffffffff fffffffe

    B: REL=40

    B: ABS=1 0

    B: MSC=10

    B: LED=1f

    I: Bus=0003 Vendor=0c45 Product=800a Version=0101

    N: Name="USB USB Device"

    P: Phys=usb-3f980000.usb-1.2/input1

    S: Sysfs=/devices/platform/soc/http://3f980000.usb/usb1/1-1/1-1.2…C/input/input10

    U: Uniq=

    H: Handlers=mouse0 event1

    B: PROP=0

    B: EV=17

    B: KEY=1f0000 0 0 0 0 0 0 0 0

    B: REL=103

    B: MSC=10

    I: Bus=0003 Vendor=0c45 Product=800a Version=0101

    N: Name="USB USB Device"

    P: Phys=usb-3f980000.usb-1.2/input3

    S: Sysfs=/devices/platform/soc/http://3f980000.usb/usb1/1-1/1-1.2…E/input/input11

    U: Uniq=

    H: Handlers=js0 event3

    B: PROP=0

    B: EV=1b

    B: KEY=7fff0000 0 0 0 0 0 0 0 0 0

    B: ABS=100 3063f

    B: MSC=10

  • without the customized udev rules

    rpi3:~ # lsusb

    Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver

    Bus 001 Device 005: ID 0c45:800a Microdia Vivitar Vivicam3350B

    Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter

    Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub

    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    rpi3:~ # dmesg | paste

    FHXO

    rpi3:~ # cat /proc/bus/input/devices

    I: Bus=0003 Vendor=046d Product=4024 Version=0111

    N: Name="Logitech K400"

    P: Phys=usb-3f980000.usb-1.5:1

    S: Sysfs=/devices/platform/soc/http://3f980000.usb/usb1/1-1/1-1.5…04/input/input0

    U: Uniq=

    H: Handlers=sysrq kbd leds mouse0 event0

    B: PROP=0

    B: EV=12001f

    B: KEY=3007f 0 0 0 0 483ffff 17aff32d bf544446 0 0 ffff0001 130f93 8b17c007 ffff7bfa d941dfff febeffdf ffefffff ffffffff fffffffe

    B: REL=1c3

    B: ABS=1 0

    B: MSC=10

    B: LED=1f

    I: Bus=0003 Vendor=0c45 Product=800a Version=0101

    N: Name="USB USB Device"

    P: Phys=usb-3f980000.usb-1.2/input0

    S: Sysfs=/devices/platform/soc/http://3f980000.usb/usb1/1-1/1-1.2…05/input/input1

    U: Uniq=

    H: Handlers=sysrq kbd leds event1

    B: PROP=0

    B: EV=12001f

    B: KEY=3f 3007f 0 0 0 0 4c3ffff 17aff32d bf544446 0 0 1 130f93 8b17c007 ffff7bfa d951dfff febeffdf ffefffff ffffffff fffffffe

    B: REL=40

    B: ABS=1 0

    B: MSC=10

    B: LED=1f

    I: Bus=0003 Vendor=0c45 Product=800a Version=0101

    N: Name="USB USB Device"

    P: Phys=usb-3f980000.usb-1.2/input1

    S: Sysfs=/devices/platform/soc/http://3f980000.usb/usb1/1-1/1-1.2…06/input/input2

    U: Uniq=

    H: Handlers=mouse1 event2

    B: PROP=0

    B: EV=17

    B: KEY=1f0000 0 0 0 0 0 0 0 0

    B: REL=103

    B: MSC=10

    I: Bus=0003 Vendor=0c45 Product=800a Version=0101

    N: Name="USB USB Device"

    P: Phys=usb-3f980000.usb-1.2/input3

    S: Sysfs=/devices/platform/soc/http://3f980000.usb/usb1/1-1/1-1.2…08/input/input3

    U: Uniq=

    H: Handlers=js0 event3

    B: PROP=0

    B: EV=1b

    B: KEY=7fff0000 0 0 0 0 0 0 0 0 0

    B: ABS=100 3063f

    B: MSC=10

    I: Bus=0000 Vendor=0000 Product=0000 Version=0000

    N: Name="lircd-uinput"

    P: Phys=

    S: Sysfs=/devices/virtual/input/input4

    U: Uniq=

    H: Handlers=sysrq kbd event4 rfkill

    B: PROP=0

    B: EV=100003

    B: KEY=ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe

    I: Bus=0000 Vendor=0000 Product=0000 Version=0000

    N: Name="eventlircd"

    P: Phys=/dev/input/event4

    S: Sysfs=/devices/virtual/input/input5

    U: Uniq=

    H: Handlers=event5

    B: PROP=0

    B: EV=3

    B: KEY=ff ffffffff 0 0 0 0 f 0 0 0 0 0 0 3fdff 7fff8fff ff03ff 0 0 0 0 0 0 0 0

  • OK, let's try something different. We can remap the OK key with a hwdb file.

    First install the system tools addon (from LibreELEC repository -> Programs) as we'll need the evtest program. Also remove the udev conf file from the previous test.

    Reboot with only the wireless remote connected, then ssh in and stop kodi.

    Code
    systemctl stop kodi

    Now lookup the remote in /proc/bus/input/devices. According to the infos in post 3 there should be 2 entries, one for the keyboard / remote part and one for the mouse - we're interested in the former. Look at the name entries (Name="2.4G Smart Remote") and the handler (Handlers=sysrq kbd eventX) to locate it - ignore the one with the mouse handler.

    We need the event device number (eventX) and sysfs path from that block:


    Now run evtest on the event device (substitute event0 with the event device number from above)

    Code
    evtest /dev/input/event0

    Press the OK button, you should get something like this:

    Code
    Event: time 1510571041.251851, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70028
    Event: time 1510571041.251851, type 1 (EV_KEY), code 352 (KEY_OK), value 1
    Event: time 1510571041.251851, -------------- SYN_REPORT ------------
    Event: time 1510571041.291835, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70028
    Event: time 1510571041.291835, type 1 (EV_KEY), code 352 (KEY_OK), value 0
    Event: time 1510571041.291835, -------------- SYN_REPORT ------------

    We are interested in the scancode of the button, that's the value in the EV_MSC line. In the output above that would be 70028. The EV_KEY line tells us which key code the button/key is mapped to - in above example it's KEY_OK (which kodi can't handle), we want to remap that to KEY_ENTER (which kodi supports).

    Now stop evtest with ctrl-c.

    Next thing we need is the modalias of the input device. We can get that with udevadm using the sysfs path from above. Run the following command, replace the long /devices/platform/... path with the one you got from /proc/bus/input/devices

    Code
    udevadm test /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:25A7:5704.0001/input/input0 2>&1 | grep ^MODALIAS

    This should print a line like this:

    Code
    MODALIAS=input:b0003v05A4p9881e0110-e0,1,4,11,14,k77,7D,7E,7F,160,ram4,l0,1,2,sfw

    The important info from that line is the "input:bXXXXvYYYYpZZZZ" part. In your case that would probably be "input:b0003v25A7p5704" (b0003 is USB bus, followed by v and uppercase USB vendor id, followed by p and uppercase USB product id) - we can ignore the stuff after that (eXXXX is the version info from USB).

    Now with this info we can create a /storage/.config/hwdb.d/70-local-keyboard.hwdb file with the following content. Replace the "input:..." and the scancode in KEYBOARD_KEY_XXXXX with your values. Don't forget the "*" at the end of the evdev:input:... line!

    Code
    evdev:input:b0003v05A4p9881*
     KEYBOARD_KEY_70028=enter

    To activate the config run the following commands:

    Code
    udevadm hwdb --update
    udevadm trigger -s input

    Then run evtest again, press the OK button and verify that you now see KEY_ENTER in the EV_KEY lines

    Code
    evtest /dev/input/event0
    ...
    Event: time 1510573065.623580, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70028
    Event: time 1510573065.623580, type 1 (EV_KEY), code 28 (KEY_ENTER), value 1
    Event: time 1510573065.623580, -------------- SYN_REPORT ------------
    Event: time 1510573065.663566, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70028
    Event: time 1510573065.663566, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0
    Event: time 1510573065.663566, -------------- SYN_REPORT ------------

    If it doesn't work please post the evtest output and the contents of your hwdb file.

    so long,

    Hias

  • I'm really sorry, seems the "OK" button is mapped to the enter key

    Code
    Event: time 1510624396.075085, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70028
    Event: time 1510624396.075085, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0

    Apparently by default, the remote is in mouse mode or something. The button is disable. The button generates no inputs at all (nothing in evtest). I pressed every button on the remote just to see the outputs in evtest and apparently pressing the mouse looking button enabled the "OK" button. This setup is so damn stupid

    Anyways, problem solved. Thank you very very much for your help

  • Thank you HiassofT for all the detailed instructions. I have a remote with usb dongle. I followed your guide. What if some buttons dont register under evtest? For example I hit the Home button and it shows nothing, no event in evtest.

  • Thank you HiassofT for all the detailed instructions. I have a remote with usb dongle. I followed your guide. What if some buttons dont register under evtest? For example I hit the Home button and it shows nothing, no event in evtest.

    What kind of remote and receiver is this? If it's an IR remote and the receiver shows up in "ir-keytable" you have to follow the guide in the wiki Infrared Remotes [LibreELEC.wiki]

    The remotes discussed in this thread are of a different type, they can be IR but also RF, the important difference is that the receiver shows up as a normal HID device, like a USB keyboard.

    Some of these receivers show up as 2 input devices, often one for the "keyboard"/"buton" part and one for "mouse". If that's the case also try the other one with evtest.

    For example the rather popular Ortek/Gmyle/Hama/... VRC-1100 exposes the volume buttons via the "mouse" input device. No one knows why the manufacturer choose to do this, but it's the way it is.

    Manufacturers might also have chosen to make some buttons only available in special modes - eg there might be a "mouse mode" button or sth like this on the remote which if pressed automagically enable some buttons - and maybe disable some other ones.

    Yes, it's weird, but thats how some manufacturers want their remotes to operate. As this is happening inside the remote and/or inside the receiver there's not much you can do about it.

    so long,

    Hias

  • fdeb986c6d2029a0d6ac940548b46089a4b8cabf.jpg

    It's this remote with USB dongle. Only the 4 color buttons and power are IR. All the rest is RF and work like keyboard.

    ID_VENDOR_ID=2052

    ID_MODEL_ID=0121

    Yes it does show up as 2 input devices, "keyboard" and "mouse". Most of the RF buttons don't register keystroke at all under libreelec 8.2.4. (and 9)

    Volume, Home, Play/Pause dont register.

  • So I have followed 51-these-are-not-joysticks-rm.rules guide with no success

    [Solved] Keys from USB Remote Control not detected

    Is that guide for remotes that no buttons work at all? Or is it for cases like myself where only some buttons

    don't register?

    It is still not clear to me if I can make all the RF buttons to register in LibreELEC or not? I want Volume Play Home to work but

    they are not seen in evtest when pressed.

  • When testing things make sure you have stopped kodi and eventlircd so no process is grabbing (taking away the events) from you. evtest will warn you if you try to access an input device which is grabbed, so it should be pretty obvious if that happens.

    evtest should then show all events that come from the input devices.

    The IR thing is not quite clear to me, did you see an IR receiver device when running "ir-keytable"? It's a bit unlikely that the USB receiver would expose both HID plus IR devices but you never know.

    so long,

    Hias

  • I did as you said

    systemctl stop kodi

    evtest /dev/input/event3

    event 3 was the keyboard device not the mouse device.

    Are you saying that all the RF keys I press should show up in evtest?

    About IR, I don't understand why we are talking about IR. That doesn't interest me at all. I want to focus and solve the RF keys problem.

  • So I did a new test and found something interesting.

    Connected this remote's USB dongle to a windows PC and installed KODI under windows.

    Used Keymap Editor addon. All keys register here but here is the interesting part.

    The keys that also register under LibreELEC give a number like 61656 in KODI Windows.

    The keys that don't register in LibreELEC, do work here in KODI Windows but give a very long strange number like 16839168.

    Does that mean anything? Does that help?