Embedded Web Server Transplantation and Testing

Publisher:EtherealGazeLatest update time:2013-11-04 Source: eefocusKeywords:ARM9  S3C2440 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
With the continuous development of computer technology and modern communication technology, the device is the network is the objective requirement for embedded systems in the post-PC era, so it is also necessary to establish a network Web server for embedded devices. Embedded Web can realize remote control in various fields such as industrial monitoring, detection, and automatic control. No matter where in the world, as long as there is an Internet network, various sites can be managed through Web services, and even the site can be controlled and managed on handheld devices with a network. Traditional Web servers are mostly implemented on mainframes and PCs, which are relatively expensive and inconvenient for industrial site application implementation. The emergence of embedded systems and embedded small Web servers provides conditions for Web services to run on embedded devices with limited resources and performance. This article mainly introduces the transplantation of embedded Web server BOA on arm9 embedded system device board, and tests and verifies the transplanted BOA server.

1 Hardware design requirements

According to system requirements, the core processor of the hardware circuit part adopts Samsung's S3C2440. This device is based on the arm920T core and has a main frequency of 400 MHz. It is one of the embedded 32-bit processors with a relatively high cost performance. The S3C2440 microprocessor has rich internal resources, including an LCD controller, SDRAM controller, 4-channel DMA, etc. The storage system of the development board is divided into two parts: SDRAM and Flash. The SDRAM storage system uses two external 32M-byte SDRAM chips with a total of 64M bytes, whose model is HY57V561620FTP. This part is usually called memory. The two SDRAM chips are combined to form a 32-bit wide data bus, which increases the data access speed; the development board has two types of Flash: one is Nor Flash with model SST39VFl60l, which is 2M bytes in size; the other is Nand Flash with model K9F1208, which is 64M bytes in size; the network card chip used in the development board is DM9000, which is adaptive to 10/100M network. The RJ45 connector already contains a coupling coil, so there is no need to connect a network transformer on the development board. The development board can be connected to the Internet network through a network cable to realize embedded Web services. In addition, it also includes power supply, crystal oscillator, JTAG debugging port, and basic input and output ports. The embedded hardware design block diagram is shown in Figure 1.


2 Principle of Embedded Web Server BOA

BOA is a very compact Web server with open source code, excellent performance, and support for CGI general gateway interface technology. It is particularly suitable for use in embedded systems. The main function of the BOA server is to exchange information between interconnected embedded devices, monitor embedded devices through the network, and automatically upload feedback information to the main control device. It is based on the HTTP hypertext transfer protocol, and Web pages are the most basic transmission unit of Web services. The work of embedded Web services is based on the client/server computing model, consisting of a Web browser (client) and a Web server (server), which is also the famous B/S structure. The browser running on the client must first establish a connection with the embedded Web server BOA end and open a socket virtual file. The establishment of this file indicates that the SOCKET connection is successfully established. Then the client browser submits a request to the Web server through the socket SOCKET in the form of GET or POST parameter transmission. After the Web browser submits the request, it is transmitted to the Web server through the HTTP protocol. After receiving the request, the Web server performs transaction processing according to the request, returns an HTML file or calls an external application through CGI, and returns the processing result. The server interacts with external applications and scripts through CGI. According to the method adopted by the client browser when making a request, the server will collect the information provided by the client and send the information to the specified CGI extension program. The CGI extension program processes the information and returns the result to the server. Then the server analyzes the information and sends the result back to the client to display it on the browser.

3 Embedded Web Server BOA Transplantation

First, the Web server BOA is to run on an ARM embedded device, so the BOA source file needs to be cross-compiled. The compilation tool uses the arm-linux-gcc-4.3.2 cross-compilation tool chain. Copy the file arm-lin-ux-gcc-4.3.2. tgz to the directory /tmp, and execute the command cd /tmp; tar zxvfarm-linux-gcc-4.3.2. tgz -C /. In this way, the cross-compilation tool is installed in the /usr/local/arm/4.3.2 directory. To ensure that the cross-compilation tool chain can be directly applied after opening the terminal, it is necessary to create a new directory in /root/. bashrc file, add the compiler path to the system environment variable. Run the command gedit/root/.bashrc to edit the file /root/.bashrc. Add export PATH=$PATH:/usr/local/arm/4.3.2/bin at the end of the file. Save and exit. Then execute the source/root/.bashrc command to make the settings effective. Finally, check whether the cross-compilation tool is installed successfully. The command is to enter arm-linux-gcc-v in the terminal; if you can see the arm-linux-gcc version number 4.3.2 in the output information, it means that the installation is successful.

Secondly, cross-compile BOA source code, copy the BOA source code package boa-0.94.13.tar.gz to the /tmp directory, and decompress the mask package tar zxvf boa-0.94.13.tar.gz; after decompression, enter the directory where BOA is located in the Linux terminal and first execute the command. /con-figure to generate a Makefile file, then open the folder, find the Makefile file, open it with a text editor, find the two lines CC=gcc and CPP=gcc-E, and set them to the cross-compilation tool paths CC=/usr/local/arm/4.3.2/bin/arm-linux-gcc and CPP=/usr/local/arm/4.3.2/bin/arm-linux-gcc-E generated in the previous step, respectively. Then save the Makefile and exit, return to the terminal and execute the make command to cross-compile to get the executable program BOA, which is the executable file that can run on the arm embedded device. You can view the file information through the command fileboa. Copy this BOA file to the target board /bin directory.

