[HowTo] Apple Remote on OSMC for Raspberry Pi 3

This guide describes how to get an Apple Remote (A1294 silver model) to work in OSMC version 2018.08-2 (Kodi 17.6) for Raspberry Pi 3 model B+.

I bought a very cheap TSOP4838 IR receiver on eBay.
The IR receiver pins are (bulge facing you, pins down, from left): 1 - OUT, 2 - GND and 3 - Vs
The Raspberry Pi pins I used are: 01 - 3.3V, 06 - GND and 12 - GPIO18
Connect IR receiver pin 1 to RPi pin 12
Connect IR receiver pin 2 to RPi pin 06
Connect IR receiver pin 3 to RPi pin 01

Now edit the /boot/config.txt to enable and configure lirc (Linux Infrared Remote Control) :

$ cd /boot
$ sudo nano config.txt

Add as last line:

dtoverlay=lirc-rpi,gpio_in_pin=18

I think that can be simplified to dtoverlay=lirc-rpi as it seems that lirc_rpi auto-detects the IR receiver on GPIO18.

Activate the apple silver configuration:

$ cd /etc/lirc/
$ sudo rm lircd.conf
$ sudo ln -s apple-silver-A1294-lircd.conf lircd.conf

Now reboot

$ sudo reboot

The Apple Remote should now work with OSMC!

The steps below are not necessary, but could help you verify that everything works:

$ dmesg | grep lirc
[    4.289234] lirc_dev: IR Remote Control driver registered, major 244
[    4.345142] lirc_rpi: module is from the staging directory, the quality is unknown, you have been warned.
[    5.411573] lirc_rpi: auto-detected active low receiver on GPIO pin 18
[    5.411759] lirc_rpi lirc_rpi: lirc_dev: driver lirc_rpi registered at minor = 0
[    5.411763] lirc_rpi: driver registered!
[    5.666436] input: lircd as /devices/virtual/input/input0

$ sudo lsmod | grep lirc_rpi
lirc_rpi               16384  2
lirc_dev               20480  1 lirc_rpi

$ sudo ls -l /dev/lirc*
crw-rw---- 1 root video 244, 0 Nov  9 17:14 /dev/lirc0

$ sudo systemctl status lircd_helper@lirc0
* lircd_helper@lirc0.service - lircd remote support
   Loaded: loaded (/lib/systemd/system/lircd_helper@.service; static; vendor preset: enabled)
   Active: active (running) since Fri 2018-11-09 18:43:34 CET; 9min ago
  Process: 352 ExecStart=/bin/sh -c /var/run/lirc/lircd-lirc0.sh (code=exited, status=0/SUCCESS)
 Main PID: 364 (lircd)
   CGroup: /system.slice/system-lircd_helper.slice/lircd_helper@lirc0.service
           `-364 /usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinput --output=/var/run/lirc/lircd-lirc0 --pidfile=/var/run/lirc/lircd-lirc0.pid /etc/lirc/lircd.conf

$ irw
cf 0 KEY_PLAY linux-input-layer
cf 0 KEY_PLAY_UP linux-input-layer
1 0 KEY_ESC linux-input-layer
1 1 KEY_ESC linux-input-layer
1 0 KEY_ESC_UP linux-input-layer
160 0 KEY_OK linux-input-layer
160 0 KEY_OK_UP linux-input-layer

Regards
Mogens Beltoft

You can change the config.txt in the Pi section and select the apple remote conf file from the Remotes section of the MyOSMC settings addon.

Hi,
I tried to install my Apple Silver Remote to use with the latest version of OSMC, on a RP3, using the steps suggested above… but it’s not working.

Typing dmesg | grep lirc I read:

[    7.023193] rc_core: IR keymap rc-lirc not found
[    7.023512] rc rc0: lirc_dev: driver gpio_ir_recv registered at minor = 0, raw IR receiver, no transmitter
[    8.386659] input: lircd as /devices/virtual/input/input5

When I try sudo lsmod | grep lirc_rpi nothing happens.
sudo ls -l /dev/lirc* gives me crw-rw---- 1 root video 243, 0 Nov 28 21:04 /dev/lirc0.

Finally, sudo systemctl status lircd_helper@lirc0 brings up:

● lircd_helper@lirc0.service - lircd remote support
Loaded: loaded (/lib/systemd/system/lircd_helper@.service; static; vendor preset: enabled)
Active: active (running) since Sat 2020-11-28 22:57:44 CET; 17min ago
Process: 363 ExecStart=/bin/sh -c /var/run/lirc/lircd-lirc0.sh (code=exited, status=0/SUCCESS)
Main PID: 414 (lircd)
Memory: 2.1M
CGroup: /system.slice/system-lircd_helper.slice/lircd_helper@lirc0.service
└─415 /usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinput > --output=/var/run/lirc/lircd-lirc0 --pidfile=/var/run/lirc/lircd-lirc0.pid /etc/lirc/lircd.conf

Nov 28 22:57:44 osmc lircd-0.9.4c[365]: Info: Initial device: /dev/lirc0
Nov 28 22:57:44 osmc lircd-0.9.4c[365]: Info: [lirc] protocol is enabled
Nov 28 22:57:44 osmc lircd-0.9.4c[365]: Info: lircd: Opening log, level: Info
Nov 28 22:57:44 osmc lircd-0.9.4c[365]: Warning: Running as root
Nov 28 22:57:44 osmc lircd-0.9.4c[365]: Info: Using remote: Apple_A1294.
Nov 28 22:57:44 osmc lircd-0.9.4c[415]: Notice: lircd(default) ready, using /var/run/lirc/lircd-lirc0
Nov 28 22:57:44 osmc systemd[1]: Started lircd remote support.
Nov 28 22:57:44 osmc lircd-0.9.4c[415]: Info: [lirc] protocol is enabled
Nov 28 23:03:05 osmc lircd-0.9.4c[415]: Notice: accepted new client on /var/run/lirc/lircd-lirc0
Nov 28 23:03:25 osmc lircd-0.9.4c[415]: Info: removed client

And when I run irw, all I get is: Cannot connect to socket /usr/var/run/lirc/lircd: No such file or directory

Still actively trying to debug, but I’m very new to lirc so it’s hard to figure out where the problem may lie. Any suggestion would be very welcome :slight_smile:

EDIT: Please see the full debugging log here.