Motion is a program that monitors the video signal from cameras.
It is able to detect if a significant part of the picture has changed; in other words, it can detect motion. :)
If you own a webcam from this list you can attach it to the AsusWRT routers usb port and capture images from it when motion is detected, like baby room, garage, courtyard...
It's only for arm devices like RT-AC56U, RT-AC68U, RT-AC87U, RT-AC88U, RT-AC3200, RT-AC5300...
1 - Install Optware-NG from here
2 - Create script for loading video modules
#!/bin/sh
PATH=/opt/sbin:/opt/bin:/opt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
do_load_kmods_video()
{
## If uvcvideo module is already loaded exit with 1.
## Note: uvcvideo is being loaded last.
lsmod | grep -q uvcvideo && exit 1
DRV_PATH=lib/modules/`uname -r`/kernel/drivers
kmods_req="
usb/core/usbcore.ko
input/input-core.ko
media/video/v4l1-compat.ko
media/video/videodev.ko
media/video/v4l2-int-device.ko
media/video/v4l2-common.ko
media/video/v4l2loopback.ko
media/video/gspca/gspca_main.ko
media/video/uvc/uvcvideo.ko"
kmods_path=""
for i in $kmods_req ; do
if [ -f /$DRV_PATH/$i ] ; then
kmods_path="$kmods_path /$DRV_PATH/$i"
else
kmods_path="$kmods_path /opt/$DRV_PATH/$i"
fi
done
for i in $kmods_path ; do
insmod $i >/dev/null 2>&1
done
}
do_unload_kmods_video()
{
## If videodev module is not loaded exit with 1.
## Note: videodev.ko is being loaded first.
lsmod | grep -q videodev || exit 1
kmods_media="
uvcvideo
input-core
v4l2-int-device
v4l2-common
v4l1-compat
v4l2loopback
gspca_main
videodev"
for i in $kmods_media ; do
rmmod $i >/dev/null 2>&1
done
}
case "$1" in
start)
logger -s "Loading UVC modules..."
do_load_kmods_video
;;
stop)
logger -s "Unloading UVC modules..."
do_unload_kmods_video
;;
*)
echo "Usage: $0 { start | stop }"
exit 3
esac
exit 0
EOF
chmod a+rx /opt/etc/init.d/S20videomod
Press ENTER
3 - Download and load UVC Modules (if you have a different firmware version, use this guide to compile modules or ask someone on forums)
cd /
tar -zxvf /opt/tmp/uvc_modules-380.65_4-loop.tgz
rm /opt/tmp/uvc_modules-380.65_4-loop.tgz
/opt/etc/init.d/S20videomod start
4 - Install Motion
5 - Replace motion configuration file
6 - Change target dir path, where recorded videos and pictures are stored
sed -i 's|target_dir /.*|target_dir /opt/motion|g' "/opt/etc/motion.conf"
7 - Start motion
8 - Perform a movement in the front of your webcam.
9 - Go to the folder you setup at point 6 and you'll find pictures captured by webcam and some .avi files which can be opened with any media player.
10 - If you want to enable live stream:
/opt/etc/init.d/S99motion restart
11 - Go to default router ip address and port :8081 or www.asusrouter.com:8081
To play with other settings like change framerate, enable password authentication, edit /opt/etc/motion.conf and don't forget to restart motion to take effect.
Tested successfully with Logitech C270 webcam