Close

Hacking the Router

A project log for JAIOTP

Just Another Internet of Things Project

Alan FeltAlan Felt 08/19/2014 at 05:050 Comments

I am using a WRT54g router which conveniently has two serial ports which are accessible through the 2x5 header footprint on the router PCB. 

Not so conveniently it runs at 3.3v so I needed a level converter to interface it with my 5v Arduino Micro. One of the first things that I did was install OpenWrt and learn some basic Java scripting/ HTML. I don't know much about either but the power of Google is a great tool. I am using Dashcode to build the interface but may end up writing my own code or using an open library so that I can share that code. I had some difficulty working out how the linking worked with the project files but I finally got a web page to turn on and off an L.E.D. on the router. This was accomplished with AJAX which calls a small shell script that echos a 1, on, or a 0, off, into the special file that defines the L.E.D. state. The following will turn off the DMZ L.E.D- 

echo 0 > /proc/diag/led/dmz

and alternatively on-

echo 1 > /proc/diag/led/dmz

The following sites were helpful and my code is copied or based off of theirs:

http://www.ediy.com.my/index.php/projects/item/42-wireless-router-home-automation

- http://www.instructables.com/id/Repurpose-an-old-wifi-router-for-the-internet-of-t/?ALLSTEPS (Attribution (by)) 

http://vonkonow.com/wordpress/2012/01/software-for-home-automation/  (Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License)

http://www.instructables.com/id/Home-automation-server-with-router/?ALLSTEPS (Attribution Non-commercial Share Alike) (used the uhttpd server configuration on this page)

Discussions