mzk-w04nu(or cqw-mr1000) + open wrt + motionで監視カメラ(fstab,motionあたり)

ここらへんからの続きです

http://d.hatena.ne.jp/toshi_hirasawa/20120701/1341124328
http://d.hatena.ne.jp/toshi_hirasawa/20120701/1341118999
http://d.hatena.ne.jp/toshi_hirasawa/20120701/1341118998


http://homebrew.jp/show?page=1249
Fonera 2.0+OpenWrtで動体検知機能付き無線監視カメラ

こちらを参考に

luci-i18n-japanese
ntpd
kmod-usb-storage
kmod-fs-ext3
block-hotplug
fdisk
e2fsprogs

をopkg installして

そのあと、

http://mizupc8.bio.mie-u.ac.jp/pukiwiki/index.php?OpenWrt%2FUSBStorage

OpenWRTでのUSBストレージ利用に関するページ

を参考に、USBストレージの設定をおこなう

ローカルPCにて手持ちのUSBメモリをfdisk/mke2fs -jして

 2000  fdisk -l
 2001  fdisk /dev/sdb
 2004  fdisk -l
 2005  mke2fs -j /dev/sdb1


あとは、luci から
マウント系の設定(/etc/fstabと等価)をいじる

device /dev/sda1
mountP /mnt/sda1
exit
rw,sync
no
no

ってところ。
なぜか、PCでのmke2fs -jがうまくいかないかったので
openwrt#からmke2fs -jしなおしたらマウントできた

なんでだろう?
まぁ、結果オーライってことでおけw






root@openwrt-ap-192:~# cat /var/opkg-lists/packages | grep Package | grep ssh
Package: autossh
Package: erlang-ssh
Package: openssh-client-utils
Package: openssh-client
Package: openssh-keygen
Package: openssh-server
Package: openssh-sftp-client
Package: openssh-sftp-server
Package: rssh
Package: sshfs
Package: sshtunnel

             
    root@OpenWrt:~# opkg update

    root@OpenWrt:~# opkg install kmod-usb2
    root@OpenWrt:~# opkg install kmod-video-uvc
    root@OpenWrt:~# opkg install motion
root@pci-cqw-195:/etc# diff motion.conf.orig motion.conf 
--- motion.conf.orig	Sun Jul  1 16:23:17 2012
+++ motion.conf	Sun Jul  1 16:29:29 2012
@@ -45,7 +45,7 @@
 # V4L2_PIX_FMT_YUYV    : 6  'YUYV'
 # V4L2_PIX_FMT_YUV422P : 7  '422P'
 # V4L2_PIX_FMT_YUV420  : 8  'YU12'
-v4l2_palette 8
+v4l2_palette 6
 
 # Tuner device to be used for capturing using tuner as source (default /dev/tuner0)
 # This is ONLY used for FreeBSD. Leave it commented out for Linux
@@ -74,7 +74,7 @@
 
 # Maximum number of frames to be captured per second.
 # Valid range: 2-100. Default: 100 (almost no limit).
-framerate 2
+framerate 10
 
 # Minimum time in seconds between capturing picture frames from the camera.
 # Default: 0 = disabled - the capture rate is given by the camera framerate.
@@ -311,7 +311,7 @@
 # Locate and draw a box around the moving object.
 # Valid values: on, off and preview (default: off)
 # Set to 'preview' will only draw a box in preview_shot pictures.
-locate off
+locate on
 
 # Draws the timestamp using same options as C function strftime(3)
 # Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock
@@ -356,7 +356,7 @@
 
 # Target base directory for pictures and films
 # Recommended to use absolute path. (Default: current working directory)
-target_dir /usr/local/apache2/htdocs/cam1
+target_dir /tmp/motion
 
 # File path for snapshots (jpeg or ppm) relative to target_dir
 # Default: %v-%Y%m%d%H%M%S-snapshot
@@ -410,7 +410,7 @@
 webcam_maxrate 1
 
 # Restrict webcam connections to localhost only (default: on)
-webcam_localhost on
+webcam_localhost off
 
 # Limits the number of images per connection (default: 0 = unlimited)
 # Number can be defined by multiplying actual webcam rate by desired number of seconds
@@ -423,17 +423,17 @@
 ############################################################
 
 # TCP/IP port for the http server to listen on (default: 0 = disabled)
-control_port 8080
+control_port 8082
 
 # Restrict control connections to localhost only (default: on)
-control_localhost on
+control_localhost off
 
 # Output for http server, select off to choose raw text plain (default: on)
 control_html_output on
 
 # Authentication for the http based control. Syntax username:password
 # Default: not defined (Disabled)
-; control_authentication username:password
+; control_authentication root:xxxxxxxxx
 
 
 ############################################################
root@pci-cqw-195:/etc# 

http://mizupc8.bio.mie-u.ac.jp/pukiwiki/index.php?OpenWrt%2FUSBStorage

OpenWRTでのUSBストレージ利用に関するページ
を参考に、USBにデータを貯めることにする。

rsyncで定期的に画像データをアップロードすればおけ?

続きはこちら

http://d.hatena.ne.jp/toshi_hirasawa/20120714/1342272418