[RC] How to configure lirc?

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.

2 Likes

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.

Maybe it’s an issue related to hardware problems.

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.

lsmod says:
lirc_dev 11364 1 lirc_rpi
rc_core 25741 1 lirc_dev

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 ?

Any reason you’re using non standard pins?? see here http://ozzmaker.com/wp-content/uploads/2013/10/IRwiring2.png?csspreview=true

Your command is wrong, the commas should be spaces like this
modprobe lirc_rpi gpio_in_pin=0 gpio_out_pin=1

http://aron.ws/projects/lirc_rpi/

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.

Does this command work with the RPI2?

Yes, it should work

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:

dtoverlay=lirc-rpi:gpio_out_pin=19,gpio_in_pin=23,gpio_in_pull=down

Thanks. So far I could manage to irrecord and irw at the standard pin.
Unfortunately your syntax doesn’t work either.

Not sure about your receiver, may be pull=up check logs to see what’s going on on boot

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.

You still have the syntax wrong, it’s a colon after lirc-rpi not a comma…

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):

LIRCD_ARGS="–listen"
LOAD_MODULES=true
DRIVER=“default”
DEVICE="/dev/lirc0"
MODULES=“lirc_rpi”

It’s hard to find any information regarding setting up lirc with the new kernel.
Maybe you can point me in the right direction.

I was trying the same thing and finally had success with irsend when I used the instructions from here:
http://wiki.openelec.tv/index.php/Guide_to_Lirc_IR_Blasting

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”

Ben

Thanks for the right direction. I will have a look when being at home again.