Share this

Design of an EPA Bluetooth Data Acquisition System Based on EWS

2026-04-06 09:05:47 · · #1
Abstract: This paper addresses the problem of remote access and monitoring in industrial fields based on the EPA protocol. It briefly describes the working principle of an EPA Bluetooth data acquisition system based on the MPU Rabbit 2000, and provides the code framework structure for the software implementation using the MPU's internal TCP/IP protocol stack and Dynamic C development tools. Based on this, an embedded web server is designed for the system. The feasibility of the design is verified through the design of a CCI communication program and its application in the system interface. This design has significant reference value for the application of embedded systems in wireless web access in factory fields. Keywords: EPA, EWS, Rabbit2000, Dynamic C, Embedded Web Server, HTTP Protocol 1 Introduction EPA (Ethernet for Plant Automation) is an industrial control network technology suitable for data communication between industrial automation control system devices and instruments, as well as between industrial automation instruments, based on information network COTS (Commercial-Off-The-Shelf) communication technologies such as Ethernet (IEEE 802.3), Wireless LAN (IEEE 802.11), and Bluetooth (IEEE 802.15) and TCP (UDP)/IP protocols. Bluetooth technology is a short-range wireless communication technology that replaces cables. In industrial settings, some equipment needs to be installed in harsh environments, and Bluetooth technology can avoid the problems associated with cabling. The emergence of embedded web servers meets the need for low-cost remote control in industrial control networks. This paper combines these two technologies to design and develop a Bluetooth data acquisition device that meets the requirements of EPA industrial control networks. Based on embedded web server (EWS) technology and combined with the network communication capabilities of Rabbit2000, it utilizes existing network technologies (such as HTTP, CGI, SSI, etc.) to transmit field data acquired wirelessly via Bluetooth to the server. The server then provides this data to remote users in the form of a webpage. 2. Design of a Bluetooth Data Acquisition System Based on an Embedded Web Server The model of the Bluetooth data acquisition system based on an embedded web server is shown in Figure 1. The Bluetooth data acquisition device is based on the EPA protocol. Remote monitoring users connect to the embedded web server through the enterprise's internal network, control the Bluetooth chip to complete data acquisition, and return the acquired data to the embedded web server, where it is displayed on the web browser of the remote management terminal. 2.1 System Hardware Structure Design The system structure of the Bluetooth data acquisition device based on the EPA protocol is shown in Figure 2. It includes a microprocessor, Bluetooth module, digital-to-analog (D/A) converter module, analog-to-digital (A/D) converter module, LCD module, Flash memory, and Ethernet controller module. The Bluetooth module, D/A converter module, A/D converter module, and LCD module are connected to the microprocessor's serial communication interface via their respective interface circuits. The Bluetooth module uses a serial port baud rate of 57600bps; the microprocessor's main operating frequency is 11.0592MHz, and its slave frequency is 32.768kHz; the Bluetooth module operates at 3.3V, requiring a 5V to 3.3V voltage conversion circuit; chips in Figure 2 without clearly marked power leads require a 5V supply. 2.2 Working Principle ① When the power switch of the Bluetooth data acquisition unit is turned on, the system performs a self-test. ② After the system self-test passes, the Bluetooth data acquisition unit initializes Bluetooth and searches for other field devices with Bluetooth chips within its coverage area. ③ If the above devices are found, their respective link managers will discover each other and can establish a communication relationship after authentication and authorization when necessary. ④ When on-site data acquisition is required, connect the input port of the A/D conversion module to the object being acquired through the peripheral interface circuit. After receiving the start command, the A/D conversion module acquires the on-site data and sends it to the microprocessor for processing. The processed data is sent to the relevant control equipment through the Bluetooth module, or it can be transmitted to the embedded Web server. ⑤ At the same time, the system is also equipped with a D/A conversion output. When analog output is required, the output port of the D/A converter can be connected to the controlled object through the peripheral interface circuit. The program sends the control command to the D/A conversion module. After receiving the control command, the D/A conversion module converts it into an analog signal and transmits it to the field device, so that the field device works according to the control command. 2.3 Overall Software Design The schematic diagram of the Bluetooth data acquisition system software structure based on the EPA protocol is shown in Figure 3. 3 Implementation of Embedded Web Server 3.1 Embedded Web Server Architecture The embedded Web server architecture of this system is shown in Figure 4. The embedded Web server is located between the user and the application system in this system. The embedded Web server must provide several mechanisms to monitor and control the field device, provide and send Web pages to the browser, and process the data submitted by the browser [reference]. One of the challenges in designing an embedded Web server is realizing remote access via a browser using Rabbit2000. This system employs CGI and SSI technologies for this purpose. Another challenge is the development of the embedded communication program. This system uses the Rabbit2000 microprocessor as the control chip and leverages the TCP/IP protocol-supporting communication subroutine library provided by Z-World, enabling rapid development within the Dynamic C integrated development environment. 3.2 Front-end FORM Form Compilation and Interface Design User-submitted command requests are primarily submitted to the CGI program in the form of FORM forms. FORM is a markup language for HTML (Hypertext Markup Language), editable with any text editor, and saved as an .html file for web browser recognition. Data input should ideally use dropdown menus for a user-friendly interface. 3.3 HTTP Protocol Processing Flow The design of HTTP protocol processing is a core part of the embedded Web server system. CGI is a standard for defining the communication method between a Web server and external programs. It can be used as an interface to extend the functionality of a Web server, enabling interaction with users accessing Web pages. Essentially, CGI is a service mechanism. When a user sends a request with a GET or POST command format to an HTTP server through a web browser, the specific steps of the service are as follows: ① The client uses the browser and the TCP/IP protocol to establish a connection with the server and send a URL request; ② The server calls the CGI program stored in the Rabbit2000 chip, using the parameters passed by the client as the parameters of the CGI program; ③ The CGI returns the processing result to the HTTP server in a recognizable format; ④ The HTTP server returns the data to the client for processing and displays the result of the CGI execution through the browser. Figure 5 shows the entire process of the browser and server interacting through the CGI program. Server-Side Attachment (SSI) is a simple dynamic web page generation technology. SSI defines a set of tags that can be embedded in HTML text. Before being sent to the client browser, the web server performs preprocessing. You can think of SSI as a special program embedded in an HTML page. The following is an example of Bluetooth chip initialization in a Bluetooth data acquisition system. The SSI command word is exec, and the parameter is showinitial. The relationship is established with the int show_initial(Http-State*state) function in the CGI function in the main program through the statement {HTTPSPEC_FUNCTION, “showinitial”, 0. show_initial, 0, NULL, NULL} in HttpSpec http_flashspee[]. The result of this function is then displayed in the HTML text.
<1NPUT TYPE="SUB-MIT" VALUE="Initialization"></TD> </TR><TABLE> </FORM><TD> 3.4 Background DynamicC Program Implementation The EPA protocol uses UDP protocol to transmit messages, which does not require authentication and meets the real-time requirements of industrial sites. The main framework code of the UDP message transmission communication program implemented using the DynamicC compilation environment is as follows: htp_init(); init_dateform(); // Set static data init_dynamicwebdata(); // Initialize dynamic web data tcp_reserveport(80); // Mark port 80 as the server side while(1) { tcp_tick(NULL); http_handler(); // Handle HTTP costate { waitfor(udp_peek(&sock, &udi)); tcp_tick(NULL); Handle_Udp(&sock,&udi); } } In the Web server program, write user-defined functions to handle CGI requests sent from the user's browser. In DynamicC, the HTTPSPEC_FILE structure combines dynamic and static web pages, while the HTTPSPEC_FUNCTION structure links user-defined functions to each CGI request. Thus, when a CGI request is triggered and sent to the web server, the server program will find the corresponding function to process it and return the result. {HTTPSPEC_FILE, "/index.html", index_html, NULL, 0, NULL, NULL}, {HTTPSPEC_FUNCTION, "/initial.cgi", 0, initial, 0, NULL, NULL), {HTTPSPEC_FUNCTION, "/setuplink.egi", 0, setuplink, 0, NULL, NULL}, The code for the interface display effect is as follows: var=sspec_addvariable ("getdata2", &getdata[1], PTRl6, "%s", SERVER_HTTP); var=sspec_addfv(form, var); sspec_setfvname(form, var, "Bluetooth address"); sspec_setfvdesc(form, var, "Bluetooth local address"); sspec_setfvlen(form, var, 12); 4 Conclusion This article focuses on the design method and some key issues in the implementation of the EPA Bluetooth data acquisition system based on an embedded Web server. The testing of this system fully demonstrates that it is feasible to develop an embedded web server for a Bluetooth data acquisition system based on the EPA protocol within an embedded system using embedded technology. Remote monitoring and maintenance of industrial control systems based on embedded web servers will effectively reduce monitoring and operation maintenance costs and improve monitoring and operation maintenance efficiency, thus possessing great application prospects and promotional value.
Read next

CATDOLL CATDOLL 115CM Shota Doll Nanako (Customer Photos)

Height: 115cm Male Weight: 19.5kg Shoulder Width: 29cm Bust/Waist/Hip: 57/53/64cm Oral Depth: 3-5cm Vaginal Depth: N/A ...

Articles 2026-02-22