To unlock the full potential of an open source capable router, you can install DD-WRT and Optware. This turns the router into a great WiFi capable cheap Linux box. This article gives some pointers on the steps you need to take.
Why use an Asus-WL-500GU router?
The Asus WL-500GU router is one of the few DD-WRT capable routers that have a USB port. This makes it an excellent choice for communicating with Arduino. With a USB hub plugged into the router you can connect the Arduino and a USB stick for storage. The GU version has the most memory of the Asus routers and should be your pick if you want to run memory heavy python scripts.
I have bought my router second hand for 15 euro, compare that to a WiFi shield and MMC shield for Arduino at 50 bucks each. Having a router instead of a WiFi shield has many benefits:
- The router can run the web server instead of the Arduino
- Lots of storage space (4GB), with a file system
- Access to files via SSH
- The router can be a WiFi client in a home network or an access point in absence of other networks.
Installing DD-WRT on the router
To install DD-WRT on the router to unlock it’s full potential, follow this guide on the DD-WRT wiki. I am running DD-WRT v24-sp2 (05/17/11) mini-usb-ftp (SVN revision 17084M NEWD Eko). It crashed a few times, but is stable now. I don’t know whether it’s the best pick or not.
It took me a while to find working drivers, so I am hosting them herefor your convenience.
I didn’t take notes while installing DD-WRT, so please use the guides for help.
OptWare transforms your router into a fully functional Linux box for even more features than DD-WRT. It comes standard with the webserver lighttpd, auto mounting of USB storage and much more.
Because it comes with a package manager it is very easy to install python, pyserial, and anything else we need later. Just for fun I even installed irssi, an IRC client, so I could chat from my fridge. Worked really well actually!
By far the easiest method to install Optware is Optware, the right way by Frater. This one took me a while to figure out:
echo 0 >/proc/sys/net/ipv4/tcp_ecn
That command disables congestion notification, which caused errors when wget tried to download stuff for Optware. Execute it before you try to install. I have added it to my startup commands in the DD-WRT web interface (administration->commands). I also load the USB serial drivers in the startup code, so my startup code looks like this:
echo 0 >/proc/sys/net/ipv4/tcp_ecn insmod /opt/serialdrivers/usbserial.o insmod /opt/serialdrivers/ftdi_sio.o insmod /opt/serialdrivers/acm.o
I used a gparted live cd to create the necessary partitions on the USB stick. I use a 2GB Optware partition, 512 MB swap and 1,5 GB data.
After installing optWare, disable all services you don’t really need, because the python script will need a lot of memory. The only services I have running are automount, reloc_syslog, lighttpd and fixtables.
Finally install the programs you need for UberFridge, with ipkg-opt
ipkg-opt install python
This guide probably isn’t complete, because I didn’t take notes at every step. If you think something is missing, please let me know.