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:


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)

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)

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

  • I do suspect the driver is not updated properly for buster. And in case you are considering updated hardware, I highly recommend the UART interfaced IR transceiver fr.aliexpress.com/item/32989940274.html. Using UART is a pleasure, comparing to IRrecord: raspberrypi.stackexchange.com/questions/103452/….
    – tlfong01
    Sep 26, 2019 at 13:47
  • (1) And irrecord manual pages suggest to use an existing template, so you might like to try this, because you already have a working template. (2) irrecord manual last update was 2017, so it might not be compatible with raspbian 10 buster, (3) irrecord manual mentions many possible failures, even if you are using the version compatible to irrecord, eg, jessie in 2017. (4) You might like to cofirm if you remote is sending out signal by using (a) Win10 RealTerm, (b) Python IR transceiver loopback.
    – tlfong01
    Sep 27, 2019 at 4:06
  • Thanks, I took a hint from both comments, dug out a Stretch image and I've got over the hump, Theres a could of new 'features' but they can be fixed,. I read somewhere someone got it working but I don't have that depth or enought time to get into it currently. I looked also at the UART option but I'm trying to make a medical product for Alzheimer's and in reach of as many as possible and keeping cost low is vital - every penny matters!
    – KevinY
    Sep 28, 2019 at 8:38
  • Gald to hear that you have got over the hump. I agree that for mass production, LIRC with IR transmitter only is the most cost effective. I am using UART version for IR testing for rapid prototyping. My final version is very likely LIRC, or my DIY version of python code driving single IR LED, for easy system integration later. Good luck to your project and cheers! :)
    – tlfong01
    Sep 28, 2019 at 8:46

2 Answers 2


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

  • I use newest Raspberry OS Bullseye. Is LIRC completely useless there? I have some python application that uses LIRC underneath that is why I cannot use ir-keytable
    – ToM
    Dec 5, 2022 at 21:50
  • I don't think so. Just follow the first link from my answer. The post got updated several times in the meantime and now explicitly mentions Raspberry OS Bullseye. Apparently, manual patching is no longer necessary.
    – Rapti
    Dec 6, 2022 at 16:09

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.

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.