Remote video monitoring system based on embedded web

Source: Internet
Author: User
Tags valid

Hardware: Development Board, OV511 camera, notebook or desktop

Software: ubuntu10.04,webcam-server,ov511 Drive, Cross tool chain, Libjpeg Graphics library (cross-compiled)

The first step: test whether the camera can be normal operation (Linux support ov511, so the driver source code can be directly compiled by the kernel).

For a driver-driven transplant, the kernel is recompiled and the appropriate configuration options are selected. My is ov511 so do not need to do too much configuration, after doing well through the vidcat, there are vidcap and other source test camera driver is working, no problem so less a chance to improve, you have it. Oh

Step Two: Build the embedded Web server, Boa, an open source project, http://www.boa.org/download source.

Cross-compile, this seems to be a problem ... Yes, it's me. ubuntu10.04, no update source, resulting in yacc, what the C + + parser is incomplete, so update the source of 163

sudo gedit/etc/apt/sources.list

Put the following in the file.


Code:
Deb http://mirrors.163.com/ubuntu/lucid main universe restricted multiverse
deb-src http:// Mirrors.163.com/ubuntu/lucid main Universe restricted Multiverse
Deb http://mirrors.163.com/ubuntu/ Lucid-security Universe main Multiverse restricted
Deb-src http://mirrors.163.com/ubuntu/lucid-security universe Main multiverse restricted
Deb Http://mirrors.163.com/ubuntu/lucid-updates universe main Multiverse restricted
Deb Http://mirrors.163.com/ubuntu/lucid-proposed Universe main Multiverse restricted
deb-src http:// Mirrors.163.com/ubuntu/lucid-proposed Universe main Multiverse restricted
Deb http://mirrors.163.com/ubuntu/ Lucid-backports Universe main Multiverse restricted
Deb-src http://mirrors.163.com/ubuntu/lucid-backports Universe main Multiverse restricted
Deb-src http://mirrors.163.com/ubuntu/lucid-updates Universe main Multiverse Restricted
Ubuntu official Shanghai Source, providing Kernel,hiweed,ubuntu


Then sudo apt-get update

The last few what to pretend, very smooth, I basically refer to this "Embedded Web server Remote measurement and control". PDF completed, the problem is also a lot of boa.conf configuration on the old problem, users, groups also have problems, the basic is to http://lameck.blog.163.com/ blog/static/3881137420095283910402/

Written in front: Boa Configuration Related directory: 1. boa.conf directory: The default boa.conf is in the/etc/boa.conf directory, Boa run automatically to find the/etc/bon.conf directory. 

This setting is defined in the Define.h file and can be modified before compiling.
    2. Log directory: Divided into Errorlog and accesslog two directories, can be modified in boa.conf. such as: Errorlog/var/log/boa/error_log Accesslog/var/log/boa/access_log 3.
    The HTML file is stored in the directory and can be modified in the boa.conf file. such as: Documentroot/var/www 4.
    The CGI script resides in the directory and can be modified in the boa.conf file. such as: scriptalias/cgi-bin//var/www/cgi-bin 5.
    Mime.types storage directory, can be modified in boa.conf file. such as: Mimetypes/etc/mime.types ======================================================= shift  Plant Boa Service ======================================================= one. Compile Boa Program 1. www.boa.org Download boa-0.94.13.tar.gz 2. Decompression: TAR–ZXVF boa-0.94.13.tar.gz 3. Enter BOA-0.94.13/SRC directory, execute./configure 4. Make compile-time with 2.95.3 Version Error: util.c:100:1: pasting "T" and "->" does not give a valid preprocessing token made: [UTIL.O] Error1 Solution: Method 1> Modify the #define TIMEZONE_OFFSET (foo) Foo##->tm_gmtoff in compat.h as: #define TIMEZONE_OFFSET (foo) Foo->tm_gmtoff method 2> 

Use the 2.95.3 version of the compiler instead. Two. Modify the configuration file boa.conf 1.
Create the/etc/boa directory and copy boa.conf to the/etc/boa directory, and follow these steps to modify it. 2. Modify access rights: Modify user nobody to user 0; Modify group Nogroup to group 0 3. Set log directory: Boa Log has two parts, Errorlog and Accesslog generally for/var/log/boa/error_log and/var/log/boa/access_log two files. So set the log directory according to your own situation: Errorlog/var/log/boa/error_log Accesslog/var/log/boa/access_log (Note: Here/var/log/boa directory must be writable, 
 Otherwise items will be out of error: Log.c:73–unable to dup2 the error Log:bad file R.) 4. Set HTML file directory: documentroot/var/www 5. Set default home: DirectoryIndex index.html 6.  To set the CGI script directory: Modify the scriptalias/cgi-bin//usr/lib/cgi-bin to scriptalias/cgi-bin//var/www/cgi-bin three.
 Set up the related folder and put it in the file according to the second step: 1. Set up the/var/boa folder according to the settings (step two. 3).
 2. Establish the/var/www folder according to the settings (second. 4) and store HTML files (including index.html files) under this directory. 
3. Set up the/var/www/cgi-bin folder according to the setup (second. 6) and store some CGI scripts for testing.
   Four. OK, run the BOA program. 
