You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of - thanks for making the ANAVI Infrared hat - it's made it so easy to get into sending/receiving IR using a rpi zero!
By following the ANAVI instructions for setting up transmitting with LIRC, and then using the "using multiple devices" part of the LIRC docs, I have managed to get two instances of LIRC running, the normal one for sending on /dev/lirc0 and the new socket at /var/run/lirc/lircd-lirc1 for receiving on /dev/lirc1. They work when I use them at different times:
# Works! Sends IR signal to disable my hifi
$ irsend SEND_ONCE logitech_z906 POWER POWER
However, something seems to go wrong when I try to receive and send at the the same time. If I run irw to receive in the background:
$ irw /var/run/lirc/lircd-lirc1 &
[1] 3111
And then try and send a command:
# Does nothing! Not recognised.
$ irsend SEND_ONCE logitech_z906 POWER POWER
# Also doesn't work
$ irsend SEND_ONCE SAMSUNG_BN59-01178B KEY_RIGHT KEY_RIGHT
However, if I then kill the background irw receiving process:
# Works again!
$ irsend SEND_ONCE logitech_z906 POWER POWER
Weirdly enough, in this "broken" state of sending and receiving at the same time, the IR leds still flash (checked with my phone camera) and if you run mode2 in the background:
space 14962268
space 2053667
pulse 114
space 14454
pulse 207
but nothing shows up from the irw process in the background (and my hifi/tv do not recognise the signals either).
I assume the two instances of lirc are interfering with each other somehow. The LIRC docs say you may need to have two kernel drivers with different names, if the driver can only handle one device at a time:
The only situation where the described procedure will not work is when you have two devices that both use a kernel driver that can only handle one device at once like e.g. lirc_serial, lirc_sir or lirc_parallel. Resolving this requires recompiling the kernel drivers with different names and device numbers. Lifting this limitation is one of the todo items for future releases.
Thank you for the detailed report. Unfortunately, this is a very specific use case and I don't know the exact answer how to set it up properly.
Regarding the kernel drivers, please keep in mind that with the release of Raspberry Pi OS Buster gpio-ir and gpio-ir-tx replaced the old Linux kernel module lirc_rpi. Details are about the switch are explained here.
Have you tried contacting LIRC developers about the issue in your use case? Btw there is an open bug in the upstream of LIRC regarding the patches that we apply manually in our user's manual: https://sourceforge.net/p/lirc/tickets/359/
First of - thanks for making the ANAVI Infrared hat - it's made it so easy to get into sending/receiving IR using a rpi zero!
By following the ANAVI instructions for setting up transmitting with LIRC, and then using the "using multiple devices" part of the LIRC docs, I have managed to get two instances of LIRC running, the normal one for sending on
/dev/lirc0
and the new socket at/var/run/lirc/lircd-lirc1
for receiving on/dev/lirc1
. They work when I use them at different times:# Works! Sends IR signal to disable my hifi $ irsend SEND_ONCE logitech_z906 POWER POWER
However, something seems to go wrong when I try to receive and send at the the same time. If I run
irw
to receive in the background:$ irw /var/run/lirc/lircd-lirc1 & [1] 3111
And then try and send a command:
However, if I then kill the background
irw
receiving process:$ kill -15 %1 [1]+ Terminated irw /var/run/lirc/lircd-lirc1
Sending works again!
# Works again! $ irsend SEND_ONCE logitech_z906 POWER POWER
Weirdly enough, in this "broken" state of sending and receiving at the same time, the IR leds still flash (checked with my phone camera) and if you run
mode2
in the background:$ mode2 -d /dev/lirc1 & [2] 3121 Trying device: /dev/lirc1 Using device: /dev/lirc1
you get the pulse/space data:
but nothing shows up from the
irw
process in the background (and my hifi/tv do not recognise the signals either).I assume the two instances of
lirc
are interfering with each other somehow. The LIRC docs say you may need to have two kernel drivers with different names, if the driver can only handle one device at a time:I also found this wiki page about rebuilding a separate version of the backing driver for LIRC.
But both are referring to the
lirc_serial
driver that I can't find withlsmod
, where as the phat uses thedefault
driver.Any idea what's going wrong?
The text was updated successfully, but these errors were encountered: