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 run normally (Linux support ov511, so the driver source code can be directly compiled by the kernel).
If the kernel is compiled, the kernel will be recompiled and the appropriate configuration options should be selected. My is ov511 so do not need to do too much configuration, are done after vidcat, there are vidcap and other source test camera driver is normal work, no problem so less a chance to improve, you have. Oh
The second step: Build an embedded Web server, Boa, an open source project, http://www.boa.org/download the source code.
Cross-compiling, this seems to be a problem ... Yes, it's me. ubuntu10.04, there is no update source, resulting in yacc, what is not a C + + parser is complete, so updated 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, available Kernel,hiweed,ubuntu
Then sudo apt-get update
The last few things to pack what, very smooth, I basically refer to this "Embedded Web server remote measurement and control in detail." PDF completed, the problem is also a lot of boa.conf configuration of old problems, users, groups also problems, the basic is to http://lameck.blog.163.com/ blog/static/3881137420095283910402/
Written in front: Boa Configuration Related directory: 1. boa.conf Storage directory: The default boa.conf is in the/etc/boa.conf directory, the BOA runtime will automatically 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.
HTML files are stored in the directory and can be modified in the boa.conf file. such as: Documentroot/var/www 4.
The CGI script holds the directory, which 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 the boa.conf file. such as: Mimetypes/etc/mime.types ======================================================= shift =======================================================, a boa service. Compile the 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 the BOA-0.94.13/SRC directory and execute the./configure 4. Make compile with 2.95.3 or more versions 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 to: #define TIMEZONE_OFFSET (foo) Foo->tm_gmtoff method 2>.
Use the compiler for version 2.95.3. Two. Modify the configuration file boa.conf 1.
Create the/etc/boa directory and copy the boa.conf to the/etc/boa directory and follow the steps below to modify it. 2. Modify access rights: Modify user nobody to user 0; Modify group Nogroup to group 0 3. Set log directory: Boa logs have two parts, errorlog and Accesslog generally/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 the/var/log/boa directory must be writable,
Otherwise it will be out error: log.c:73–unable to dup2 the error Log:bad file R.) 4. Set the HTML file directory: documentroot/var/www 5. Set default home page: DirectoryIndex index.html 6. Set the CGI script directory: Modify scriptalias/cgi-bin//usr/lib/cgi-bin to scriptalias/cgi-bin//var/www/cgi-bin three.
Set up the relevant folder and put the file in accordance with the second step setting: 1. Set up the/var/boa folder according to the settings (step 3).
2. Set up the/var/www folder according to the settings (step 4) and store the HTML file (including the index.html file) in this directory.
3. Set up the/var/www/cgi-bin folder according to the settings (step 6) and store some CGI scripts for testing.
Four. OK, run the BOA program.
This form of access is tested under Windows through http://172.20.223.151. Five. Porting to the Development Board 1>.
(first 3 steps) after the operation is complete, modify the makefile file: CC = gcc CPP = gcc-e should be: 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 mimetypes/etc/mime.types in the boa.conf file to: mimetypes/dev/null) six. Common errors : 1>. Error 1:gethostbyname:: No Such file or directory Workaround: Modify boa.conf to remove the comment 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] Workaround: Modified Src/compat.h found #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 out the following program: if (passwdbuf = = NULL) {D
IE ("Getpwuid");
} if (Initgroups (passwdbuf->pw_name, passwdbuf->pw_gid) = =-1) {Die ("initgroups");
The modification is: #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!");
The modification is: #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 the log directory pair and all users have read/write permission methods 2> repair
Change Src/log.c (Recommended Method 1) Comment out if (dup2 (error_log, stderr_fileno) = = 1) {die ("Unable to dup2 the error log");
The modification is: #if 0 if (dup2 (error_log, stderr_fileno) = = 1) {die ("Unable to dup2 the error log");
} #endif
Installation Instructions Test Boa Successful, my is http://192.168.0.31:8888/, test have picture Show
The third step, transplant webcam-server. Source here, foreign cattle ah http://webcamserver.sourceforge.net/This first need Libjpeg library, no way under the source code compilation chant 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
Requires a separate source 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 compile PNG, JPEG and other source code can use very good, very practical. Everything goes well I need the static libraries are all under the. Libs
Compile webcam-server problems, a big problem, the first is to find not the head file, but I finally copied into the source of the problem is gone, the following is the big problem it.
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 ....
Finally I found in the Src/makefile 88th line, they unexpectedly did not add-ljpeg my God, this can be a good program source write Ah, I will have these things, you can see as a programmer
to be more so serious, Otherwise, if we have the same problem in the future, we have to kill a group of people.
webcam-server A client to move him to the directory where the Boa file is located, mine is/var/www/
No matter what, in fact, the lower right corner of the small point, a flashing flash that is still in the video, in fact, the estimated 4 per second, 5 frames, keep up with the need Ah, I recently do video preservation is so, not capture the number of frames per second to meet the
requirements, can not use it, time spent in the Vidiocsync this, Suspicion is ov511 too old, but the old basic preservation video can always be achieved, ask for answers AH.