Remote Video Monitoring Application (Environment setup)

Source: Internet
Author: User

Reprinted please indicate the source: http://blog.csdn.net/ruoyunliufeng/article/details/38515423


This article mainly describes how to build a remote video monitoring environment. It will be designed to build a network, and some applications and libraries will also be transplanted.

1. Configure the kernel

1. Support for UVC (USB camera)

Make menuconfig
<*> Multimedia support --->
<*> Video for Linux
[*] Video capture adapters (new) --->
[*] V4l USB devices (new) --->
<*> USB video class (UVC)
2. Support for wireless NICs (atheros ar9271 chip)

Configuration:
-> Networking suppor
-> Wireless
<*> 80211-Wireless Configuration API
<*> Generic IEEE 802.11 networking stack (mac80211)
-> Device Drivers
-> Network device support
-> Wireless LAN
-> Atheros wireless cards
<*> Atheros HTC based wireless cards support

3. firmware support

Put the firmware htc_9271.fw (you can find it online, and I will also provide it to you) on the Board/lib/firmware


2. Port wpa_supplicant

We need to use a wireless network adapter to connect to the route. Therefore, we need a WLAN management tool to set the login password.
1. Compile the libopenssl dependency first.
Tar xzf openssl-1.0.1d.tar.gz
CD openssl-1.0.1d/
./Config shared no-ASM -- prefix = $ PWD/tmp
Modify makefile:
Cc = arm-Linux-gcc
AR = arm-Linux-ar $ (arflags) r
Ranlib = arm-Linux-ranlib
Nm = arm-Linux-nm
Makedepprog = arm-Linux-gcc

Make
Make install
Installation:
Put the compiled header file:
/Usr/local/ARM/4.3.2/ARM-None-Linux-gnueabi/libc/usr/include

Put the compiled library file:
/Usr/local/ARM/4.3.2/ARM-None-Linux-gnueabi/libc/armv4t/lib

Put the compiled library file into the lib directory of the NFS file system:
/Work/nfs_root/fs_mini_mdev_new/lib


2. There must be a configuration file. config
Tar xzf wpa_supplicant-2.0.tar.gz
CD wpa_supplicant-2.0/wpa_supplicant/
CP defconfig. config
Add a row to modify. config: config_libnl32 = y
Modify makefile:
Cc = arm-Linux-gcc
 
Make
Make destdir = $ PWD/tmp install

Then copy the compiled application to the bin directory of the NFS file system.
3. Use:
Mkdir-P/var/run/wpa_supplicant
VI wpa_wpa2.conf (write a configuration file)
Configuration File: Applicable to wpa_wpa2
Ctrl_interface =/var/run/wpa_supplicant

Network = {
SSID = "test"
PSK = "xiaojin123"
}

After completing the above steps, plug in your USB Nic

Wpa_supplicant-B-c/etc/wpa_wpa2.conf-iwlan0
Wpa_cli-iwlan0 status // view the status
Ifconfig wlan0 192.168.1.x
Ping 192.168.1.1

If the network card can be pinged, it indicates that the network card is connected. If the ping fails, it indicates that there are still problems. Check the previous steps carefully. (Ensure that the wired and wireless network cards are not in the same network segment during the test)


3. automatically start the application at startup

When we start the Development Board, the Development Board should automatically start the application, configure the IP address, and so on, so I wrote a script

First Modify/etc/init. d # vi RCS

Mount-
Mkdir/dev/PTS
Mount-T devpts/dev/PTS
Echo/sbin/mdev>/proc/sys/kernel/hotplug
Mdev-S
Insmod/wvm/PWM/wvm_pwm.ko
Insmod/wvm/led/wvm_led.ko
Insmod/wvm/button/wvm_buttons.ko
Insmod/ath9k_hsf-ko
Insmod/ath9k_common.ko
Insmod/ath9k_htc.ko

Then modify/etc # vi mdev. conf.

Wlan0 0 0 0 777 */sbin/auto_wifi.sh

Then modify sbin # vi auto_wifi.sh

#! /Bin/sh
If [$ action = "add"];
Then
Wpa_supplicant-B-c/etc/wpa_wpa2.conf-iwlan0
Wpa_cli-A/sbin/wpa_action.sh-B
Else
Killall wpa_supplicant
Killall wpa_cli
Fi

Last Modified

#! /Bin/sh
Ifname = $1
Cmd = $2
If ["$ cmd" = "connected"]; then
Echo connect $ ifname, ifconfig for it>/dev/console
Ifconfig wlan0 192.168.1.10 // configure the IP address
Route add default GW 192.168.1.1 // sets the Gateway
All_test & // run the application in the background
Mjpg_streamer-I "input_uvc.so-f 10-r 640*480"-o "output_http.so-c" ruoyun: Liufeng "-W www-P 8888 "&
Fi
If ["$ cmd" = "disconnected"]; then
Echo disconnect $ ifname>/dev/console
Fi


4. Port libjpeg (the Library required by mjpg-streamer)

Tar xzvf libjpeg-turbo-1.2.1.tar.gz
CD libjpeg-turbo-1.2.1
Mkdir TMP
./Configure -- prefix = $ PWD/tmp -- Host = arm-Linux
Make
Make install
Assign the library file to the Development Board


5. Set Internet access

1. Register a peanut shell

2. Set a router (my router is shuoke nw750p. I will use it as an example)

A. Set dynamic domain names

Note: the user name and password are the user name and password you entered during registration.

Second, since the peanut shell client has logged on to the route, do not log on elsewhere.

If the figure appears in the status information, congratulations!

B. Port ing

Note: The intranet Host IP address is the IP address of your camera, and the internal port is also the camera port (changed to 8888 by yourself, and mjpg_streamer defaults to 8080, it is better to change the Internet. Some people say that some operators will close 8080)

Second, after the external port is set to 80, change the Local Web Management port to avoid conflict.



C. DMZ

It doesn't matter if my firewall is turned off. If the firewall is turned on, open the DMZ.

3. Test

A. Ping the peanut shell on the Windows host. If the ping succeeds, the startup is successful. If not, check whether the router has started the peanut shell or whether the router has logged on again.

B. The Development Board is pinged to the Internet. Note that it is pinged to the Internet rather than the gateway of the router. I have been here for debugging. Only your Development Board can ping the internet. You can connect your development board to the outer network. It took a long time for me to make the DNS settings wrong.

C. Access the peanut shell port and enter the peanut shell URL in the browser to view the camera situation (of course, mjpg-streamer requires the corresponding parameters. I will explain in detail in the next article ).


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.