Tested by http://172.20.223.151 This form of access under Windows. Five. Transplanted to the Development Board 1>
   (first. 3 steps) After completing the operation, modify the makefile file: CC = gcc CPP = gcc-e: CC = ARM-LINUX-GCC CPP = arm-linux-gcc-e make. 2>. Copy the/etc/mime.types file on the PC to the Development Board/ETC directory (or modify the boa.conf file Mimetypes/etc/mime.types to: Mimetypes/dev/null) six. Common errors : 1> Error 1:gethostbyname:: No Such file or directory Workaround: Modify boa.conf to remove the annotation symbol (#) Www.your.org.here before ServerName 2>. Error 1:util.c:100:1: error:pasting "T" and "->" does not give a valid preprocessing token make: * * * [UTIL.O] Solution: Modify Src/compat.h Find #define TIMEZONE_OFFSET (foo) Foo##->tm_gmtoff modified to #define TIMEZONE_OFFSET (foo) foo->t M_gmtoff 3> Error 2:boa.c:211-getpwuid:no such file or directory workaround: Modify SRC/BOA.C comment off the following program: if (passwdbuf = = NULL) {D
   IE ("Getpwuid");
   } if (Initgroups (passwdbuf->pw_name, passwdbuf->pw_gid) = = 1) {DIE ("initgroups");
   Modify to: #if 0 if (passwdbuf = NULL) {DIE ("Getpwuid");
   } if (Initgroups (passwdbuf->pw_name, passwdbuf->pw_gid) = = 1) {DIE ("initgroups");
} #endif 4>.  Error 3:boa.c:228-icky Linux kernel bug!: No such file or directory workaround: Modify SRC/BOA.C comment out the following statement: if (setuid (0)!=-1)
  {DIE ("Icky Linux kernel bug!");
   Modify to: #if 0 if (setuid (0)!=-1) {DIE ("Icky Linux kernel bug!"); } #endif 5>. Error 4:log.c:73 Unable to dup2 the error Log:bad file Descriptor Workaround: Method 1> determine that the log directory has a read/write permission method for all users 2> repair
  Change Src/log.c (Method 1 is recommended) to comment out if (dup2 (error_log, stderr_fileno) = = 1) {DIE ("Unable to dup2 the error log");
   Modify to: #if 0 if (dup2 (error_log, stderr_fileno) = = 1) {DIE ("Unable to dup2 the error log"); 
 } #endif


Installation Instructions Test Boa Success after my is http://192.168.0.31:8888/, test has pictures show

The third step is to transplant webcam-server. Source code here, foreign cattle ah http://webcamserver.sourceforge.net/This first need to Libjpeg library, no way to compile the source code bai http://www.ijg.org/ Seriously, this site is not very easy to find.

When compiling the library, I found a trick.

Compile libjpeg.a, compile libpng.a, compile LIBTIFF.A

Need the respective source code package.
(1.) Export Arch=arm
(2.) Export cross_compile=/usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-
(3.) Export CC=${CROSS_COMPILE}GCC
(4) Cflags=-o2 ldflags=-static./configure--build=i386-pc-linux--host=arm-linux--target=arm-linux

These compiled PNG, JPEG and other source code can be used very well, very practical. Everything's going well. Static libraries are all in. Libs

Compile webcam-server problems, a big problem, the first is to find the file, but I finally copied into the source code this problem is gone, the following is the big problem.

filters.o:in function ' image2jpeg ':
filters.c: (. text+0x81c): Undefined reference to ' Jpeg_std_error
' FILTERS.C: (. text+0x830): Undefined reference to ' jpeg_createcompress '
filters.c: (. text+0x858): undefined Reference to ' Jpeg_set_defaults '
filters.c: (. text+0x868): Undefined reference to ' jpeg_set_quality
' FILTERS.C: (. text+0x874): Undefined reference to ' jpeg_start_compress '
filters.c: (. text+0x8a8): undefined Reference to ' Jpeg_write_scanlines '
filters.c: (. text+0x8c8): Undefined reference to ' jpeg_finish_compress
' FILTERS.C: (. text+0x8fc): Undefined reference to ' jpeg_destroy_compress '
filters.c: (. text+0x91c): undefined Reference to ' jpeg_destroy_compress '
collect2:ld returned 1 exit status make
: * * * [webcam_server] Error 1
This question you go to Baidu estimate can't find what you want ...
in the end I found in the Src/makefile 88th line, they unexpectedly did not add-ljpeg my God, this can be a good source of the program to write Ah, I will have these things, you can see as a programmer
to be more so serious to do ah, Otherwise, if we have the same problem in the future, we have to kill a group of people AH.
Webcam-server has a client to move him to the directory where Boa files are located, and mine is/var/www/. 
 
It's not the same, it's actually the lower right corner, and the flash flash shows the video, in fact, every second is estimated to be 4, 5 frames, do not keep up with the need Ah, I recently do video preservation is also so, not capture the number of frames per second is
 
not up to the requirements, it can not be used, the time spent in the Vidiocsync this, Suspicion is ov511 too old, but the old basic save video can always achieve it, ask the answer AH.
 

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.