Edit the file at /flash/config
:
mount -o remount,rw /flash
vi /flash/config
- append
device_tree_overlay=lirc-rpi
mount -o remount,ro /flash
Check pinout on datasheet; use 3.3V rail, any GND, and data to GPIO #18/pin 12 (cf https://learn.adafruit.com/assets/5909)
IR5040 datasheet: http://www.tme.eu/en/Document/54a544ab7820a97322a14fb463e54018/ir5040.pdf
When looking at the component, flat side parallel to the ground plane, legs towards you, leg further from the other to the right:
- pin 1: GND
- pin 2: VCC (2.7~5.0V)
- pin 3: OUT
ssh root@mykodi
dmesg | grep lirc
(should give something like "lirc_rpi: auto-detected active low receiver on GPIO pin 18")killall lircd && mode2 -d /dev/lirc0
to check if it receives anything when pressing any button on the remote
In /storage/.config
:
irrecord -d /dev/lirc0
to start the recording wizard, use brand-remote-model pattern to name file- record at least the following keys:
KEY_UP
KEY_DOWN
KEY_LEFT
KEY_RIGHT
KEY_PLAY
(will play/pause)KEY_PAUSE
(optional, will do the same asKEY_PLAY
)KEY_STOP
KEY_VOLUMEUP
KEY_VOLUMEDOWN
KEY_INFO
KEY_EPG
(contextual menu)KEY_EXIT
(back)
lircd will look for a file named lircd.conf
: If the remote doesn't have any effect but the receiver is working (as verified with mode2
), then double check the remote config file is named lircd.conf
.
ln -s "$(pwd)/myremote.lircd.conf" "$(pwd)/lircd.conf"
irw /rub/lirc/lircd-lirc0
and press remote buttons. Should see the keymaps as the buttons are pressed.
Check if lircd works at all
killall lircd
/usr/sbin/lircd --nodaemon --loglevel=debug --driver=default --device=/dev/lirc0 --output=/run/lirc/lircd-lirc0 --pidfile=/run/lirc/lircd-lirc0.pid --release=_LIRCUP /storage/.config/lircd.conf
in one terminal/usr/sbin/lircd-uinput --loglevel=debug --release=_LIRCUP /run/lirc/lircd-lirc0
in another- press keys, see if there is any output
If keys configured successfully, try
irw -d /dev/lirc0
and press buttons. If it registers, check that/storage/config/lircd.conf
exists; file must belircd.conf
and not other name.
Helpful threads:
Sorry to hear. I’ve switched to CEC about three years ago and don’t use IR anymore.
Did you do the first step (and did it take?) You can check by opening the /flash/config file again and check that it has the extra overlay directive. You need to do it again when you swap the card because that’s all stored on the SD.
Or maybe your sensor is busted, you could try with a new one or you could build a circuit with a led and a resistor on the OUT pin. I’d expect the led to light up matching the pulses that the sensor receives if it’s functioning normally.I reread your comment and you’re saying it works in raspian so the sensor is most likely fine.Finally, you’ll probably have more luck asking on the libreelec forums; you’ll have a higher chance of finding someone currently using libreelec with an IR sensor.