6

LIRC Version 0.10.1-5.2 Linux Version 4.19.66-v7

New install today (apt-get update, apt-get upgrade)

apt-get install LIRC

(Basically repeating steps in https://stackoverflow.com/questions/57437261/setup-ir-remote-control-using-lirc-for-the-raspberry-pi-rpi)

edited /boot/config.txt and set:

dtoverlay=gpio-ir,gpio_pin=18

run mode2:

mode2 -d /dev/lirc0
space 4113301
pulse 1200
space 630283
pulse 1652
space 504625
pulse 1647

Good so far.

When I

sudo irrecord --device /dev/lirc0 --driver default

and enter the name for the config file, it continues with:

    Now start pressing buttons on your remote control.

    It is very important that you press many different buttons randomly
    and hold them down for approximately one second. Each button should
    generate at least one dot but never more than ten dots of output.
    Don't stop pressing buttons until two lines of dots (2x80) have
    been generated.

    Press RETURN now to start recording.
    ................................................................................
    Got gap (107126 us)}

    Please keep on pressing buttons like described above.
    Cannot find any gap, using an arbitrary 50 ms one. 

So it first reports it found a gap then didn't find a gap. It continues:

Please enter the name for the next button (press <ENTER> to finish recording)
KEY_1

Now hold down button "KEY_1".
Something went wrong: Cannot decode data
Please try again. (28 retries left)

Now hold down button "KEY_1".
Something went wrong: Cannot decode data
Please try again. (27 retries left)

Now hold down button "KEY_1".

Please enter the name for the next button (press <ENTER> to finish recording)
KEY_2

Now hold down button "KEY_2".

Please enter the name for the next button (press <ENTER> to finish recording)

Checking for toggle bit mask.
Please press an arbitrary button repeatedly as fast as possible.
Make sure you keep pressing the SAME button and that you DON'T HOLD
the button down!.
If you can't see any dots appear, wait a bit between button presses.

Press RETURN to continue.
....Cannot find any toggle mask.

Successfully written config file K5.lircd.conf

and if I view the conf:

begin remote

  name  K5
  bits            0
  flags CONST_LENGTH
  eps             0
  aeps            0

  one             0     0
  zero            0     0
  gap          50000
  toggle_bit_mask 0x0
  frequency    38000

      begin codes
          KEY_1                    0x0
          KEY_2                    0x0
      end codes

end remote

A well formatted output file with no values. I have used this same remote and the tool in earlier versions so have an idea what to expect. I also checked dmesg and there is no mention of a driver issue.

Any ideas what could be wrong. Many thanks

KevinY
  • 161
  • 1
  • 2

2 Answers2

4

In case you still need help 7 months later, the problem is that gpio-ir produces a slightly different output that irrecord can't handle. Follow these instructions to patch it: https://www.raspberrypi.org/forums/viewtopic.php?t=235256

If anyone else stumbles upon this question but is using Arch Linux ARM on their Raspberry Pi, this might help instead: https://wiki.archlinux.org/index.php/Talk:LIRC#LIRC_with_GPIO_on_a_Raspberry_Pi

Rapti
  • 141
  • 5
0

irrecord is similarly broken for me even on x86_64 bullseye. I've also noticed some segfaults.

So I wrote this little python script to help parse mode2's output, hope it helps: https://github.com/goblin/mode2_formatter .

You'll still have to write the config file yourself, but hopefully it should be easier with this tool.

goblin
  • 1