Again, configure the boa server. The main purpose of configuring BOA is to enable it to support the execution of CGI programs. Create a BOA directory in the /etc directory of the file system with mkdir boa, copy the boa.conf file in the BOA source directory to the /etc/boa directory of the file system, and then modify it based on this configuration file according to the needs of the embedded BOA. When modifying this configuration file, you need to ensure that other files and settings must be consistent with the configuration file, otherwise the embedded Web server BOA cannot run normally. The main configuration content of the boa.conf file is shown in Figure 2.


4 Embedded Web Server BOA Transplantation Test

The purpose of the test is mainly to verify whether the embedded Web server BOA transplantation and configuration are correct and whether it can work normally. According to the content of the above configuration file boa.conf, create a www directory under the file system directory /var to store HTML documents and image resources required by HTML documents. Create a /www/cgi-bin directory to store CGI programs. [page]

1) Make a Web test page The Web test page is mainly completed by Html language and Javascript script language. Create a new text document and enter the web page code as shown in Figure 3.

Save this file and rename it to index.html. Copy this Html file to the target board /vat/www/ directory. Assume that the development host and the target board are in the same LAN and there is no network failure. The target board IP address is set to 192.168.1.156. Run the browser on the host to perform BOA page test. Enter the IP address 192.168.1.-1 in the browser address bar, and you can see the Web test page as shown in Figure 4.

2) CGI script test Open a terminal on the target board and enter the command
viceshi.cgi to create a new script file and enter the code shown in Figure 5.

:wq Save this script file and copy it to the /var/www/cgi-bin directory, and change the execution permission of this file with chmod+x ceshi.cgi. Then enter the http://192.168.1.156/cgi-bin/ceshi.cgi address in the host (client) browser. After testing, it meets the functional requirements.

5 Conclusion

This paper implements the transplantation of the embedded BOA Web server on the arm9 target board to realize the remote management of microcomputers in various control fields, and passes the post-transplantation test. The successful transplantation of the embedded BOA provides conditions for future applications in specific life and industrial sites, and facilitates the development of future Web application projects.

Keywords:ARM9  S3C2440 Reference address:Embedded Web Server Transplantation and Testing

Previous article:Design of filament power supply for electron beam welding machine based on ARM
Next article:A method for improving the security and stability of UC/OS-II operating system

Recommended ReadingLatest update time:2024-11-16 14:52

1.3.1 Connection of devices with different bit widths
S3C2440 is a 32-bit machine, which means that the unit of memory device operation is 4 bytes (32 data lines). S3C2440 has 8 memory blocks, each block is 128MB (0~26, 27 address lines in total), a total of 1GB. The memory map is as follows. When using S3C2440 memory operation, the CPU sends a read/write signal to the
[Microcontroller]
1.3.1 Connection of devices with different bit widths
Technical Analysis of ARM7 & ARM9 Dual-core Platform
The leading products in the embedded system teaching platform market are based on ARM7 or ARM9 architecture. It is generally believed that ARM7 is a low-end product and ARM9 is a high-end product. There is also a so-called "ARM7 & ARM9 covering high-end & low-end teaching platform". It is advertised that "both sets of
[Microcontroller]
Using ARM9 microprocessor PXA270 chip to realize low power consumption embedded computer
introduction Green environmental protection and energy saving are the global trend, and embedded computer systems are widely used in portable and highly mobile products. Low power consumption design is not only a requirement for green environmental protection, but also a constraint on the volume and quality of embedde
[Microcontroller]
Using ARM9 microprocessor PXA270 chip to realize low power consumption embedded computer
S3C2440 bare metal assembly lights up the LED light
Virtual machine environment: Oracle VM VirtualBox Linux system: ubuntu_14.04.6 Cross-compilation tools: (https://eyun.baidu.com/s/3b1UtLc) All files shared by 100ask 002_JZ2440 Data CD_20180516 (free) Data CD Disk A tools.zip arm-linux-gcc-4.3.2.tar.bz2 gcc-3.4.5-glibc-2.3.6/bin Step 1: View the Schematic O
[Microcontroller]
S3C2440 bare metal assembly lights up the LED light
S3C2440 RTC real-time clock driver configuration and modification under Linux
The support for S3C2440 RTC under Linux is very complete. We only need to make simple modifications to use RTC 1、vi arch/arm/mach-s3c2440/mach-smdk2440.c static struct platform_device *smdk2440_devices __initdata = { &s3c_device_usb, &s3c_device_lcd, &s3c_device_wdt, &s3c_device_i2c0,
[Microcontroller]
s3c2440 bare metal-I2c programming-2.i2c controller
1.The relationship between I2c master control and slave device   For write operations, the master acts as a transmitter and the slave device acts as a receiver. For read operations, the master acts as a receiver and the slave acts as a transmitter. 2.I2c controller 2.1 General block diagram   Pclk = 50Mhz, after div
[Microcontroller]
s3c2440 bare metal-I2c programming-2.i2c controller
Design of media player based on ARM9
1 Introduction   The rapid development of computer multimedia technology and network technology has made multimedia applications based on streaming media also used in many fields, especially in network videophone, remote monitoring, and video on demand. With the maturity of computer multimedia compression technology a
[Power Management]
Design of media player based on ARM9
S3C2440 structure and startup process
The S3C2440 structure is as follows: Boot process: Most ARM chips start from address 0 1. NOR boot, NOR Flash base address is 0, on-chip RAM address is 0x40000000. The CPU reads the first instruction (the first 4 bytes) on the NOR and executes it. The CPU reads other instructions on the NOR and executes them. 2. N
[Microcontroller]
S3C2440 structure and startup process
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号