上尉
- 注册时间
- 2008-11-23
- 金币
- 545 个
- 威望
- 110 个
- 荣誉
- 10 个
尚未签到
|
本帖最后由 sknrv 于 2010-11-30 20:24 编辑
发现好多人没搞明白,所以自己会弄了,顺便写个教程,自己以后可能也用得到!
将DB120设置成二级路由
1。网络——接口——WAN——协议——改成无——保存
2。网络——接口——LAN——设置IP(与上级路由同一IP段)——网关与DNS(DNS在添加里)为上级路由IP——保存应用
重起路由
重新登陆WEB管理时用刚刚设置的LAN IP(如果连接不上新的IP,检查下电脑的IP是否跟路由IP在同一网段,如果在同一网段,但是PING不通,可将电脑的本地连接 禁用了再启用)
此时电脑可以通过路由上网,说明二级路由设置成功。
开始挂摄像头:
1、登陆路由WEB管理:系统——软件包——编辑软件包列表和安装对象——将http://downloads.openwrt.org改成http://downloads.x-wrt.org/xwrt——提交
2、启动SecureCRT——ALT+Q——主机名:输入路由IP——连接——接受并保存——输入路由用户名(默认root)——输入路由密码(默认admin)——确定登陆
3、命令开始(红字为命令,黑字为结果,如果摄像头型号不同,需将最后一个包更改)
root@OpenWrt:~# opkg update
Downloading http://downloads.x-wrt.org/xwrt/backfire/10.03/brcm63xx/packages/Packages.gz.
Inflating http://downloads.x-wrt.org/xwrt/backfire/10.03/brcm63xx/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/packages.
root@OpenWrt:~# opkg install kmod-i2c-core
Installing kmod-i2c-core (2.6.32.10-1) to root...
Downloading http://downloads.x-wrt.org/xwrt/backfire/10.03/brcm63xx/packages/kmod-i2c-core_2.6.32.10-1_brcm63xx.ipk.
Configuring kmod-i2c-core.
root@OpenWrt:~# opkg install kmod-video-core
Installing kmod-video-core (2.6.32.10-1) to root...
Downloading http://downloads.x-wrt.org/xwrt/backfire/10.03/brcm63xx/packages/kmod-video-core_2.6.32.10-1_brcm63xx.ipk.
Configuring kmod-video-core.
root@OpenWrt:~# opkg install kmod-usb-video
Installing kmod-usb-video (2.6.32.10-1) to root...
Downloading http://downloads.x-wrt.org/xwrt/backfire/10.03/brcm63xx/packages/kmod-usb-video_2.6.32.10-1_brcm63xx.ipk.
Configuring kmod-usb-video.
root@OpenWrt:~# opkg remove kmod-usb-video (#这里不知道为什么要删除了下面再装上,请高手指教)
Removing package kmod-usb-video from root...
root@OpenWrt:~# opkg install kmod-usb-video
Installing kmod-usb-video (2.6.32.10-1) to root...
Downloading http://downloads.x-wrt.org/xwrt/backfire/10.03/brcm63xx/packages/kmod-usb-video_2.6.32.10-1_brcm63xx.ipk.
Configuring kmod-usb-video.
root@OpenWrt:~# opkg install kmod-video-gspca-core
Installing kmod-video-gspca-core (2.6.32.10-1) to root...
Downloading http://downloads.x-wrt.org/xwrt/backfire/10.03/brcm63xx/packages/kmod-video-gspca-core_2.6.32.10-1_brcm63xx.ipk.
Configuring kmod-video-gspca-core.
root@OpenWrt:~# opkg install kmod-video-gspca-zc3xx
Installing kmod-video-gspca-zc3xx (2.6.32.10-1) to root...
Downloading http://downloads.x-wrt.org/xwrt/backfire/10.03/brcm63xx/packages/kmod-video-gspca-zc3xx_2.6.32.10-1_brcm63xx.ipk.
Configuring kmod-video-gspca-zc3xx.
到此摄像头已经挂完,输入以下命令看看是否挂上。
root@OpenWrt:~# dmesg | grep usb
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
usbcore: registered new interface driver rtl8187
usbcore: registered new interface driver p54usb
usb usb1: configuration #1 chosen from 1 choice
usb usb2: configuration #1 chosen from 1 choice
usbcore: registered new interface driver usblp
usb 2-1: new full speed USB device using bcm63xx_ohci and address 2
usbcore: registered new interface driver usbserial
usb 2-1: configuration #1 chosen from 1 choice
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver zd1211rw
usb 2-1: USB disconnect, address 2
usb 2-1: new full speed USB device using bcm63xx_ohci and address 3
usb 2-1: configuration #1 chosen from 1 choice
usbcore: registered new interface driver zc3xx
看到最后一行,说明已经挂上。
4、开始安装监控程序motion
root@OpenWrt:~# opkg install motion
Installing motion (3.2.11.1-1) to root...
Downloading http://downloads.x-wrt.org/xwrt/backfire/10.03/brcm63xx/packages/motion_3.2.11.1-1_brcm63xx.ipk.
Installing libjpeg (6b-1) to root...
Downloading http://downloads.x-wrt.org/xwrt/backfire/10.03/brcm63xx/packages/libjpeg_6b-1_brcm63xx.ipk.
Configuring libjpeg.
Configuring motion.
root@OpenWrt:~# vi /overlay/etc/motion.conf
我的编辑文件内容如下(这个是引用别人的设置)(按字母o之后可编写,用DEL键来删除)
# Rename this distribution example file to motion.conf
#
# This config file was generated by motion "3.2.11.1"
############################################################
# Daemon
############################################################
# Start in daemon (background) mode and release terminal (default: off)
daemon off (此处 on改为off)
# File to store the process ID, also called pid file. (default: not defined)
process_id_file /var/run/motion/motion.pid
############################################################
# Basic Setup Mode
############################################################
# Start in Setup-Mode, daemon disabled. (default: off)
setup_mode off
###########################################################
# Capture device options
############################################################
# Videodevice to be used for capturing (default /dev/video0)
# for FreeBSD default is /dev/bktr0
videodevice /dev/video0
# Image width (pixels). Valid range: Camera dependent, default: 352
width 320 (视频宽)
# Image height (pixels). Valid range: Camera dependent, default: 288
height 240 (视频高)
# Motion Detection Settings:
############################################################
# Threshold for number of changed pixels in an image that
# triggers motion detection (default: 1500)
threshold 1500 (这个是改变探测灵敏度,越小越灵敏)
# Automatically tune the threshold down if possible (default: off)
threshold_tune off
# Noise threshold for the motion detection (default: 32)
noise_level 32
# Automatically tune the noise threshold (default: on)
noise_tune on
# Live Webcam Server
############################################################
# The mini-http server listens to this port for requests (default: 0 = disabled)
webcam_port 8081 #远程端口
# Quality of the jpeg images produced (default: 50)
webcam_quality 50
# Output frames at 1 fps when no motion is detected and increase to the
# rate given by webcam_maxrate when motion is detected (default: off)
webcam_motion off
# Maximum framerate for webcam streams (default: 1)
webcam_maxrate 1
# Restrict webcam connections to localhost only (default: on)
webcam_localhost off #必须改成off才能通过pc访问
# Limits the number of images per connection (default: 0 = unlimited)
# Number can be defined by multiplying actual webcam rate by desired number of seconds
# Actual webcam rate is the smallest of the numbers framerate and webcam_maxrate
webcam_limit 0
target_dir /tmp/cam1 保存目录
############################################################
# HTTP Based Control
############################################################
# TCP/IP port for the http server to listen on (default: 0 = disabled)
control_port 8080
# Restrict control connections to localhost only (default: on)
control_localhost on
# 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
##############################################################
# Thread config files - One for each camera.
# Except if only one camera - You only need this config file.
# If you have more than one camera you MUST define one thread
# config file for each camera in addition to this config file.
##############################################################
# Remember: If you have more than one camera you must have one
# thread file for each camera. E.g. 2 cameras requires 3 files:
# This motion.conf file AND thread1.conf and thread2.conf.
# Only put the options that are unique to each camera in the
# thread config files.
thread /etc/thread1.conf
thread /etc/thread2.conf
# thread /etc/thread3.conf
# thread /etc/thread4.conf #如果有多个摄像头要把使用这部分,否则全部注释掉
编辑完后依次按ESC Z Z 退出编辑
开启MOTION
输入cd / (回到根目录)
输入cd /etc (进到etc目录)
输入motion -c motion.conf (开启motion)
设置完毕!
可以用PC查看了
在windows下也可以使用palantir (在这里下载http://www.fastpath.it/products/palantir/pub/pclient.exe) 的pc客户端 连接 路由IP:8081 |
评分
-
2
查看全部评分
-
|