iSwitch
iSwitch is a web interface run off my Linksys WRT54g v2.0 which allows me to control the lights in my living room.
Linksys Router
The Linksys WRT54g v2.0 is a Wifi router running Linux. A handful of years ago Linksys released the firmware to the open source community and since then a number of developers have written Linux distributions for it. I run DD-WRT. I modded my Linksys WRT54g to have two serial ports by following Rod Whitby’s tutorial.
The WRT54g, like most Wifi routers, has a web interface from which the user can change settings on the router. Using the tutorial on the DD-WRT Wiki I configured the webserver to point to a modifiable part of the filesystem (/jffs/www). I created a cgi-bin folder (/jffs/www/cgi-bin) and put some simple shell scripts in there that outputted data from the serial port in the router. I made sure and chmod 755 to those scripts so that they would execute when navigated to in a browser. I made a simple web interface similar to that which I did for RoboAshley, which would call those scripts.
Microcontroller and Lights
On the other end of the serial cable from my WRT54g, I connected my Freescale HC12 microcontroller. I wrote a (very) simple program to receive commands from the serial port and turn on and off a relay according to the command received. I used the same circuit I made for the Microcontroller Controlled Party Lights to switch the drive the relays. I would, however, have preferred to use an L293 chip, but didn’t have one on hand.
iPod Touch
What did I do to make this work on the iPod Touch? Not a whole lot. The web interface to control the lights will work on any major browser including the implementation of Safari on the iPod Touch. I however did format it to perfectly fit the screen of my iPod Touch.
As always, if you have any questions, feel free to email me at johnaboiles at gmail dot com.


Write a comment