Saturday, January 2, 2010

IRWatch version 2 released

Today, after a MUCH longer delay than anticipated, I've finally made available the newest version of my IRWatch utility. It's been rewritten from scratch for a much cleaner and more modular design. No longer are you required to go into the main perl script and enter all of the logic into the while loop (making sure not to mess any of it up). Now there are much simpler config files for you to edit (ok...technically you are still modifying perl code, but it's MUCH MUCH prettier than before). The special event handling logic has also been exported to a plugin format, which makes it much easier for you to design your own custom event handlers and then share that with other users

Configuration
First, you need to download the latest version of IRWatch and also the RFLibs libraries.

Next, you need to set them up in the right locations. I put both the irwatch and the RFLibs folders into /usr/local/scripts. If you want to place them somewhere else, you will need to modify the first line of irwatch.pl so that the perl include (-I) specifies the appropriate location.

Now you need to do some relatively simple configuration. You can probably just wing it by modifying the 000_general file in the config directory, but if you need more help, there is more extensive documentation in the README file. The important parts here are to make sure the values in the settings hash are correct, then define aliases for your remote(s) in the remotes hash, then go through the events hash and define just how you want the remote to behave.

You will notice the 500_aquos.disabled file in the config folder. The .disabled extension tells irwatch not to process that config file. For most users, that is what you want (otherwise, the config file will tell irwatch to load the aquos plugin, which will fail becuase it can't connect to the aquosserver, so irwatch will abort). However, if you are running a compatible Sharp Aquos TV with a serial port, and if you have successfully setup my aquosserver script to control the TV, then you will want to enable this functionality. Just rename the file to 500_aquos (ie: remove the .disabled extension) and edit the file to your liking.

Once again, check the README file for more details

Writing Plugins

Writing plugins is actually relatively easy. Most of the info you need is (once again) in the README file. Simply put, you need to create your plugin in the plugins folder, add a corresponding config file in the config folder, and make sure the config file indicates to load the newly created plugins. When writing a plugin, you want other users to be able to use it without modifying the plugin code at all. So, to that end, make you put configurable option like paths, ip addresses, ports, etc into the config file in the settings hash.

If you write any interesting plugins that you think others might find handy, please send me a copy via email. If it looks interesting, I'll include it on my website.



1 comment:

Unknown said...

Hi there, great scripts! I have been using a version of your aquosserver that I modified and expanded to support LG televisions as well as Denon and Marantz AVRs for some time now. I have also recently created a similar server (I borrowed your IOSelectBuffered module again) to control PLCBUS equipment so now my house lights are PC controlled. As a result I am looking for a better method of utilising my remote and once again I find myself at your blog looking at IRWatch!
Quick question; if I begin pressing a key sequence in IRWatch but never finish it (i.e. I change my mind or get distracted) does it eventually time out or does it stay "armed"?
Also can you confirm my assumption that IRWatch does not prevent lirc from acting on button presses normally? For instance if my lircrc has an exec command for the power button (i.e. power on) and IRWatch is watching for a 2 second duration on this key, pressing it will still result in the lircrc execution (at least initially)?
Sorry for the rambling post. I love your work, keep it up!!
Cheers
Wayne