MallocArray
Posts: 4
Joined: Sat Feb 23, 2019 8:09 pm

lirc on Raspberry Pi Zero W with gpio-ir

Fri Mar 15, 2019 2:19 pm

I used the guide found here to setup a RPi Zero W with a VS/1838B receiver and IR LED emitter with lirc-0.9.4c
https://www.instructables.com/id/Amazon ... IR-Remote/

Using Stretch with kernel 4.14 and dtoverlay=lirc-rpi,gpio_in_pin=23,gpio_out_pin=22 along with driver=default, everything works fine, I can record new remotes and send codes.
After upgrading the kernel to 4.19 I found that lirc-rpi was removed and the suggested replacement was

Code: Select all

dtoverlay=gpio-ir,gpio_pin=23
dtoverlay=gpio-ir-tx,gpio_pin=22
After doing this, I was able to send codes correctly with /dev/lirc0 and I saw a new device for receiving under /dev/lirc1
irw and mode2 both receive codes and display on the screen with existing remote files, but irrecord no longer works. I tried reinstalling Stretch with kernel 4.14 using gpio-ir and I have the same problems with irrecord so it isn’t specific to the new kernel, but that entry for dtoverlay.

When I try to record, I get the following errors:

Code: Select all

irrecord -f -d /dev/lirc1

….

Now hold down button "KEY_POWER".
Something went wrong: Signal length is 0
That's weird because the signal length must be odd!
Please try again. (28 retries left)

Now hold down button "KEY_POWER".
Something went wrong: Something went wrong.Please try again. (27 retries left)

Now hold down button "KEY_POWER".
Something went wrong: Something went wrong.Please try again. (26 retries left)
I also tried creating a new service for /dev/lirc1 with no improvement

At this point I’m lost as what to try next and prevents me from being able to upgrade to the newest kernel since I can’t use lirc-rpi anymore. Where do I go from here?

HiassofT
Posts: 201
Joined: Fri Jun 30, 2017 10:07 pm
Location: Salzburg, Austria
Contact: Website

Re: lirc on Raspberry Pi Zero W with gpio-ir

Fri Mar 15, 2019 7:39 pm

I'd recommend looking at the more modern tools, ir-ctl and ir-keytable - lircd and especially irrecord were always a bit troublesome to use.

With ir-keytable you can see the decoded scancodes of various ir protocols and configure the in-kernel mapping from IR scancodes to Linux keycodes

With ir-ctl you can capture and transmit raw IR data and also transmit IR scancodes encoded for a specific IR protocol. Just check the manpages or google for ir-keytable/ir-ctl and you'll find plenty of examples.

so long,

Hias

BeauSlim
Posts: 36
Joined: Mon Jul 31, 2017 10:02 am

Re: lirc on Raspberry Pi Zero W with gpio-ir

Sat Mar 16, 2019 12:23 am

I have only played with the receiver part, but gpio-ir seems to work quite well with the new 4.19 kernel. See viewtopic.php?f=29&t=224931 for issues using 4.19.
I use a scrounged camcorder IR remote to the Zero, which then runs scripts to wake and/or run things over ssh on different hosts. I think I used this guide from the LibreElec site to configure the remote: https://wiki.libreelec.tv/infrared_remotes
I may have had to add my user to the "input" group for this.
In my /boot/config.txt:

Code: Select all

dtoverlay=gpio-ir,gpio_pin=22

In my /etc/rc.local to enable my custom keymap:

Code: Select all

ir-keytable -c -w /etc/rc_keymaps/hv30

To make the led blink on IR receive as a nice bonus:

Code: Select all

echo rc-feedback > /sys/class/leds/led0/trigger

Return to “Troubleshooting”