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
ipkg install /tmp/mjpg-streamer_r63-2_mipsel.ipk
rm /opt/etc/init.d/K99webcam
wget -c -O /opt/etc/init.d/S99webcam
chmod 755 /opt/etc/init.d/S99webcam

3 - Download and load UVC modules (if you have a different firmware version, use this guide to compile modules or ask someone on forums)

wget -c -O /opt/tmp/uvc_modules_2.6.22.19-378.50b2-mipsel.tar
cd /
tar -zxf /opt/tmp/uvc_modules_2.6.22.19-378.50b2-mipsel.tar
wget -c -O /opt/etc/webcam/
chmod a+rx /opt/etc/webcam/
/opt/etc/webcam/ load
/opt/etc/init.d/S99webcam start

4 - Go to web browser and type: 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
• 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

/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

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

Tested successfully with Logitech C270 webcam

Video HERE...

User Review
5 (4 votes)