Apr 14, 2009

ASUS WL-520GU Webcam - Part 1

First post on this blog, Yay! Oh, so much to say, so little time.

Let's start with my current off-time-project: WL-520GU Webcam.

The goal:

Use a simple, cheap, and physically small device and a cheap webcam to make a security camera / baby monitor / nannycam. This device would stream the video over ethernet or (preferably) WiFi to my iPhone and MacBook Pro. (I may have to use an intermediate computer to get the video to the iPhone, which has to be in H.264 format, but I'll avoid that as much as possible.)

The equipment (so far):

Thanks to posts by Jeff at MightyOhm, I've been tinkeri.ng with the ASUS WL-520GU. It's a pretty slick, cheap router with a USB port. More importantly, it can be reflashed with a linux OS that you compile yourself.

There are several choices of OS, but I chose the same one Jeff did: OpenWRT.

I'm cheap, so when it came to picking a webcam, I searched for deals first, and compatibility second. This isn't necessarily the best route, since there are many many webcams on the market, and a lot of them are not supported on linux.

The good news is that linux support for webcams recently became a lot better, and is now part of the linux kernel. (Knowing that earlier would have saved a lot of hair-pulling.) I ended up with the Logitech QuickCam Communicate STX. I got lucky to have found it cheap: ~$30 for it and another webcam bundled together at a local Target.

Note: There are a lot of things to consider when buying a webcam for use on Linux, let alone with a tiny processor. I will try to make another post about this soon (and came back here and link to it.) For now, just know that you should look up compatibility first, and that manufacturers change a product's internals without changing the name or packaging, so be sure you can return it (or have another use for it) unless you don't mind possibly wasting some money.

The downsides:

  • The WL-520GU's factory-installed linux is based on kernel 2.4, and the wireless drivers from Broadcom are not open source. This means that to switch to 2.6, we lose wireless until the b43 drivers are ready for this device (if ever).
  • The USB2 drivers that are stable for this device require the current 2.6-based kernel.
  • The webcam drivers that are part of the OpenWRT packages distribution are not upgraded for 2.6. After a lot of head-bashing, I figured out that the drivers are now part of the 2.6 kernel. However, OpenWRT still doesn't include support for compiling these modules in the default distribution. I'll explain how to add this in a later post.

Progress:

  • The console port soldered in, like the instruction over on mightyOhm, but with a few modifications.

    Asus WL-520GU Serial Port

    Instead of using breadboard and straight headers, I used right angle header and female-to-female jumpers from SparkFun and a strip of straight headers.

    SparkFun has since added female-to-male headers to their inventory, and I might use those in the future and eliminate the straight headers. The straight headers do leave the cable in order and tidy when the FTDI cable isn't hooked up, however, so I might stick with this method anyway.
  • OpenWRT running on the 2.6 kernel with USB 2.0 support, usb-storage (and associated filesystems), gspca2 (a.k.a. V4L2), and support for the specific chipset used in my webcam. Unfortunately, this means that WiFi is broken, since the drivers for the WiFi in the Wl-520GU aren't ready in the newer 2.6-based kernel.
  • Formatted a 1GB USB drive to ext3 format and setup opkg to install new packages on it.
  • Compiled and installed gstreamer, ffmpeg, ffserver, and motion onto the USB drive. (I'm using about 40MB of the USB drive's 1GB so far, so there was no chance of installing internally!) I know I don't need all of these, and each has it's place. I think this alone will end up being a post.

So, let's get started!

Sadly, the full-on instructions will have to wait until my next post.

Update: Part two is available here.

1 comments:

  1. i've got problems with compiling openwrt on 10.5.8:

    configure: error: libgmp not found or uses a different ABI.
    Please read the INSTALL file -- see "In case of problem".

    Don't know how to cope with that...
    ReplyDelete