introduction
With the development of network technology and embedded technology, combining embedded systems with the Internet to monitor and manage system data and images has become one of the important research directions. Embedded Web network sensor technology is a cross-integration of related technologies such as sensors, embedded, distributed information processing and the Internet. It uses the TCP/IP protocol as an embedded application based on intelligent sensors and embeds it into the ROM of existing intelligent servers. Using the built-in Web server in the sensor, users can collect information about remote monitoring objects through a browser.
1 Working Principle of Web Network Sensor Data Acquisition System
Users access data on the Web server through a browser, and display the remotely collected data on an Internet web page in real time. Users need to see data changes in real time, but HTML web pages can usually only be static data, so it is necessary to apply dynamic web page technology on the Web server. The implementation technologies of dynamic web pages include CGI and HTML script embedding technology (such as ASr, PHP, JSP, etc.). Since the network sensor embedded system is implemented by a single-chip microcomputer, its resources are limited, so CGI technology is used to implement dynamic web pages.
1.1 CGI Principles
CGI (Common Gateway Interface) provides a channel for external programs to the Web server, enabling communication between the processor and the browser. CGI is an interface specification that can process data input by the client (usually a browser) and complete interactive operations between the browser and the server. CGI is a program running on the Web server, triggered by the browser's input, and serves as a bridge between the server and other programs in the system. The CGI program is an external program and an executable file running on the server.
The schematic diagram of the working principle of the CGI program is shown in Figure 1.
After the client's web browser browses to a homepage, it submits data in a certain way and sends a request to the web server through the HTTP protocol. The HTTP Daemon on the server side passes the homepage information described to the CGI program specified by the homepage through the standard input (STDIN) and environment variables, and starts this application for processing (including processing of the database). The processing results are returned to the HTTP Daemon through the standard output (STDOUT), and then returned to the client's browser through the HTTP protocol. The browser is responsible for interpreting and executing, and displays the final results to the user.
1.2 Data collection process based on CGI
The data collection process of CGI is shown in Figure 2. When using CGI to collect temperature data from remote sensors, the CGI program can obtain data by directly accessing the hardware or calling the driver. After the data collection is completed, the CGI program organizes the data into an HTTP stream and sends it to the Web server, which is responsible for sending it to the client.
2 Real-time data collection technology
2.1 Implementation method of continuous data acquisition
Since HTTP is based on a request/response model, an interaction between a client and a server begins with a request from the client and ends with a response from the server. However, only one set of data can be obtained from one interaction. So how can we achieve continuous data collection? Generally, there are two methods: client traction and establishing a TCP connection.
Client-side traction is to insert a timed refresh function into the web page. Its order of magnitude is s, which allows users to see the changes in data, but it cannot meet the requirements of strong real-time performance, and some intermediate data will be missed.
Establishing a TCP connection is to enhance the client's functions by embedding ActiveX controls or Java Applets in the web page. Among them, ActiveX controls can only run in the Windows environment, while Java Applets are highly versatile and can achieve cross-platform operations. Therefore, this system uses Java Applet to collect remote data in real time.
2.2 Java Applet
Applet is a small program written in Java, containing visual content, and embedded in Web pages to produce special page effects. It is often used to increase the multimedia effects of Web pages and make them interactive.
When a user visits a web page with a Java Applet, the Applet is downloaded to the user's computer and executed, but the prerequisite is that the user is using a web browser that supports Java. Since the Applet is executed on the user's computer, its execution speed is not limited by the network bandwidth or MODEM access speed, and the user can better view the multimedia effects generated by the Applet on the web page.
Applets must be embedded into a web page using a pair of HTML tags or to run in a browser. In IE, the
3. Implementation of real-time data collection
3.1 Hardware Implementation
The hardware structure of the data acquisition system of the embedded Web network sensor is shown in Figure 3.
ADuC832 is a mixed signal single-chip microcontroller launched by ADI. It is a truly complete data acquisition system chip, which integrates data conversion circuit, microcontroller and flash memory. Its main features are: 8-channel analog I/O, 247 ksps, 12-bit ADC, 2 12-bit (monotonic) voltage output DACs, on-chip temperature sensor; 62 KB on-chip flash/electrically erasable program memory, 4 KB on-chip flash/electrically erasable data memory, 2 304 bytes on-chip data RAM.
The main chip uses the 74LS138 decoder to select the external data memory KM62256 or the network card controller RTL8019AS. The current address is latched by the 74HC573 address latch, so that the state of the output end does not change with the state of the input end. The input state is saved to the output only when there is a latch signal, and it will not change until the next latch signal arrives, which is also to achieve address reuse.
A signal input interface is designed on the main circuit to connect the 4-20 mA signal transmitter at the industrial site; an RJ45 network port is designed, which can be directly connected to the Internet for uploading and sharing field data; RS485 interface and RS232 interface are also designed for data access and processing under special circumstances at the industrial site.
The field sensor transmits the collected 4-20 mA signal to the signal conditioning board, which converts the signal into a 0-2.5 V voltage signal, then converts it into a digital quantity through ADuC832, and then converts it into the corresponding temperature value through the program, and displays the temperature value in real time on a web page embedded with Java Applet.
3.2 Software Implementation
3.2.1 Selection of operating system and protocol stack
In the embedded Web server, μC/OS-II is selected as the embedded real-time operating system. It is a portable, curable, tailorable, preemptive real-time operating system with higher reliability and efficiency than traditional foreground and background programs.
TCP/IP is a protocol cluster, a collection of many open protocols, but the microcontroller is a small microprocessor with limited internal resources, so the protocol must be tailored. This system uses a streamlined small TCP/IP protocol stack - μIP protocol stack. The μIP protocol code includes some basic communication protocols: ARP protocol, IP protocol, ICMP protocol and TCP protocol, UDP protocol, HTTP protocol, Telnet protocol, SMTP protocol, etc. Among them, the four protocols of ARP, IP, ICMP, and TCP can realize the most basic functions of network connection and communication, and can also realize CGI technology. Its application layer is the HTTP protocol, and the collected data is embedded in the web server web page and published to the Internet in the form of a web page.
For the transplantation of μC/OS-II and μIP, please refer to the references. The software structure of the whole system is shown in Figure 4.
3.2.2 Implementation of embedding Java Applet into web page
The embedded Web sensor real-time monitoring program RealtimeMonitor.java is implemented using Applet. The main structure is as follows:
Among them, 192.168.11.30 is the IP address of the embedded Web server, data.txt is the data processed by the processor, and "wly.sleep(1000);" means setting the collection time interval to 1s.
Use the JDK software package to compile the Java program into RealtimeMonitor.class using the command javac RealtimeMonitor.java, and then embed it into an HTML page using "
Finally, add the Monitor.html webpage with embedded Applet to the Web server loaded with μC/OS-II and μIP programs, convert the text of Monitor.html webpage into hexadecimal code, place it in the fsdata.c file of μIP and embed it into the ROM of the processor, compile all programs into HEX files through Keil, and download them to the embedded Web processor.
Open the browser and enter the IP address 192.168.11.30 to access the collected data on the embedded Web server. The real-time data collection results of the network sensor are shown in Figure 5.
Conclusion
This article introduces the working principle of the Web server, embeds CGI and Java Applet technology in the embedded server, and realizes real-time data collection of embedded Web network sensors through the client's browser, saving a lot of hardware resources and human resources, making the automatic collection of remote data more universal. At the same time, it can be suitable for any built-in embedded Web network sensor and has certain practical significance.
Previous article:Example of signal isolator in preventing harmonic interference of frequency converter
Next article:Design of multi-channel and multi-mode low-frequency RFID reader
Recommended ReadingLatest update time:2024-11-16 22:27
- Popular Resources
- Popular amplifiers
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- TI DSP FFT library functions
- See you in April丨The 2021 Munich Shanghai Electronics Show is about to start, and pre-registration is in full swing!
- Live Review: June 28th Datang NXP Semiconductors | Battery Management Chip Solution Design and Precautions
- Dear students, Qorvo 2021 campus recruitment is here, take action now.
- Video tutorial on developing RT-Thread with Bluexun AB32VG1
- Scanning interface for rotary flow meters
- I saw two interesting news this morning: What are the trade-offs in autonomous driving? Is there anything that cannot be changed in the CAN bus?
- Adafruit LED glasses running circuitpython
- Detect and harden against non-invasive tampering attacks
- 128X64 LCD module with Chinese character library