Webcam Video Surveillance via Motion Debian Mipsel

If you own a webcam from this list than you can attach it to the AsusWRT routers usb port and capture images from it when motion is detected, like babyroom, garage, courtyard...

It's only for mipsel devices like RT-N16, RT-N66U, RT-AC66U...

1- Install Debian from here
2- Download videomod script

wget -c -O /opt/etc/videomod.sh http://bit.ly/2xZTdR5
chmod a+rx /opt/etc/videomod.sh

2a - Download and load UVC Modules

wget -c -O /opt/tmp/uvc_modules_2.6.22.19-378.50b2-mipsel.tar http://bit.ly/2JxJrXN
cd /
tar -zxf /opt/tmp/uvc_modules_2.6.22.19-378.50b2-mipsel.tar
/opt/etc/videomod.sh load

3 - Enter Debian

debian enter

4 - Update Debian

apt-get update
apt-get upgrade

5 - Install Motion

apt-get install motion

6 - Enable start

sed -i 's/start_motion_daemon=no/start_motion_daemon=yes/g' "/etc/default/motion"

7 - Fix start

sed -i 's/--chuid motion/--chuid root/g' "/etc/init.d/motion"

8 - Change download directory

sed -i 's/target_dir /tmp/motion/target_dir /mnt/motion/g' "/etc/motion/motion.conf"

9 -Exit debian

exit

10 - Rename original script and add it to chrooted services list

mv /opt/debian/etc/init.d/motion /opt/debian/etc/init.d/S90motion-debian
echo "" >>/opt/etc/chroot-services.list
echo "S90motion-debian" >>/opt/etc/chroot-services.list
chmod 755 /opt/etc/chroot-services.list

11 - Create script to load UVC Modules and motion at startup

nano /jffs/scripts/post-mount

Add this lines

#!/bin/sh
sleep 5
/opt/etc/videomod.sh load
sleep 10
/opt/etc/init.d/S99debian start

Save with CTRL-O / Enter / and exit with CTRL-X

chmod a+rx /jffs/scripts/post-mount

12 - Start motion

debian restart

13 - Perform a movement in the front of your webcam.

14 - Go to media folder you setup in S99debian script here at point 4 and you'll find pictures captured by webcam and some .swf files witch can be oppened with your internet browser.

 

Tested successfully with Logitech C270 webcam
c270