Howto USB Webcam

mjpg_streamer --input " --help":
MJPG Streamer Version: svn rev: exported
 Help for input plugin..: UVC webcam grabber
 The following parameters can be passed to this plugin:

 [-d | --device ].......: video device to open (your camera)
 [-r | --resolution ]...: the resolution of the video device,
                          can be one of the following strings:
                          QSIF QCIF CGA QVGA CIF VGA 
                          SVGA XGA SXGA 
                          or a custom value like the following
                          example: 640x480
 [-f | --fps ]..........: frames per second
 [-y | --yuv ]..........: enable YUYV format and disable MJPEG mode
 [-q | --quality ]......: JPEG compression quality in percent 
                          (activates YUYV format, disables MJPEG)
 [-m | --minimum_size ].: drop frames smaller then this limit, useful
                          if the webcam produces small-sized garbage frames
                          may happen under low light conditions
 [-n | --no_dynctrl ]...: do not initalize dynctrls of Linux-UVC driver
 [-l | --led ]..........: switch the LED "on", "off", let it "blink" or leave
                          it up to the driver using the value "auto"mjpg_streamer --output " --help"

 Help for output plugin..: HTTP output plugin
 The following parameters can be passed to this plugin:

 [-w | --www ]...........: folder that contains webpages in 
                           flat hierarchy (no subfolders)
 [-p | --port ]..........: TCP port for this HTTP server
 [-c | --credentials ]...: ask for "username:password" on connect
 [-n | --nocommands ]....: disable execution of commands

mjpg_streamer --output " --help"

 ---------------------------------------------------------------  Help for output plugin..: file output plugin  ---------------------------------------------------------------  The following parameters can be passed to this plugin: [-f | --folder ]........: folder to save pictures
[-m | --mjpeg ].........: save the stream to an mjpeg file
[-d | --delay ].........: delay after saving pictures in ms
[-s | --size ]..........: size of ring buffer (max number of pictures to hold)
[-e | --exceed ]........: allow ringbuffer to exceed limit by this amount
[-c | --command ].......: execute command after saving picture
[-i | --input ].........: read frames from the specified input plugin
# Quick OpenWRT setup on WR703N With mjpg-streamer webcam and Arduino Duemillanove (FTDI).

# - 1 - on Pc download and save admin admin .Last menu item 3rd from top is for flashing.

# after flashing it will reboot. Connect to PC via eth cable. Or solder serial cable 115200bps.

In future can also flash new version from command line 

cd /tmp
mtd -r write openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin firmware

# If in future need to revert to fresh version do not need to reflash just type

# -2- Next we setup network as dhcp client

cat <<EOT > /etc/config/network
config 'interface' 'loopback'
option 'ifname' 'lo'
option 'proto' 'static'
option 'ipaddr' ''
option 'netmask' ''

config 'interface' 'lan'
option 'ifname' 'eth0'
option 'type' 'bridge'
option 'proto' 'dhcp'

cat /etc/config/network

/etc/init.d/network restart

# connect to home router. USe IP scanner programm  to find address. Telnet.

# -3- We change sources to point to barbara server

cp /etc/opkg.conf /etc/opkg.conf.orig
cat <<EOT > /etc/opkg.conf
src/gz attitude_adjustment

dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay

cat /etc/opkg.conf

# -4- luci webinterface is installed  in original openwrt
opkg update
opkg install luci
/etc/init.d/uhttpd enable
/etc/init.d/uhttpd start

# -5- Arduino Duemillanove with FTDI USB-serial chip
opkg update
opkg install coreutils-stty  
opkg install kmod-usb-serial
opkg install kmod-usb-serial-ftdi
# a device should appear with plugged in Arduino
ls /dev/ttyUSB0

# -7- webcam streamer 
opkg update
opkg install kmod-video-core 
opkg install kmod-video-uvc 
opkg install mjpg-streamer
# a device should appear with plugged in webcam
ls /dev/video0

# -8- Download webserver files from barbara server. Check that they work via webbrowser.
cd /www/cgi-bin
chmod 777 *

# -9-
Add lines to crontab -e from file /www/cgi-bin/root
Add lines to /etc/rc.local from file rc.local

# -10- last go to Luci webinterface and set up wifi AP. 
# essentials, network, wifi, enable, save. 
OpenWRT WiFi newtwork should appear. Coonect to it from PC. 
It works like a bridge, gets dhcp server address from main router. So keep ethernet cable plugged in. 
Before playing with network settings Backup settings via webinterface to PC.

df -h 
#Filesystem                Size      Used Available Use% Mounted on
#rootfs                  832.0K    756.0K     156.0K  81% /
#practically very little space left