LibreELEC 9.2.6 Raspberry 4 and IrDA Dongle

  • Hi there, here is a newbee who wants to enjoy Kodi ;)

    Yes, I 've checked the wiki (Infra-Red Remotes - LibreELEC.wiki) and tons of other pages with content of IR Remote and Kodi.

    Unfortunally I'm now totally confused about remotes. But step by step.

    dmesg relevant output:

    Code
    [    1.756522] usb 1-1.3: new full-speed USB device number 4 using xhci_hcd
    [    1.850997] usb 1-1.3: New USB device found, idVendor=066f, idProduct=4200, bcdDevice= 0.08
    [    1.851008] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [    1.851017] usb 1-1.3: Product:  IrDA/USB Bridge
    [    1.851024] usb 1-1.3: Manufacturer:  Sigmatel Inc

    I'm missing the device id, so I think the driver is not loaded, so I editied (in correct way) the /flash/config.txt:

    Code
    .
    .
    [all]
    include distroconfig.txt
    
    dt_overlay=gpio-ir

    But ir-keytable still says:

    Code
    /sys/class/rc/: No such file or directory


    According to this post I've tried to edit udev rules (usr/lib/udev/rules.d/98-eventlircd.rules), but can't edit it. What do I have to mount for that?

    From here on I'm struggling to get the device running.

    My question:

    1. Is it possible to use any recognised USB IR-Dongle (like the mentioned above) ?

    2. How to use a simple IR Receiver (like TSOP 1238) There are many HowTo's but it seems that Libreelec is a little bit special ?

    Thanks for your attention

  • 1) I would say NO, at least NOT the device you mentioned above because IrDA/USB Bridge purpose is 2-way data transfers between IrDA devices (mostly in past) and AFAIK in general it's a quite different protocol than any of IR remote control protocols. Maybe some IrDA devices can be also used as IR RC receiver but I don't have any experience with this and it may vary. See Infrared Data Association - Wikipedia versus Remote control - Wikipedia

    2) On RPi 4B it's not a big difference between Raspberry_Pi_OS and LibreELEC (with the same or similar kernel release) regarding to IR remote control configuration, you just need to use the proper config files / config files paths in LibreELEC as some default files are in read-only filesystem and you need to put the files (that you need to edit) to override paths as described in wiki here: Infra-Red Remotes - LibreELEC.wiki

    Everything is working fine on RPi 4B / LE 9.2.6 so just read carefully and follow the instructions.

    The simple IR sensor can be used on RPi through GPIO pins.

    The /flash/config.txt update you have done should be OK, although I would put a pin number there:

    dtoverlay=gpio-ir,gpio_pin=18

    You may change the GPIO pin, GPIO18 is a default when not specified.

    Connect the IR sensor's data pin to GPIO18,, Vcc to 3,3V, GND to GND, reboot the RPi and use ir-keytable to configure / map keys in accordance to wiki examples. That's all.

    Also don't forget to update the RPi's bootloader to some of recent versions (at least directly from LE 9.2.6).

    In case you still won't get a reply from ir-keytable similar to example below, your LE installation is probably screwed up somehow and consider to start with a fresh LE 9.2.6 installation:

    Found /sys/class/rc/rc0/ with:

    Name: gpio_ir_recv

    Driver: gpio_ir_recv

    Default keymap: rc-rc6-mce

    Input device: /dev/input/event1

    LIRC device: /dev/lirc1

    Attached BPF protocols:

    Supported kernel protocols: lirc rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp imon rc-mm

    Enabled kernel protocols: lirc nec

    bus: 25, vendor/product: 0001:0001, version: 0x0100

    Repeat delay = 500 ms, repeat period = 125 ms

  • Thanks a lot for your explanation. Following this I'm very close to success.

    Now I installed a IR remote sensor (gpio=18) on the Raspi as mentioned in your answer. Also I used a fresh install.

    So, I'm lucky to have signals. I edited /storage/.config/rc_keymaps/custom_remote changed the first line to # table custom_remote, type: rc-5

    Finally I get the keys and working remote if I start ir-keytable in the shell. After reboot the remote is not working, I have to start ir-keytable in the terminal, then it's ok. So lirc seems not to start during boot, but:

    The line with ConditionPathExists=/storage/.config/lircd.conf was not met... confuses me again. The dates are not correct and it seems that lirc is not correctly configured.

    I disabled the /storage/.config/rc_maps.cfg as mentioned in LIRC Support. No success

    I took a look at <strong>/etc/lirc/lircd.conf</strong>, it's empty, so I did nothing with /storage/.config/lircd.conf. As I remember it was used like the key_maps.cfg and it couldn't be the reason for my issue because after starting ir-keytable it's working...

    I created and did some changes in <strong>/storage/.config/lirc_options.conf</strong>. No success

    So, finally I am at the last lines of the wiki, where it mentiones:

    Quote

    Sometimes lircd will run after ir-keytable and in-kernel decoding is disabled as expected.

    I find no information where to disable these.

    Can anyone give me a hint, please.

    Thanks for your attention

    EDIT

    OK, I solved the problem. I had to set the protocol in /storage/.config/rc_keymaps/custom_remote correctly.

    There was

    # table custom_remote, type: unknown

    now I use

    # table custom_remote, type: nec

    and it's running.

    Thanks again, I move to the next problem....

    Edited 2 times, last by Weizenkeim: solved (January 26, 2021 at 5:27 PM).

  • Don't try to do many unnecesary things... ;)

    It looks you did not use the -a parameter properly. After any change in mapping file ( /storage/.config/rc_keymaps/custom_remote ) do this to save the changes permanently:

    systemctl stop kodi

    systemctl stop eventlircd

    ir-keytable -a /storage/.config/rc_maps.cfg -s rc0

    systemctl start eventlircd

    systemctl start kodi


    Of course in your /storage/.config/rc_maps.cfg file you need to have this line:

    gpio_ir_recv * /storage/.config/rc_keymaps/custom_remote

    Test with

    ir-keytable -t -s rc0

    while pushing RC control buttons to check if you are receiving scancodes (need to have the appropriate RC protocols enabled, for example ir-keytable -plirc -pnec -pRC5 -s rc0 )

    Then use

    irw

    to test the key mapping.

  • :thumbup: Thanks

    The -a parameter I used as you mentioned wrong... Now, I may be familar with the usage. I had a VDR running a decade ago. But the lirc support was totally different.

    By the way, the wiki says:

    Quote

    Once you are finished with the keytable, save the file, stop ir-keytable -t with + and then restart it with the keytable file:

    What does this '+' mean? I couldn't stop it with that key. Misunderstanding or outdated?

  • You are welcome. :)

    Perhaps there's a typo and CTRL+C should be there instead of just + :)

    So if everything is already working fine, please mark the thread as resolved.

    Edited once, last by ghtester (January 26, 2021 at 8:24 PM).