DSCAlarm:Router:Cam

From Oh Mad Lab
Jump to navigation Jump to search

Web Cam / Motion Detection

Hardware

Manufacturer Model Misc
Logitech QC Communicate STX vend/prod from dmesg: 0x46d/0x8ad
NewPoint 4-Port USB Hub USB Version 1.X

*NOTE* I tried a Kensington (model 33141) USB 2.0 hub that is backward compatible with 1.x and it didn't work.

Setup

  • Make sure ipkg is updated:
ipkg update
  • Install USB drivers:
ipkg install kmod-usb-core
ipkg install kmod-usb-ohci
ipkg install kmod-videodev
reboot
  • After rebooting, try plugging in the USB hub and you should get a message in dmesg at such:
hub.c: new USB device 01:02.0-1, assigned address 2
hub.c: USB hub found
hub.c: 4 ports detected
  • Install the spca driver (backed up in the wrt\cam folder):
wget http://pmeerw.net/openwrt/kmod-spca5xx_2.4.30+20060501-brcm-1_mipsel.ipk
ipkg install kmod-spca5xx_2.4.30+20060501-brcm-1_mipsel.ipk
insmod videodev
insmod spca5xx
  • Plug in the USB camera and you will get the following messags from dmesg:
hub.c: new USB device 01:02.0-1.4, assigned address 5
drivers/usb/spca5xx.c: USB SPCA5XX camera found. Logitech QC Communicate STX
drivers/usb/spca5xx.c: [spca5xx_probe:8380] Camera type JPEG
drivers/usb/zc3xx.h: [zc3xx_config:415] Find Sensor HV7131R(c)
drivers/usb/spca5xx.c: [spca5xx_getcapability:2207] maxw 640 maxh 480 minw 176 minh 144
  • To automatically do the "insmod", append to /etc/modules as such:
echo "videodev" >> /etc/modules
  • Install motion and the jpeg library (backed up in the wrt\cam folder):
ipkg install http://naaa.de/programme/motion/libjpeg_6b-1_mipsel.ipk 
ipkg install http://naaa.de/programme/motion/motion_3.2.6-1_mipsel.ipk 

*NOTE* Motion requires the "libpthread" package, but it should automatically pull it down from openwrt.org

  • Push up the default config from the wrt\cam\motion_confs\single folder:
scp motion.conf root@192.168.0.222:/etc/
  • You should be able to run motion now, by typing "motion -n". If you have firefox (or another mozilla based browser), you can point it to the IP:8081 as such:
 http://192.168.0.22:8081
  • Ctrl+C to get out of motion.
  • Since I can't always use firefox, I install a java (yuck) applet (backed up in the wrt\cam folder) for streaming as such:
wget http://www.charliemouse.com/code/cambozola/cambozola-latest.tar.gz
gunzip cambozola-latest.tar.gz
tar xf cambozola-latest.tar.gz   <--- I received a "tar: Invalid tar magic" message.  It still works, but I should investigate later.
mkdir /www/webcam/
mv cambozola-0.68/* /www/webcam
cd /www/webcam/
vim example.html

*NOTE* Change http://localhost:2020 to your IP:PORT as such: http://192.168.0.222:8081
*NOTE* Change width / height as desired, I used 600x480.

 mv example.html index.html
  • Now you can run motion with either motion by itself for daemon mode, or with the -n for non-daemon mode.
  • Point your IE browser to http://192.168.0.222/webcam and you should see your cam's image stream.

Tips and Tricks

For spcacat use spca5xx_lite.o (backed up in the wrt\cam folder):

  • Needs the following packages:
ipkg install libgcc
  • insmod spca5xx_lite.o
  • ln -s /dev/v4l/video0 /dev/video0 <---Won't work with /dev/v41/video0
  • spcacat -d /dev/video0 -s 640x480 -g -f jpg -p 3000 -o

Troubleshooting

Black Picture

The web cam stream is showing a black picture and nothing more.

Solution

Kill motion and re-start it and it should solve the issue.

References