Tricked out WRT54G

What’s more fun than tearing into a $50 wireless router and turning it into an expandable weather station, complete with a 16×2 LCD?

Update: see wiki page for some code

The Linksys WRT54G is one of the most hacked consumer electronics devices around. Modification ranges from simple firmware upgrades to serious hardware modding. I bought two v.3 routers on eBay in 2006, and have been playing with both of them since. One remains intact hardware-wise and runs an OpenVPN server for my home network back in California. The other lives in my dorm room at RPI and serves many duties.

Firmware

I have solid experience now with both DD-WRT and OpenWRT. They both have their advantages and disadvantages. I run DD-WRT at home, because its web interface is clean, powerful, and easy to use. I don’t need to add much software to it or modify it, so the standard firmware works well. My dorm router, on the other hand, has to support several hardware modifications and a slew of software packages I’ve installed. For that kind of flexibility I turned to OpenWRT. It’s not as easy to use, and its web interface is terrible, but it works extremely well for modification. Leaving space on the flash for packages is an awesome feature.

SD Card

The internal flash memory on these things is a pitiful few megabytes. I can install about 2MB of extra software before filling the thing up. No space for data, no space for big apps, no space for logging. To remedy the situation I’ve hacked in a 256MB SD card that holds the OWFS software, temperature logs, and other random junk I throw on it. The throughput is only about 300kbit/s, so I’m told, but it’s plenty for the kinds of things I’m doing with it. The tutorial was fairly easy to follow, and I managed to scavenge the SD slot from a USB card reader. It does take some soldering, but the reward is well worth it.

Serial/1-Wire

Beyond just running the WRT as a flexible linux box with ethernet ports, I added in some expansion capability. The WRT has two serial ports pinned out on the motherboard, and I hooked one of them up to a 1-wire master using OWFS’s tutorial. This allows me to chain as many sensors and actuators off of a single port on the device. Right now I have two temperature sensors (one outside, one inside), and an LCD display from Hobby Boards. The router continuously fetches weather data from the sensors and accuweather.com and sends it to the screen in rotating messages. If I want to check the weather for tomorrow I simply have to glance up at the wall! Yes, Oregon Scientific and other companies make similar devices, but mine is hella awesome.

Future projects

In the future I’m hoping to build a network-controlled buzzer (with variable frequency) and a solar intensity detector to tell if it’s cloudy outside. Neither is particularly useful, but they’re good projects for A/D and D/A conversion. OWFS makes the whole thing so easy I might as well!