Webcam video surveillance via mjpg-streamer Optware

If you own a webcam from this list than you can attach it to one of routers usb port and see in real time images from it, like babyroom, garage, courtyard...

This version is for mipsel devices like RT-N16, RT-N66U, RT-AC66U...

We need an usb-flash formatted EXT2 or an usb-hdd formated EXT3, will not work on FAT32 or NTFS.
1 - Install Optware from here

2 - Download and install Mjpg-Streamer

ipkg update && ipkg upgrade
wget -c -O /tmp/mjpg-streamer_r63-2_mipsel.ipk http://bit.ly/2l0QOMD
ipkg install /tmp/mjpg-streamer_r63-2_mipsel.ipk
rm /opt/etc/init.d/K99webcam
wget -c -O /opt/etc/init.d/S99webcam http://bit.ly/2LFoJG6
chmod 755 /opt/etc/init.d/S99webcam

3 - Download and load UVC modules (if modules not working you must to compile them for your firmware)

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
wget -c -O /opt/etc/webcam/videomod.sh http://bit.ly/2xZTdR5
chmod a+rx /opt/etc/webcam/videomod.sh
/opt/etc/webcam/videomod.sh load
/opt/etc/init.d/S99webcam start

4 - Go to web browser and type: 192.168.1.1:9999/stream_simple.html default username admin and password admin

You can change username, password, resolution, fps...

ipkg install nano
/opt/etc/init.d/S99webcam stop
nano /opt/etc/init.d/S99webcam

Find this two lines and replace with desired login
mjpg-pass
• Save with CTRL-O / Enter / and exit with CTRL-X

5  - To start mjpg-streamer automatically on every router reboot we have to create S99webcam script

nano /jffs/scripts/post-mount

Add this lines

#!/bin/sh
/opt/etc/init.d/S99webcam start

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

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

6 - If you want to access the webcam from wan, we have to create another script that open the port 9999

nano /jffs/scripts/firewall-start

Add this lines

#!/bin/sh
iptables -I INPUT -p tcp --destination-port 9999 -j ACCEPT

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

chmod a+rx /jffs/scripts/firewall-start

7 - Start mjpg server

/opt/etc/init.d/S99webcam start

8 - Now type your_wan_ip adress:9999/stream_simple.html in browser and should see your webcam
If you have dynamic ip, better set a dynamic dns 192.168.1.1/Advanced_ASUSDDNS_Content.asp

Tested successfully with Logitech C270 webcam
c270

Video HERE...
youtube

REVIEW (CLICK ON THE STARS TO RATE!)
5
Sending
User Review
5 (3 votes)