I wanted to try something new and easy upgrade for my OSMC media box. Here are the ingreedients:
LOAD REQUIRED OVERLAY
GUI: Select My OSMC menu, select Pi Config and on the Hardware Support tab “Enable LIRC GPIO support”.
CLI (another method): Add the dtoverlay=lirc-rpi line to the /boot/config.txt file.
Reboot and check dmesg:
lirc_dev: IR Remote Control driver registered, major 245 lirc_rpi: module is from the staging directory, the quality is unknown, you have been warned. lirc_rpi: auto-detected active low receiver on GPIO pin 18 lirc_rpi lirc_rpi: lirc_dev: driver lirc_rpi registered at minor = 0 lirc_rpi: driver registered! input: lircd as /devices/virtual/input/input2
Configure REMOTE BUTTONS:
First you need to disable the lirc service to gain access to the new device:
sudo systemctl stop lircd_helper@lirc0
Then we configure the buttons (follow the instructions):
irrecord -d /dev/lirc0 /home/osmc/lg2-osmc.conf
I named the following keys (on the unused number buttons):
- KEY_OK – 5
- KEY_HOME – 0
- KEY_LEFT – 4
- KEY_RIGHT – 6
- KEY_UP – 2
- KEY_DOWN – 8
- KEY_PLAYPAUSE -3
- KEY_BACK – 1
The following config was created:
begin remote name /home/osmc/lg2-osmc.conf bits 16 flags SPACE_ENC|CONST_LENGTH|REPEAT_HEADER eps 30 aeps 100 header 4530 4461 one 581 1661 zero 581 539 ptrail 579 repeat 578 1662 pre_data_bits 16 pre_data 0x3434 gap 108020 toggle_bit_mask 0x0 begin codes KEY_PLAYPAUSE 0xC23D KEY_HOME 0xD22D KEY_OK 0xA25D KEY_UP 0x42BD KEY_DOWN 0x12ED KEY_LEFT 0x22DD KEY_RIGHT 0x629D KEY_BACK 0x827D end codes end remote
I did not upload this config to the lirc database, as I haven’t configured every button.
Copy the config file to /etc/lirc/ and select the config file from the My OSMC >Remotes.
Reboot and enjoy.