ir is an interface program to Chris Dodge's RedRat 2
infrared controller. It is written in Perl. It uses only the basic Perl
constructs and no external packages, so it should work on any platform
that supports Perl and serial communications.
- Macros: You can store a series of commands in a macro file. Referencing
that macro file will call up all the commands stored in them. The names
of the commands, not the IR codes themselves, are stored, so if you
relearn the IR codes the macros will use the new codes.
- Sequential learn mode: You can specify a series of codes to learn.
After each IR code it sees, it waits to scan the next one. This makes
learning all the codes for a device very quick with one command.
- Command line interface: The command line interface can be called
manually, or from a cron job, or whatever you want:
- ir r device command device command... Learn a series of commands from one or more devices.
ex: ir r tv on tv off tv chup tv chdn
- ir s device command device command... Send a series of commands to one or more devices.
ex: ir s cable on cable 1 cable 3 vcr on vcr record
- ir m macro device command device command... Create the named macro file with the listed sequence.
To send the macro codes, use "macro" as a device name, and the macro name for the command.
ex: ir m recordpbs cable on cable 0 cable 2 vcr on vcr record
Then to play back, issue ir s macro recordpbs
- Email interface: If you put the line
'ir: "|/usr/local/bin/ir e"' in /etc/mail/aliases, then sending
email to firstname.lastname@example.org will send the contents of the email to the
stdin of the ir program, which will skip all lines containing
illegal characters (all mail header lines do), and execute any
commands on lines that pass the test.
- Web interface (the biggie!): If you call ir from your web server (I
made a symbolic link from /usr/local/bin/ir to
/home/httpd/cgi-bin/ir.cfg to enable this), it will dynamically
build a list of devices and commands, including macros, and present
them in a form. The form also has a field to list a series of
commands to be executed, and another one to build a new macro file
from a list of commands. There's a checkbox for verbose feedback
and another one test only (don't really send the IR commands). When
the form is submitted, the commands are executed and the form is
- X-10 control: If you buy an IR to X-10 controller, like X-10's IR543, you can control almost
anything in your house. I have one and I can send you the codes to
send to the unit.
I use this program mainly from my crontab file (I have a linux server on
24/7) to record tv programs when I'm not home. Since my cable company
requires me to select the channel with my cable box, I have cron entries
like ir cable on cable 1 cable 3 vcr on vcr record to record a tv
program, then ir vcr off cable off to stop recording.
Back to index