|
From: Paul F. <pg...@fo...> - 2025-05-31 23:10:55
|
patrick wrote:
> I cobbled together this command on the RPi, hoping it would send the IR
> signals to the MythTV computer in the same way the HDHR did but it doesn't
> seem to be working. I'm running irw on the 192.168.1.2 computer but it's
> not receiving any signals.
>
> /usr/bin/mode2 -d /dev/lirc0 | irtext2udp | socat -
> udp-datagram:[1]192.168.1.2:5000,broadcast
>
> I'm hoping someone else has done this or has experience with it and could
> offer me some assistance please.
Unless something has changed recently (and I doubt it), irtext2udp
is broken, because it matches the documentation of the UDP protocol, which
is also broken. I submitted patches for these issues in March 2022:
https://sourceforge.net/p/lirc/tickets/370/
I also sent mail to the (this) list about it at the same time -- I'm sure
it's in the archives. So that's probably at least part of your problem.
For various reasons (mostly historical, but also having to do with my
network topology), I don't do lircd processing on the raspberry pi boxes
that are scattered around the house, each with an IR receiver. Instead,
I forward the IR to a central server, where there's an instance of
lircd running for every client. Since UDP can't make it through
my firewall, I send it over tcp, through an ssh tunnel, and convert
back to UDP at the destination.
For all of those reasons, I don't use irtext2udp. I use my own script
(attached), which takes mode2 format and converts it to the UDP
format, and sends it to a tcp port. You'll see that it sends to a port
on "localhost" -- that's because it's actually being forwarded across
an ssh tunnel.
On the receiving end, I have a listener that gets data from the other end
of the ssh tunnel. The meat of it is this line:
socat -u tcp4-listen:88${octet},reuseaddr,fork UDP:localhost:87${destoctet}
The 88xx address is what the ssh server delivers to, and the 87xx
address is the appropriate lircd daemon.
Hope some part of this helps.
paul
=----------------------
paul fox, pg...@fo... (arlington, ma, where it's 59.2 degrees)
|