Infrared tutorial for rpi3 with latest OSMC?

Hi, I used to be able to use an IR receiver on my rpi3 a few years ago. Fast forward to today and it doesn’t work. From some reading I’ve discovered that LIRC doesn’t seem to be supported any more, rather kernel IR it seems.
Is there a newish tutorial/how-to available that I could follow? I found one tutorial however its dated 2018 so I think that its obsolete.
I have an A1294 Apple silver remote that I wish to use. I have an IR 3 pin receiver which are connected to the GPIO pins 1,9 & 12 (using GND pin 9 instead of GND pin 6 because I am using a 5v mini fan for cpu cooling).
Thanks in advance.

LIRC is still supported.

You should be able to select the Apple remote under My OSMC → Remotes.

Hi Sam, I can select the remote from the GUI but nothing happens after a reboot.

I found this tutorial posting but it hasn’t helped me.

Here’s some output commands. Looks like LIRC isn’t even running on my system. I’m a bit rusty on debug collecting etc. If you could direct me to get you the diags that would help troubleshoot that would be great.

– no output on dmesg
osmc@osmc-study:~$ dmesg | grep lirc
osmc@osmc-study:~$

– no output lsmod
osmc@osmc-study:~$ sudo lsmod | grep lirc_rpi
osmc@osmc-study:~$


osmc@osmc-study:~$ sudo ls -l /dev/lirc*
ls: cannot access ‘/dev/lirc*’: No such file or directory
osmc@osmc-study:~$


osmc@osmc-study:~$ sudo systemctl status lircd_helper@lirc0

  • lircd_helper@lirc0.service - lircd remote support
    Loaded: loaded (/lib/systemd/system/lircd_helper@.service; static)
    Active: inactive (dead)
    osmc@osmc-study:~$


osmc@osmc-study:~$ irw
Cannot connect to socket /usr/var/run/lirc/lircd: No such file or directory
osmc@osmc-study:~$

Have you checked your IR receiver is correctly connected to your Pi and working ? This might help Raspberry Pis, Remotes & IR Receivers! | The Pi Hut
Also have you enabled the gpio pins on the Pi ? The Basics of the Raspberry Pi GPIO Pins - Pi My Life Up
Could it also have anything to do with user/group permissions ?
I vaguely recollect having a permission issue on a 3B when getting my weather software to access a pressure sensor on the gpio pins

Thanks Jimi1 for the article. I confirmed I’m getting 3.3v at pins 2 and 3.
There’s definitely something amiss with my lirc function. Using the test commands in the article you posted, here are my outputs:

osmc@osmc-study:~$ sudo modprobe lirc_rpi
modprobe: FATAL: Module lirc_rpi not found in directory /lib/modules/5.15.92-1-osmc
osmc@osmc-study:~$ ps -eaf|grep lirc
root 236 1 0 16:35 ? 00:00:00 /usr/sbin/eventlircd --evmap=/etc/eventlircd.d --socket=/var/run/lirc/lircd -f
root 449 384 0 16:35 ? 00:00:00 sudo -u osmc LIRC_SOCKET_PATH=/var/run/lirc/lircd /usr/lib/kodi/kodi.bin --standalone -fs
osmc 726 700 0 16:40 pts/0 00:00:00 grep lirc

osmc@osmc-study:~$ mode2 -d /dev/lirc0
Using driver devinput on device /dev/lirc0
Cannot initiate device /dev/lirc0

To re-iterate this exact rPi and IR sensor worked about 3-4 years ago, albeit it with a Samsung remote for a different TV. Then I moved country and it went into storage for 3.5 years. I’ve since updated my osmc to the latest version, but lirc does not seem to be running.

Nothing to do with user perms as I have not added other accounts.

Troubleshooting a bit more, it seems that under My OSMC → Pi Config → Hardware Support that the gpio_pin (0 for disabled) was set to 0. I don’t know if that was reset to default after a recent update. I set the value to 18 and left the Enable SPI support option disabled.

I ran the mod2 command again and now I am seeing some progress when I press buttons on the remote:

osmc@osmc-study:~$ sudo modprobe lirc_rpi
modprobe: FATAL: Module lirc_rpi not found in directory /lib/modules/5.15.92-1-osmc
osmc@osmc-study:~$ sudo kill $(pidof lircd)
osmc@osmc-study:~$ mode2 -d /dev/lirc0
Using driver devinput on device /dev/lirc0
Trying device: /dev/lirc0
Using device: /dev/lirc0
code: 0xffffff0084fa1a00f6010001b2090000
code: 0x1f000001890f0000ca000001ae260000
code: 0xb600000173050000a900000193020000
Partial read 12 bytes on /dev/lirc0osmc@osmc-study:~$ mode2 -d /dev/lirc0
Using driver devinput on device /dev/lirc0
Trying device: /dev/lirc0
Using device: /dev/lirc0
code: 0x89721c001e0c1c007d23000153110000
code: 0x4f020001120200004f02000160060000
code: 0x4e0200015f0600004f0200015f060000
code: 0x4f020001120200004f02000160060000
Partial read 4 bytes on /dev/lirc0osmc@osmc-study:~$ mode2 -d /dev/lirc0
Using driver devinput on device /dev/lirc0
Trying device: /dev/lirc0
Using device: /dev/lirc0
code: 0x3e4a0000630000016e4a000061000001
Partial read 8 bytes on /dev/lirc0osmc@osmc-study:~$ mode2 -d /dev/lirc0
Using driver devinput on device /dev/lirc0
Trying device: /dev/lirc0
Using device: /dev/lirc0
code: 0xf81800008d000001e60a0000dd000001
code: 0xfd150000be000001400f0000a8000001
Partial read 8 bytes on /dev/lirc0osmc@osmc-study:~$

I selected the A1294 remote again and rebooted, and now it seems to work! Thanks guys

2 Likes

Excellent :+1: glad you got to the bottom of it.