LIRC forwarding

Q Is there any software you know of that can receive an LIRC signal and then loop it back for resending, or would I have to write something that can do this myself? What I want to do is receive a LIRC input (from a remote) and resend this signal (via a transmitter). I currently have LIRC configured with options to receive and transmit, but I need a way to link the receiver to the transmitter.

A For what you're attempting, it sounds like you need to make use of irexec, which will execute any command you require. This includes using irsend to send a command through your infrared transmitter. The commands to execute for each button pressed are defined in your .lircrc file, and they look something like this:

begin
prog = irexec
button = Record
repeat = 3
config = irsend SEND_ONCE remote CODE
end

The prog name must be set to irexec, while button = is the identifier of the button the command will respond to. To see the identifier each particular button on your remote sends, run irw in a terminal, press a few buttons and watch the output for each one. Meanwhile, the repeat = option prevents LIRC calling the program multiple times if you hold down the button longer than the duration of one transmission. A value of three means that three consecutive signals will be treated as one. Finally, the config option contains the command you're going to run - we're using irsend in this case, but it could just as well be anything else.

You must have irexec running for this to work. If you run it from a terminal, it'll default to loading its configuration from ~/.lircrc. To use another config file, you'll need to provide it on the command line. Now if you run irexec at startup, it won't be able to find your home directory, so it must be given the path to the config file. You should also use the --daemon option in this case to run the program in the background. So, then, the complete command to run it would be:

irexec --daemon /etc/lircrc

assuming you keep the configuration in /etc/lircrc. Because irexec isn't being run from a user's shell in this case, it won't have access to your full environment, so we recommend you use the full path for any commands you specify in the .lircrc file.

Back to the list