0

I am trying to use the Anavi Infrared pHAT from PiHut to end IR commands to a television. I have read and tried all the answers that I could find, but no avail. And I do not understand what is going wrong.

I am moving back and forth between

do_connect: could not connect to socket
connect: No such file or directory
Cannot open socket /run/lirc/lircd: No such file or directory

and

transmission failed

Error running command: Input/output error

with no apparent correlation to the contents of the config files, the reboots or the restarts with systemctl.

Now for some info:

  • Pi 3b+
  • uname -a: Linux cranberry 6.12.47+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.47-1+rpt1 (2025-09-16) aarch64 GNU/Linux
  • lircd 0.10.2

Because config.txt refers to /boot/firmware/config.txt, I added there the lines for the overlays. I tried:

dtoverlay=lirc-rpi,gpio_in_pin=18,gpio_out_pin=17
dtoverlay=gpio-ir,gpio_pin=18
dtoverlay=gpio-ir-tx,gpio_pin=17
dtoverlay=gpio-ir,gpio_in_pin=18,gpio_out_pin=17

and

dtoverlay=gpio-ir-tx,gpio_pin=17

(and rebooted for every change)

My lircd_options.conf contains:

[lircd]
nodaemon        = False
#driver          = devinput
#device          = auto
driver          = default
device          = /dev/lirc0
output          = /var/run/lirc/lircd
pidfile         = /var/run/lirc/lircd.pid
....

The config-file for the remote contains:

begin remote

  name  amino
#  driver devinput
  bits           64
  eps            30
  aeps          100
  flags     RAW_CODES
  one             0     0
  zero            0     0
  frequency    38000
  gap          19870
  toggle_bit_mask 0x0

      begin codes
          KEY_0                    0x01C90100000001AE
          KEY_1                    0x01C50100000001B3
# more key definitions...
      end codes

end remote

I have tried to comment-out eps, aeps,flags, one, zero in all possible combinations. But always the same two error messages.

systemctl status reports the daemon up and running.

If I get Cannot open socket /run/lirc/lircd: No such file or directory, the socket is not there, but just starting and stopping or rebooting without config changes will make it appear (and disappear).

There are no error messages in the syslog.

ir-ctl -S rc5:0x1e01 makes the infrared leds flash (as can be seen with a camera), so the pHat works.

Can anyone explain what is going on and how to get it up and running?

3
  • I use Anavi Infrared pHAT from Pihut. That is all the data I have anout it. Commented Nov 4 at 6:31
  • The questions on the GIT repository of ANAVI, and on this site: Trying to send an IR signal but LIRC and pigpod doesnt seem to work on RPI5 (Debian Bookworm), Send Ir command with Raspberry pi 3b+ in 2024, LIRC irsend not working, lirc setup setting protocol, Recording an IR signal and play it again on Raspberry Pi bullseye etc. Do you really need a list of all the answers that I consulted? Commented Nov 4 at 6:34
  • @Milliways Pi3b+ (sorry that was missing) , but the uname -a was there. You could have seen that. Commented Nov 4 at 17:29

1 Answer 1

0

On a Pi, lircd has several issues. Apparently, the lircd only works with predefined remotes. Although it is theoretically possible to add a remote, in practice this does not seem to work. Also, sending IR codes is marginally supported; the lircd is focussed on receiving.

The solution in my case is to record the keys separately with

ir-ctl -r --mode2 -1 -d /dev/lirc1 > keyfile.ir

and create a file per key. When I want to send a keypress, I use

ir-ctl -s keyfile.ir -d /dev/lirc0 -g 100000

This allows me to clone multiple remotes and use a web-interface to control my stereo, TV etc.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.