Control your TV, DVD, Stereo, DVR, Cable box, Mac, Xbox, or any other IR device with the Web Clicker!
The Web Clicker is a web server & IR transceiver. You can record any IR command and play it back via an AJAX web interface or just by requesting a URL. It works great from a cell phone and it's especially handy for home automation projects. A demo video is above.
FAQ
What can I do with it?
The Web Clicker can control any IR device (TV, DVD, Stereo, etc) simply by requesting a URL. There's also an AJAX based control page so you can use it with a web browser, like on your iPhone or computer.
The Web Clicker is awesome for home automation projects because of it's ease of implementation - just request a URL and you'll generate an IR signal or trigger a series of IR signals
Why?
I built the web clicker mostly for home automation - I have a MythTV DVR that uses an RF remote. Now, I've set it up so when I push the power button on the remote, the DVR makes a page request to the Web Clicker and it generates the correct IR signal.
How?
The Web Clicker is a Propeller Platform USB and E-Net Module, and a very basic IR circuit. Web server code is based on PropTCP, by Harrison Pham, and I wrote a custom object (Magic IR) for capturing and playing back IR signals.
I started researching IR control schemes - after a few days of work, I decided it would be better to code my own IR recorder - this way it's compatible with any TV without having to look through a huge code list. It's like a learning remote that has greater than 100ns accuracy & unlimited storage capacity.
I'm using a 38kHz IR receiver, which is the most common (95% of devices). If your devices uses another frequency, it's easy to use a different IR receiver.
All the software & hardware is available under the MIT license, which is essentially public domain.
Using it
I'll get into using it in a bit, but here's the big picture;
- Enter the webserver address into your browser
- Hit 'Record' to capture IR commands
- Initiate playback either by:
- requesting a URL (something like: http://192.168.1.252/exec.cgi?x- where x is the command number), or,
- through the web interface on your smart phone or PC.
Materials
The Web Clicker is made with an E-Net module and Propeller Platform USB. In addition to the E-Net and Propeller Platform, you'll also need to build a simple IR transmit / receive circuit. Here it is;
I’m using the wrong symbol for an IR receiver, but it’s the device at U1. Hopefully it doesn’t look too complicated - you just hook the long lead of the LED to P11, the short leg to ground. Hook up the first pin of the IR receiver (the pin on the left when the dome is facing up) to P12, the middle pin to ground, and the 3rd pin to V33. Here the circuit is on a ProtoPlus;
Software
Grab the code
Download all the code here, copy to your desktop and unzip it.
Edit the settings
The webserver IP stuff needs to be set up. First, download the Propeller Tool (Windows, Mac, Linux), then open up Top_object.spin. Towards the beginning, you'll see where the IP settings are;
Change them if necessary, connect the Propeller Platform USB, save the file and hit F11 to program the Propeller Platform.
- mac_addr doesn’t really matter, you should be able to keep it as is
- ip_addr The Web Clicker doesn’t use DHCP, just pick an IP address on your local network that isn’t being used.
- IP_subnet probably 255.255.255.0. If that doesn’t work, take a look at your PC and see what the subnet setting is - use the same setting on the Web Clicker
- ip_gateway IP address of your router
- ip_dns IP address of your router
That’s it! Your Web Clicker is ready to go. Now, just connect to your network. Now I’ll show you how to record & script commands.
Home Automation-ing
In your web browser, type in the IP address you set in the previous step. You’ll get this web interface;
Code Capture
Here’s how it works; Type a code name (maybe ‘Power’, or ‘Vol+’, or whatever makes sense) in the box, then click on the ‘Start Recording’ button. put your IR remote up to the IR receiver and push the button. The command will be stored and the command list will dynamically be updated. To play that code via the web interface just click on the ‘Play Code’ link next to the command name. To clear the commands, click on the ‘Clear Commands’ link.
Scripting
Once the command has been recorded, you can easily script it. In Linux / Mac, you just need to make a page request to the web clicker to send the IR;
wget 192.168.1.252/exec.cgi?0- >> /dev/null 2>&1
Will execute the first command on the list (Power on my Web Clicker)
wget 192.168.1.252/exec.cgi?1- >> /dev/null 2>&1
Will execute the second command, and so on. Change the number after the ? in the url to execute a different command. The >> /dev/null 2>&1 redirects the program output (and any error codes) to the trash - this is for non-interactive scripting.
If you’re using curl, the command is almost the same;
curl --url 192.168.1.252/exec.cgi?1- >> /dev/null 2>&1
You could associate this command with a LIRC input, a chron job, or whatever else. I don’t know how to script in windows, but you can download wget for Windows & that’s probably the first step.
Next Steps
Once your Web Clicker is up and running, you’ll probably want to tweak it / play with it! Here are a few ideas to get you started;
Local File Storage
The Propeller Platform USB has a microSD / microSDHC card slot so you can add up to 32GB of local file storage. You could serve MP3’s, pictures or whatever else. You could also use the SD card for data logging. To start playing with the SD card, grab the fsrw object.
Multiple IR transmissions with a single command
Take a look at the source code - towards the top, there’s a section of ‘Elseif’, which tell the Web Clicker what to do when a command request is received. You can make the device do anything in response to a command, including sending several IR blasts.
Controlling a motor, switch, light, or anything else
Why not use the Web Clicker to turn on a motor, change a light, play back a wav file or something else? It’s the same process as adding multiple IR transmissions - look at the code with the Elseif commands - instead of playcommand(x), change it to your newly created method.
That’s it! I had a lot of fun putting the Web Clicker together - let me know if you’ve got any questions or comments!
https://vimeo.com/14622209