GPIO Remote problems. Again

I don’t know why I have so much trouble with my XBMC/Kodi/OSMCs and remotes.

From a fresh PI 2 OSMC install. I plug the honeypi (http://www.honeypi.com/) GPIO receiver in. Under OSMC Settings app, I enable LIRC GPIO support. I then use a VRC-1100 remote. I can see the little LED flashing. If I ssh into the PI and run:
sudo modprobe lirc_rpi
sudo kill $(pidof lircd)
mode2 -d /dev/lirc0

I can see output from the remote at the prompt. So I copy the conf file for my remote from LIRC - Linux Infrared Remote Control, to the /etc/lirc directory. back in the OSMC GUI, I go to the remotes section and select my lirc.conf file (VRC-1100_Ro.lircd). Back in the SSH session I then run irw to see if the remote is translated, but nothing shows up. When this happened on past versions of XBMC/Kodi/OSMC I would then go to:
cd /sys/class/rc/rc0/protocols
echo +mce_kbd > /sys/class/rc/rc0/protocols #or take out the plus to make it only mce-kbd

to make this survive a reboot put it in /etc/rc.local. Unfortunately on the latest version of OSMC, there is no /sys/class/rc/rc0/.

Can anyone help me out? Has anyone gotten this to work.

Thanks,
Josh

Putting your custom lird.conf in ~/.config/ should load it automatically if I remember correctly.

I followed the instructions in this video to build my own IR receiver and set up lirc to use an old Tivo remote I had laying around. A couple things worked a bit differently running on osmc, like turning on the GPIO port in OSMC Settings instead of how it shows in the video, but it was pretty accurate and easy to follow.

Raspberry PI: XBMC Home Media Player - Adding IR Remote Control

A few comments and suggestions.

  • You don’t need to modprobe lirc_rpi - it will load automatically if you have Lirc GPIO support enabled in Pi config
  • The proper way to shut down lircd is sudo systemctl stop lircd_helper@*
  • It’s not recommended to copy your lircd.conf files into /etc/lirc - best to put it in /home/osmc and browse to it with the remote settings.

The lircd.conf file you have used I assume is this one:

http://sourceforge.net/p/lirc-remotes/code/ci/master/tree/remotes/auvisio/VRC-1100_Ro.lircd.conf

In that case it will not work because none of the key names are valid KEY_ or BTN_ names. Have a look at some of the bundled lircd.conf files we have included as examples.

In OSMC we pass lircd through uninput and eventlircd, thus key names can’t be any arbitrary names - they have to be compliant with kernel uinput key naming, for example KEY_OK, KEY_UP and so on.

If you run irw by itself or irw /var/run/lirc/lircd then you are actually looking at the lirc socket created by eventlircd - by that time the events have already been passed from lircd through kernel uinput to eventlircd, and the kernel will have filtered out the invalid key names.

If you run irw /var/run/lirc/lircd-lirc0 you will see the events coming directly out of lircd and you should see activity there even if the key names are invalid.

So basically you need to go through that lircd.conf and rename the key names to valid names. To see what key names Kodi is expecting, look in the linux-input-layer section of /usr/share/kodi/system/Lircmap.xml

1 Like

DBMandrake,

You’re right!

I used the current install to irrecord a conf file. I had to do it with a -f to force raw, and it made a file that I saved to a shared drive. Then I did a fresh install, enabled GPIO, and copied my file to /home/osmc. I then browsed to it. I then restarted (crucial part - it will not work until a restart) and it worked.

The only things left to figure out are how to speed up the repeat time for buttons pressed and how to make the mouse pad on the vrc-1100 work. It works with the USB IR sensor.

my irrecord command was something like:
sudo irrecord -d /dev/lirc0 -f /home/osmc/vrc-1100.conf

Thanks,
Josh

Glad you got it working. You could have probably just edited the key/button names in the file you already had, assuming the codes had been learnt correctly of course.

Yes you do need to reboot after enabling GPIO remote support for it to take effect as it is just a config.txt overlay setting that is only read on boot, however changes to lircd.conf don’t require a reboot - either the lircd service can be restarted, or you can re-browse to the conf file in the remote settings which also restarts the lircd service.

Regarding button repeat time - there is an eventlircd update in the pipeline that speeds up both the initial repeat delay and the repeat rate that will be pushed out at or before RC3. It was actually ready before RC2 but was accidentally left out.

Very much looking forward to this, myself. Takes forever for me to adjust the volume.