Posts by Skripo

    Verified working with 10.0.1

    Introduction

    After 6 years of using cheap boxes I decided to explore other hardware options. I was shocked at the price of Shields and some higher end boxes based on Amlogic S922X chips. After some pondering I ended up getting a Raspberry Pi 4 for it's price to power ratio. I realize that it may not be better or even equivalent to the aforementioned solutions, but it certainly beats my limping 905X based boxes.

    Using a RPI4 is definitely not for the plug and play hardware crowd but it is not that hard either, until you get to the IR part. There is no easy solution other than Flirc. Unfortunately your IR sensor is in the back, and even more insulting, it costs 1/2 the price of the PI4 itself! I also looked at using CEC which can be a good solution for people using their TV remote, but one of my main requirements was a solid universal remote.

    I have a rather complex audio setup and I value simplicity above all else, which is why I insist on an affordable, durable, and easy to use remote like the Harmony 650. To me the 650 is the ideal remote and more importantly, it's survived about 8 years so far, which is a testament to its great design. As a dyed in the wool gadgeteer, I originally bought their more expensive model but my family managed to break the screen within 3 months. And let's face it, how often do you really need a touch screen?

    After struggling with outdated and spread out information I was fortunate enough to get help from ghtester and HiassofT to configure my install. This guide is my attempt to pay it forward.

    Please note:

    • This guide does not try to explain the why of the subject, rather the how which is why I cannot give support. Please direct your questions to the forum experts.
    • I put this together from a few sources so I may have mis-remembered a few things. Please do the forum a favour and let me know if I need to change, correct, or amend this guide.

    Hardware Used

    1. Raspberry Pi 4B 2GB
    2. RPI4 enclosure that allows infrared signals to pass through the front. I am partial to this one but you do need to carefully align the sensor.It's pretty cool looking and includes the power supply, fan, and heatsinks fro $21 CAD. Pretty good deal if you ask me.
    3. TSOP38238 IR receiver - Installed on GPIO 18 as per this article.
    4. Harmony 650

    Files needed

    1. LibreELEC USB-SD Creator app
    2. mecool rc_keymap in the files.zip file attached to this post
    3. rc_maps.cfg in the files.zip file attached to this post

    Setup

    1. Install the IR TSOP as per this guide. It's very easy, only 1 component and 3 wires. Do not install in an enclosure until you confirm proper operation.
    2. Install the Mecool KIII Pro device on your remote using the Harmony software.
    3. Downloaded the LibreELEC USB-SD Creator and use it to select the latest LE RPI4 image and burn it to an SD card.
    4. Plug in a USB mouse. A keyboard, while not strictly necessary may be useful to ease text entry.
    5. Put the SD card in your RPI4 and boot. Kodi's wizard will walk you through the initial setup:
      1. Enable SSH
      2. Change the default name from Libreelec to whatever you want, or leave as is
      3. Configure your network
      4. Set wait for network before booting. I set a 20 second maximum wait time use whatever works for you
      5. Disable CEC in Kodi: System -> Settings -> Input -> Peripherals -> CEC Adapter -> Disable
      6. Reboot to make sure it reconnects to your network with the proper name, default is Libreelec.
    6. In OS X Finder, you should see Network under the locations section in the left panel.
    7. Click on it and then on Libreelec, or whatever name you used when you initially set up Kodi. It will now appear in the side panel of connected network devices.
    8. Open the Configfiles folder and drag in the rc_maps.cfg file attached to this post. Please note that many guides will walk you through terminal to do this. Fortunately, some very forward thinking developer designed it so that the normally hidden .config directory is automatically mounted as Configfiles, making it much easier to accomplish these tasks from a computer.
    9. Open the rc_keymaps folder and drag in the mecool file attached to this post.
    10. Now we need to ssh into the RPI4. Open Terminal in OS X or Putty in Windows:
      1. Connect to the RPI4 by entering: ssh root@libreelec (or ssh root@nameyougaveit)
      2. When prompted for password, enter it. The default is: libreelec
      3. We need to remount the /flash directory as read/write to modify a file: mount -o remount,rw /flash
      4. We now need to edit the file using the built in text editor, Nano: nano /flash/config.txt
      5. Add the following text to config.text. just above the End of Default Configuration text. (pin # = pin you used, default is 18 for most people 23 is for Argon One). dtoverlay=gpio-ir,gpio_pin=18Save changes with CTRL O
      6. Exit nano with CTRL X
      7. To finish, remount /flash as read only: mount -o remount,r /flash
    11. After making any changes to the rc_maps file you need to make it permanent. Enter the following:
      1. systemctl stop kodi (The system may seem like it crashed but be patient, it can take almost a minute)
      2. systemctl stop eventlircd
      3. ir-keytable -a /storage/.config/rc_maps.cfg -s rc0
      4. systemctl start eventlircd
      5. systemctl start kodi
      6. Reboot to apply changes: reboot
    1. When rebooted, ssh back into the box to test your work:
      1. ssh root@libreelec (or ssh root@nameyougaveit)
      2. Enter: irw
      3. Push the buttons on your remote to test. Each button should be properly labeled. If you need to remap buttons, do it in the Harmony software to avoid complications.
      4. Use CTRL C to exit the testing routine
    2. Close your ssh session with exit and open your beverage of choice!

    Let me know if I need to make changes to the guide.

    I believe this thread should be marked as Resolved as you are asking off-topic quiestions here which you should perhaps ask in your another - original thread... But hopefully you can finish what you need if you follow instructions already published here: RE: LibreELEC 9.2.6 Raspberry 4 and IrDA Dongle Do not disable anything, do not use -c parameter, just make the config files properly ( use some of example / default mapping files from the /usr/lib/udev/rc_keymaps folder as template, which is most similar to your remote control - the first line is important ), put them to override folders and use commands mentioned in the linked thread and that's all...

    Maybe a small tip - search the default mapping files for a protocol that you are looking for, for example:

    grep -rn '/usr/lib/udev/rc_keymaps/' -e 'rc6'

    It will list the files that might be interesting for you.

    Agree on marking resolved, I should have started another thread.

    One of the most frustrating things abut the whole process is that the guides that people constantly point to are incomplete, outdated, or written for programmers. It's been a very frustrating experience.

    Thank you VERY MUCH for your help, everything works now!


    Your mecool file uses DOS line endings, that won't work, you have to save it with unix line endings. Also KEY_APP and KEY_DTV aren't valid keys.

    In your rc_maps.cfg you use a wrong driver name, you have to use "gpio_ir_recv", not "gpio-rc-recv" - see the output of ir-keytable.

    so long,

    Hias

    Thank you very much for taking the time to look through my file. I was struggling with the gpio-rc-recv vs gpio_ir_recv. I clearly saw the latter driver name while testing but the sample file was configured differently so I followed that, as I was being constantly told to follow that.

    I had no idea about the line endings and used Atom to convert them and BAM it worked. On a side note, I tried using the a few included files, notably minix-neo, and it had the same issue.

    Thank you very much for your help, I will create a guide from all the help I received on this forum.

    So I know my remote responds to the nec protocol and that my PI4 sees it and reports events. Thats all good.

    After hooking up my gpio IR and testing to make sure it responds with my Harmony set to mecool device I did the following:

    1. Copied my rc_maps.cfg to /storage/.config/
    2. Copied my mecool table to /storage/.config/rc_keymaps
    3. Added dtoverlay=gpio-ir,gpio_pin=18 to /fash/config.txt
    4. and finally remounted flash with mount -o remount,rw /flash

    I am not sure which driver to use so I copied from the rc_maps.cfg.sample file and ended up with this in my rc_maps.cg:

    Code
    gpio-rc-recv *  mecool

    When I try to run the table manually using ir-keytable -c -w /storage/.config/rc_keymaps/mecool,I get the following error:

    Code
    Invalid parameter on line 1 of /storage/.config/rc_keymaps/mecool
    ir-keytable: Failed to read table file /storage/.config/rc_keymaps/mecool

    Any words of wisdom? I attached my files in case that helps.


    By the way, the wiki states:

    "LibreELEC still ships with LIRC so IR remotes with non-standard protocols and rather special setups can be supported. In general, keep LIRC disabled (in LibreELEC Settings → Services) and only enable it for exceptional cases where you actually need it."

    I can't find the setting anywhere. Do I still need to disable lirc?

    ghtester I used Terminal (like putty but built in to osx) to SSH in no problem

    nsst I already set the overlay and the Pi detects key presses just fine. I just need to make the nec protocol the default but can't reveal the hidden files. I already see non-writable files without remounting but tried anyway, no difference.

    Here is my file structure without hidden files:

    Why does the config directory exist? It seems identical to the one that is supposed to be hidden?

    Thanks!

    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!

    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!

    Quick tip I got from one of the forums long ago that should be added to remote config file creation tutorial.

    Rebooting the box every time you want to test the remote gets real old real fast. Type this into your SSH terminal window every time you saved and are ready to test:

    remotecfg /storage/.config/nameofyourremotefile.conf

    In my case it was called test remote so I typed in remotecfg /storage/.config/testremote.conf