Saturday, July 25, 2009

So, I have a WiFi router which runs Linux...

For a while now I was interested in getting a WiFi router with USB ports and ability to run third-party Linux-based firmware. Theoretically such a device can be very useful. Besides the obvious routing and WiFi functionality, it can also function as a low power always on computer running Linux. The possibilities seem endless. They include:
  • web server, with CGI, PHP, etc.
  • file server on the LAN
  • handling downloads
  • using an external display to show information from the Internet (such as e-mail notification, the weather forecast, RSS feeds and messages left via the web server)
  • webcam server
  • playing Internet radio
  • doing things via the serial console
I decided on the Asus routers, because they seem to have good support from third party firmware, they have USB 2.0 ports, and they have a decent amount of RAM and flash. At first I couldn't decide between a WL-500G variant or a WL-500W. At first, the WL-500G seemed like a better choice. Pre-N didn't really seem necessary, and in any case the alternative firmwares I looked at didn't support it. Then I learned about Oleg's firmware, which supports pre-N, and I decided to get a WL-500W.

The initial experience with the WL-500W and Oleg's firmware was quite positive. Things simply worked. Configuration was simple and there was a nice repository of software which can be installed on an external drive.

However, I quickly learnt that doing all the things I initially imagined would be a lot of work. In many cases, it doesn't seem like the software is available, and I would have to do a lot of coding. For example, I'm not aware of any software which can use an external display in the way I envisioned. The closest thing seems to be LCDproc. Another example the lack of download manager software which can run as a daemon.

There were also some problems, even with things which should simply work:
  • Much to my surprise, the procedure for building a cross-development environment was simple, but GCC 3.2.3 is so buggy that it can't even bootstrap itself. There, the solution seems to be -fno-schedule-insns2, but I would still like fully functional GCC.
  • Oleg's firmware helpfully provides modules for using a USB-to-serial adapter, but that version of Linux has a serious bug which prevents the onlcr stty option from working properly. The solution was simple: use the pl2303.c and pl2303.h files from the latest version of the 2.4 Linux kernel.
  • My webcam was totally unsupported, and spca5xx failed to build correctly. The binaries I found didn't support my webcam. I found a patch, applied it to the latest compatible version, and it worked. It even allowed me to use my Dakota "single use" digital camera as a webcam. The Asus webcam software didn't work properly with either, and it seems like an kludge, but fortunately, other applications are available, and w3cam works.
So, now I'm building up the capabilities. I even ported the client software for the LED sign I built from Windows to Linux. The main thing that remains is to tying stuff together in a way that's useful and beneficial in a long-term way. In the meantime, the best thing I've done is using my HP Portable Plus as a serial terminal for accessing Google Talk via mcabber.

No comments: