1

I'm using a Pi 3B as an IR transceiver, using the general approach described by this article.

I found that Raspbian kernel 4.19 and beyond have changed lirc. I followed the guidance in this article to make necessary changes.

Specifically: Changing dtoverlay in /boot/config.txt to:

dtoverlay=gpio-ir,gpio_pin=18
dtoverlay=gpio-ir-tx,gpio_pin=17

Apparently this configuration can only send or receive at any time.

Receive configuration of /etc/lirc/lirc_options.conf:

[lircd]
nodaemon        = False
driver          = default
device          = lirc1

Transmit configuration of /etc/lirc/lirc_options.conf:

[lircd]
nodaemon        = False
driver          = default
device          = lirc0

Necessary to restart lirc to change from transmit to receive:

sudo /etc/init.d/lircd stop
sudo /etc/init.d/lircd start

It appears to work normally in receive mode (run mode2, press key on remote)

$ sudo mode2 -d /dev/lirc1      Using driver default on device /dev/lirc1
Trying device: /dev/lirc1
Using device: /dev/lirc1
Running as regular user pi
pulse 906
space 887
pulse 890
space 886
pulse 890
....
^C
$

Transmit mode with device lirc0 does not work initially:

 $ irsend SEND_ONCE PHILIPS_CD KEY_OPEN

hardware does not support sending
Error running command: Input/output error

The last post in this thread provides a working solution -- start the LIRC daemon with this command:

sudo lircd --device /dev/lirc0

Since lircd is already started by the installation of lirc (sudo apt-get install lirc), I first have to run

sudo pkill -SIGTERM  lircd

to kill the instance already running.

Once I run those commands, irsend works correctly:

$ sudo pkill -SIGTERM  lircd
$ sudo lircd --device /dev/lirc0
$ irsend SEND_ONCE PHILIPS_CD KEY_OPEN
$

My question is how can I correct the init.d lircd configuration so the system boots in a usable state? e.g. allowing irsend to function.

The "start" section of the file "lircd" in /etc/init.d looks like this:

case "$1" in
        start)
                # start lircd
                [ -d "/run/lirc" ] || mkdir -p "/run/lirc"

                log_daemon_msg "Starting remote control daemon" "LIRCD"
                start-stop-daemon --start --quiet --oknodo \
                        --exec /usr/sbin/lircd -- < /dev/null
                log_end_msg $?

                # retain compatibility with old clients
                ln -fs /run/lirc/lircd /dev/lircd
                ;;
        stop)

I'm not experienced in init.d. and it is not clear where I would use the shell command "sudo lircd --device /dev/lirc0" in this file. Can anyone provide guidance on how this could be edited to start the daemon with the required parameters that allow irsend to function?

2

I had lirc working on over a dozen Pi-zero systems that I shipped with IR remotes. Then raspbian with kernel 4.19 was released, and I spent over a month trying to get lirc to work with it - Impossible. Finally, I went back to the 4.14 kernel and lircd-0.9.4c and it took about 30 minutes to get everything configured and working perfectly.

You are not alone; several people have even posted patches for Buster to get lirc working again. For example: https://gist.github.com/billpatrianakos/cb72e984d4730043fe79cbe5fc8f7941

Sorry I cannot be more optimistic, but if your time is worth anything and you don't need some bleeding edge feature, you might consider rolling back to something that is known to work reliably.

| improve this answer | |
1

dtoverlay=gpio-ir-tx,gpio_pin=17

dtoverlay=gpio-ir,gpio_pin=18

After a lot of issues in trying to get LIRC installed on a Buster version of Rasbian, I finally figured out that the order in which you put thoses lines in the config.txt is VERY important. I had the tx-pin second and that didn't work until i moved it tot he first place!!!

Hope this saves somebody time :-)

| improve this answer | |
0

Try reading the documentation

Name:   lirc-rpi
Info:   This overlay has been deprecated and removed - see gpio-ir
Load:   <Deprecated>

Following 4 year old posts for obsolete OS is a waste of time.

| improve this answer | |
  • I tried that route with gpio-ir, and wasn't able to get it to work either. My thread on that topic: raspberrypi.org/forums/… – tim11g Feb 3 at 19:54
  • I went back to kernel 4.19, and using gpio-ir and gpio-ir-tx overlays. Reproducing steps taken on the 4.15 kernel, I was able to get back to the same point, with the exact same result. The question above has been edited to reflect kernel 4.19 and gpio-ir and gpio-ir-tx overlays. – tim11g Feb 4 at 2:37
  • @tim11g Unfortunately I can't help with detail, as I don't currently use lirc. If you still using old SysV tutorials it is never going to work. raspberrypi.stackexchange.com/a/81885/8697 may help. – Milliways Feb 4 at 3:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.