Installing webcam drivers for OpenWRT
As I described here, I’ve bought Asus WL-500g Premium router where I installed Kamikaze 7.09 firmware to. I am running on Linux 2.4 kernel, because 2.6 doesn’t support wifi on my router (see here).
I’d like to connect some USB webcam, but even I spent a lot of time trying to find some usable driver, I didn’t suceed so far.
Here are drivers which are not usable for my case:
- UVC video driver (kmod-video-uvc) supports only >= 2.6 kernels
- ov51x-jpg also supports only >= 2.6 kernels
- qc-usb driver for Logitech webcams (download) didn’t work for me
These drivers may work:
- ov51x driver may work, but I didn’t find binaries for Kamikaze
- spca5xx (download or as a ipkg package kmod-usb-spca5xx-le) seems to be most perspective for me
- OpenWrt Kamikaze 7.09 has directly support using ipkg for pwc driver. These cams listed are pretty good and pretty expensive ;-).
Programs supported
Copied from this discussion:
- spca5xx_le - spcacat, servfox
- spca5xx - spcacat, servfox, motion, palantir, mvc, getjpeg
Solution
Based on this talk, I decided to buy webcam “Labtec webcam pro”. Instructions based on this great tutorial (in polish, but I guess you don’t mind) are following:
- Connect the webcam to router. Restart it. You should get in “dmesg” output this:
usb.c: USB device 2 (vend/prod 0x46d/0x8a2) is not claimed by any active driver.
That sound great, because this vend/prod is supported by spca5xx
- Install usb stuff, if not installed:
ipkg install kmod-usb-core kmod-usb-uhci kmod-usb2 - Install the spca5xx light edition driver:
ipkg install http://download.czechit.net/openwrt/kmod-usb-spca5xx-le_2.4.34-brcm-1_mipsel.ipk
- Everytime after restart of the router, you have to load the modules using:
insmod videodev insmod spca5xx
- Now, if you check “dmesg”, you should get:
Linux video capture interface: v1.00 usb.c: registered new driver spca5xx spca_core.c: USB SPCA5XX camera found. Type Labtec Webcam Pro Zc0302 + Hdcs2020 spca_core.c: spca5xx driver 00.57.08LE registered
- Search for the device, make link for spcacat and install this software for downloading images from webcam:
ls -al /dev/v4l/* ln -s /dev/v4l/video0 /dev/video0 cd /tmp wget http://download.czechit.net/openwrt/spcacat.gz gunzip spcacat.gz mv spcacat /usr/bin chmod +x /usr/bin/spcacat ipkg install libpthread libgcc
- To make one “shot” to file SpcaPict.jpg use:
spcacat -d /dev/video0 -g -s 640x480 -f jpg -o -N 1 -p 100
Warning: Based on this post, it’s possible that connecting 2 and more cams won’t be easy.
Links
- Webcam tutorial with compiled packages for OpenWrt