I want to use the RPI 2 as a remote control. So I was trying to configure lirc.
I added “dtoverlay=lirc-rpi,gpio_out_pin=19,gpio_in_pin=23” to /boot/config.txt.
When I use “irw” or “irrecord” it doesn’t recognize my remotes.
In the blog I could read “Most remotes should now work out of box without any additional configuration. If you’d like to configure a GPIO remote, check out our Wiki for instructions”. However,I couldn’t find any entry abot remotes in the wiki.
Is there any proper way to use te RPI2 as a remote control?
Before you can use irrecord you need to stop the already running lircd service, because it keeps /dev/lirc0 busy. To do so:
sudo systemctl stop lircd_helper@lirc0
Once that is stopped you can use irrecord - but you must specify the correct device node as the default is incorrect:
irrecord -d /dev/lirc0 /home/osmc/lircd.conf
Once you’re finished you can start lircd again:
sudo systemctl start lircd_helper@lirc0
For the RC just place your lircd.conf file in /home/osmc as above - in the final release there will be a remote settings module in OSMC settings that lets you browse through a list of preset configurations or browse to your own .conf file.
irw will only work while lircd is running, but will only have anything to report after you have already configured the remote profile. (use irw to verify that button presses are being sent to kodi)
btw you can add the dtoverlay option through the Pi settings module in OSMC settings by turning on GPIO remote support.
Unfortunately it doesn’t work anyway.
Neither irrecord when lirc has been stopped nor irw when lirc is running receive signals by my remotes.
When I use the dtoverlay by option the RPI won’t start anymore.
I would check the connections for your IR receiver are correct (it should be running from 3.3v, not 5v like a lot of tutorials say) and that you have picked a recommended tsop chip.
It’s definitely working for me on Pi 1 and Pi 2.
Also run lsmod to make sure the lirc_rpi module is loading on boot.
The same receiver (TSOP31238) worked with RPI2. It´s connected to 3,3 V and pin 23 (GPIO11). I can measure 3,3V at the receiver.
Might there be a problem the entry in the config.txt: dtoverlay=lirc-rpi,gpio_out_pin=19,gpio_in_pin=23 ?
I have my GPIO receiver connected to the “standard” pin (12 - GPIO 18) and it works without specifying any pins.
It’s possible something else like a serial console may be already using the GPIO pin that you are using. I would suggest connecting it to the standard pin if possible and try that.
The standard pin is occupied by the Hifiberry.
I’ve just tried different things. I disabled the hifiberry overlay, deleted the gpio change setting and connected to the standard pin. Afterwards I tried irw but nothing is recognised.
I even tried to use the overlay in the osmc settings without any result.
Another TSOP doesn’t work either.
As I described earlier, irw will not show anything until you already have a working lircd.conf for your remote, because irw shows decoded key events. (And lircd doesn’t know what key you pressed if there is no valid lircd.conf file for your remote)
irrecord should work however.
You both have the dtoverlay syntax wrong, check here for an example:
Shame on me I mixed up the pin numbers. I used pin-numbers instead of BCM. So the correct entry should be like this: dtoverlay=lirc-rpi,gpio_out_pin=10,gpio_in_pin=11
Anyway that doesn’t work either. I checked logs which told me that lirc is loaded. I also tried various forms of spelling without any luck.
Thanks. I really appreciate your help. I had tried both the syntaxes.
After changing to another GPIO I could finally manage to receive signals. I already did irrecord and stored lircd.conf in the suggested folder.
Now I´m trying to send ir signals to other devices. I get timeouts after every irsend. Since there is no hardware.conf I don’t know how to configure lirc.
The hardware.conf is supposed to look like this (referring to raspbmc):
It was just specifying the socket that I was missing because of eventlircd being used.
I was using:
irsend SEND_ONCE “name of remote” “KEY_TO_BLAST”
but it needed to be:
irsend -d /run/lirc/lircd-lirc0 SEND_ONCE “name of remote” “KEY_TO_BLAST”