ir remote with arch linux and lirc
I have an HTPC running Kodi (Formerly XMBC) and I’ve been trying to get an old IR remote working with it. I’ve got Kore on android currently controlling Kodi, but I wanted to see if I could get an old Microsoft Media Center PC’s IR receiver to work.
I used one of these receivers:
I couldn’t find the actual MCE remote that went with the receiver, so I used this Sony DVD player remote, but any remote should work.
This took entirely too long for me to figure out. The last three days have been spent with the remote working one minute and then not for seemingly no reason and then it seemed to remap the buttons out of nowhere. It was a serious pain in the ass, but it seems to be working correctly now.
Here is what I did:
First, install lirc. I am running arch, so pacman -S lirc.
Edit /etc/lirc/lircd.conf
to:
|
|
Next edit your keymap. I copied /lib/udev/rc_keymaps/rc6_mce
to /etc/rc_keymaps/rc6_mce
. You can run ir-keytable -t -p SONY,RC6 -w /etc/rc_keymaps/rc6_mce
to figure out what codes your remote is using for each button. You can then edit /etc/rc_keymaps/rc6_mce
with the correct codes that your remote is using.
Here is my rc6_mce
:
|
|
Then edit the lircd unit (systemctl edit --full lircd.service
) to:
|
|
You should be able to start the lircd service with no errors. The arrow keys on the remote should work just like the arrow keys on the keyboard. Hitting the up button should scroll up through the history on the command line.
I am using this remote with Kodi standalone, so I need to add a Lircmap.xml
to /var/lib/kodi/.kodi/userdata/Lircmap.xml
|
|
This will map the remote buttons to Kodi actions.
You should be able to reboot and everything should work.