Optimized Logitech Harmony remote with Libreelec

  • In general, it's easy to make the IR receiver working on RPi 4B using GPIO and IR sensor.

    At first, you need to enable it - put this line to /flash/config.txt file (read only by default, remount as RW before edit):

    dtoverlay=gpio-ir,gpio_pin=18

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

    Then connect the IR sensor's data pin to GPIO18, reboot the RPi and use ir-keytable to configure / map keys as described here: Infra-Red Remotes - LibreELEC.wiki

    I already connected the sensor some time ago. I just didn't know about the config, which is now added.

    Thanks!

    Edited 2 times, last by Skripo (January 24, 2021 at 6:02 PM).

  • I checked out the wiki but could not identify a harmony 650 remote map. I had made my own years ago for a 905 box but would like to avoid that if possible.

    Does anyone have a recommendation or have a key may I can use? DO I need to do anything with LIRC?

    Thanks!

    Edited once, last by Skripo (January 24, 2021 at 7:44 PM).

  • I don't remember much about this. I have a remote conf file, which uses the Pivos xdios profile from harmony. You might be able to modify it.

    Just realized my old tv supports CEC. From what I understand this is the easiest way to go correct?

    What setup do I need for harmony remote? Is it all the same? From what I gather the HDMI CEC just passes on TV's IR signal to the pi?

  • Please note:

    This information in this post is no longer helpful. Please refer to the guide created from it.

    Ok so CEC is not for me so I went with GPIO. So far I can detect remote pulse no problem. Here is what I did so far:

    1. Installed TSOP38238 IR receiver on GPIO 18 as per this article
    2. Installed Mecool KIII Pro device on Harmony 650. You can use another device, I just wanted to use my fully customized keymap from an install on an Amlogic box)
    3. Downloaded Libreelec image for RPI4 from this sites download section
    4. Burned to flash using Balena (you can use Rufus as well)
    5. Booted and enabled SSH, configured network and paired BT keyboard
    6. Disabled CEC in Kodi -> Settings -> Peripherals -> CEC, GPIO IR to work
    7. Connected to RPI4 using terminal on OS X (Use Putty for PC) to edit config.txt:
      1. Connect by entering: ssh root@libreelec
      2. Remount as RW: mount -o remount,rw /flash
      3. Edit the file using Nano: nano /flash/config.txt
      4. Add the following text to config.text (pin # = pin you used):  dtoverlay=gpio-ir,gpio_pin=18
      5. Save changes by pressing CTRL O
      6. Exit nano: CTRL X
      7. Remount as R only: mount -o remount,ro /flash
      8. Reboot to apply changes: reboot
    8. Opened terminal SSH'd into box and ran the following commands:
      1. systemctl stop kodi
      2. systemctl stop eventlircd
      3. ir-keytable -p nec -t
      4. Ran ir-keytable to make sure protocol was properly loaded
      5. Push remote button -to make sure IR events are detected.
    9. The final step is to make the change permanent by modifying the remote config file. Will update when finalized.

    Questions:

    1. The nec IR protocol seems to work for the Harmony 650 with Meccol KIII Pro, is that the one I should be using?
    2. I tried a few windows MCE but the Harmony software keeps saying I need an IR adapter and I need to enter the exact model. I ended up using Mecool KIII Pro because I created a custom map for another device. What is the best device to use on the Harmony 650?
    3. What is the recommended or closest key map I can use?

    I feel close to my goal, just need to finalize the config.

    Thanks!

    Edited 21 times, last by Skripo: Made it more readable to convert into guide if it works. (January 28, 2021 at 6:11 PM).

  • I hope you get this sorted out. I will soon be going down that road with the built in Argon One IR receiver.

    For now, I am using FLIRC receivers on my two LibreELEC units and Harmony 665 remotes. They work pretty well but I prefer the key mappings of the MCE remote so I've ordered a pair of MCE IR receivers from eBay. I think it cost something like $25 for both, coming from Asia.

    I apologize if my post is unhelpful but I would like to share the strategy of going with what works and working offline on new configurations. Few things in life are more frustrating than having no TV and your wife asking when it will be fixed. Pi are cheap enough that it's a good idea to have spare, anyway.

  • I use the Media Center Intel (IntelD54250WYK) in Harmony software with an TSOP3828 and rc-6 protocol in ir-keytable.

    The Media Center Intel has much buttons and with rc-6 you can use long press.

    with some other MCE devices I had problems that not all buttons worked


    nec protocol has no long press as I know... so I would go with rc-6

    for rc-6 I use a keyboard.xml as it simulates the keyboard

    I remaped the standard rc6_mce map and added some more buttons for the display menu


    I made some notes that I found to make it working:

    open command promt (for an empty 98-eventlircd.rules file)

    Code
    : > /storage/.config/udev.rules.d/98-eventlircd.rules

    found in this thread

    disable eventlircd


    autostart.sh

    Bash
    #!/bin/bash
    (killall eventlircd)&
    (mount -o rw,remount /flash)&
    exit

    I can show you my keymap but attention it is a stupid style ... had a harmony 555 and long time ago configured like that and continued it with my 650 (no desire to change it atm as it works). But you will see the difference from normal rc6_mce.

    in rc6_mce the KEYS are for remote

    KEY_NUMERIC_0(0x0200)

    in my map for keyboard

    KEY_0


    ah and for par ex KEY_ZENKAKUHANKAKU and others I used normal kodi debug log to identify what kodi uses (<f13> in keyboard.xml)