3.1 无线路由模块
在无线路由上我们嵌入了openwrt操作系统用于管理网络连接、自动拨号、wifi控制等。UVC摄像头我们也是挂在路由器上的,采用了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
# Rename this distribution example file to motion.conf
#
# This config file was generated by motion "3.2.11.1"
# 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
# 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
3.2 EVK1105模块
这一模块中我们主要是基于Lwip在Atmel公司的EVK1105开发平台上构建一个websever,完成人与车间的互动和数据的采集。具体界面如下:
portCHAR cDynamicPage[ webMAX_PAGE_SIZE ];
portCHAR cPageHits[ 11 ];
int f;
/*! Function to process the current connection */
static void prvweb_ParseHTMLRequest( struct netconn *pxNetCon );
/*! \brief WEB server main task
* check for incoming connection and process it
*
* \param pvParameters Input. Not Used.
*
*/
portTASK_FUNCTION( vBasicWEBServer, pvParameters )
{
struct netconn *pxHTTPListener, *pxNewConnection;
/* Create a new tcp connection handle */
pxHTTPListener = netconn_new( NETCONN_TCP );
netconn_bind(pxHTTPListener, NULL, webHTTP_PORT );
netconn_listen( pxHTTPListener );
/* Loop forever */
for( ;; )
{
/* Wait for a first connection. */
pxNewConnection = netconn_accept(pxHTTPListener);
vParTestSetLED(webCONN_LED, pdTRUE);
if(pxNewConnection != NULL)
{
prvweb_ParseHTMLRequest(pxNewConnection);
}/* end if new connection */
vParTestSetLED(webCONN_LED, pdFALSE);
} /* end infinite loop */
}
/*! \brief parse the incoming request
* parse the HTML request and send file
*
* \param pxNetCon Input. The netconn to use to send and receive data.
*
*/