Transplantation and application of embedded web server BOA

  Embedded web server subsystem

A control process embedded web server

  Shown below embedded web server may be implemented to control remote embedded development board over the network , convenient and practical.

Process Control: browser --- >>> embedded development board

1) the browser sends a command, the development board web server receives the request , in the development board " #boa" Run the web server, the application program configured CGI program calling the specified directory in the paper boa_conf / cam / in (arm-linux-gcc movctl.c -o movctl.cgi);

2) CGI program call other procedures developed board system , to achieve control of the development board ;

      <<< --- browser embedded development board

1) development board system returns the control result , by generating HTMI CGI program file -> Web server ;

2) Web server to the network , the browser can receive IP Development Board according to the control of the return result;

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Second embedded web server -> BOA transplant, cgi application library transplant --- >>>

  BOA: BOA download server and then decompressed -> Change file .configure cross compiler-Linux- ARM -> the make an application which generates boa, boa_conf profile ;

  cgi library: .configure modified cross-compiler Linux- ARM, the make generate libraries libcgi.a moved to / rootfs / lib / lower can;  

Boa_conf modify configuration items in the configuration file, such as: designated web interface design documents /web/~.html , menu jump cgi program source directory /web/cam/~.cgi .

  Development board running "#boa" , the browser login boards ip -192.168.1.2, you can log in web design interface embedded web server. Then start moving the main body monitoring system "motion -c motion_dist_conf", you can login server interface to obtain monitored moving images and video information.

                 -----------------------------------------------------------------------------------------------------

  Among them, the web interface, get pictures and video surveillance cgi program development

Web interface: the original .html program carried out on the basis of changes, modifications only: "class = " the MENU " href = " /cam/movie.cgi "  , ie the interface menu text --- web / cgi run the program after the jump ;

cgi program: main function cgiMain () , the

      . 1) Print_File (cgiOut, "../ top.html"); // add head, the print content to cgiOut top.html

         2)total = list_pic("/mnt/sd","jpg");  //将图片加入显示列表

       3)if (cgiFormSubmitClicked("gopage") == cgiFormSuccess) {   //处理用户的选择请求

     4)show_pic(start,end,total);  //显示图片

     5)print_file(cgiOut,"../bottom.html");  //加尾,将bottom.html内容打印到cgiOut

  arm-linux-gcc -L ./cgic205/ -lcgi movie.c -o movie.cgi   

--------------------------------------------------------------------------------------------------------------------------------------------------------------

嵌入式web服务器程序设计---流程:

  移植BOA服务器,移植CGI库 -> 设置网页界面程序 .html、cgi监控程序 -> 配置boa_conf配置文件,指定浏览服务器网页界面文件、及菜单跳转的cgi程序 -> 启动motion 、boa -> 浏览器登录web服务器的ip(开发板ip)即可。

 

Guess you like

Origin www.cnblogs.com/hjh-666/p/11222744.html