2

I can't seem to get LIRC to work, the TV simply doesn't turn on when running the irsend command. Previously I've used the IR transmitter with an Arduino, and that works fine (verified today that moving it back to the Arduino and the TV turns on). It also works when connecting the 5V and GND of the raspberry pi but keeping the data in the Arduino.

So far, what I've done is to:

  1. Uncomment dtoverlay=gpio-ir-tx,gpio_pin=18 in /boot/current.txt. I have seen comments of people using GPIO 17, but I've tried both and it made no difference.

  2. Modify /etc/lirc/lirc_options.conf to have these values:

    driver          = default
    device          = /dev/lirc0
  1. Place the config in /etc/lirc/lircd.conf.d/<model>.lircd.conf (the power on has the same hex value as my Arduino sends).

  2. Rename the devinput.lircd.conf file to something else so it doesn't end with .conf.

There is a log entry of the lircd service that seems suspicious:

Dec 22 17:34:23 raspberrypi lircd-0.10.1[778]: Notice: accepted new client on /var/run/lirc/lircd
Dec 22 17:34:23 raspberrypi lircd[778]: lircd-0.10.1[778]: Info: Cannot configure the rc device for /dev/lirc0

but I can't seem to find a solution for it. And people who thought that was their problem later stated it was not actually an issue, so I'm not convinced this is the culprit.

I have read that there has been problems with getting LIRC to work with earlier versions of the Linux kernel (1, 2), and also of LIRC itself (1), which has led to patches being created. However, my understanding is that these flaws have been fixed since. Yet I can't get it to work, and I feel like I have run out of ideas to try.

Anyone having this setup working and might know what the culprit is?

~ uname -a
Linux raspberrypi 5.15.76-v7+ #1597 SMP Fri Nov 4 12:13:17 GMT 2022 armv7l GNU/Linux
2
  • 1
    I'm fairly sure LIRC is deprecated. Perhaps search on that to find solutions.
    – joan
    Commented Dec 22, 2022 at 17:49
  • 1
    I've seen comments stating that, but nothing official. I wonder if it comes from this: > Recent linux kernels makes it possible to use some IR remote controls as regular input devices. Sometimes this makes LIRC redundant. However, LIRC offers more flexibility and functionality and is still the right tool in a lot of scenarios. This is what is says on their homepage. Maybe I should try to do things without LIRC if that's a possibility, but I doubt the alternative works as simple with config files as LIRC does. Commented Dec 22, 2022 at 18:31

2 Answers 2

1

dtoverlay -h gpio-ir-tx says (in latest Bullseye):-

Name:   gpio-ir-tx

Info:   Use GPIO pin as bit-banged infrared transmitter output.
        This is an alternative to "pwm-ir-tx". gpio-ir-tx doesn't require
        a PWM so it can be used together with onboard analog audio.

Usage:  dtoverlay=gpio-ir-tx,<param>=<val>

Params: gpio_pin                Output GPIO (default 18)

        invert                  "1" = invert the output (make it active-low).
                                Default is "0" (active-high).

So it SHOULD work (although I have never used it) but the error Cannot configure the rc device for /dev/lirc0 would seem to indicate a problem or unsupported device.

Have you tried pwm-ir-tx?

1
  • Thanks for your comment! I did try pwm-ir-tx without success. After some more hours of debugging, I realized that the config I used was the culprit. I made a comment of my own in case someone else find themselves in the same situation. Commented Dec 28, 2022 at 22:00
0

In the end, it seems like the remote config used was the culprit. I did not expect that to be the problem since the value for the key was the same as the Arduino library used, and the TV brand seemed to use the same protocol for most of their TVs.

Since I don't want to leave this post without any hints for others in the same situation, here are some debugging I did:

  • I charged an old phone and took a video of the transmitter when issuing a command. The camera must not have IR filter for this to work. Sure enough, the lamp light up, in a similar fashion as when the Arduino was the device connected to the transmitter.

  • I connected an IR receiver, which detected data. I had trouble generating a complete config with it, but one thing the generated config did provide was the min_repeat field. I also looked at various IR software implementations for my TV brand to see what the values should be and modified the one and zero values slightly thereafter. These two combined did the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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