Application of Huijin GPRS/CDMA module in Remote Control System
(Application field: Water Treatment/Environmental Protection)
Abstract: With the development and popularization of WEB and GPRS technologies, the application of GPRS has gradually become a research hotspot in the field of monitoring. Taking GR47 module that supports TCP/IP protocol as an example, this paper outlines the implementation method of remote control through GPRS, and explains how to use AT command to communicate with GR47 module, this paper proposes the idea of using B/S (Browser/Server) architecture for monitoring, and provides steps and application examples for testing B/S.
Key words: GPRS; B/S architecture; remote control; GR47; AT command
Graph classification: TP391 document identification code:
Application Research of GPRS in remote monitoring system
Abstract With the continuous development and generalization of WEB technology and GPRS communication technology, The application of GPRS has increasingly been the research focus in the field of monitoring system. for the example of GR47 module, the realization method of the remote monitoring system through GPRS is first introduced, and how to communicate with the GPRS module by using AT commands is explained. the structure of Browse/Server and a application example are exposed in the article.
Key words GPRS; B/S; gr47; remote monitoring system; at commands
0
In the past, the remote control system generally used public telephone networks to implement monitoring through MODEM dialing and corresponding software. Its obvious disadvantage is that it can only communicate after dialing and cannot "Point-to-multiple" communicate at the same time. Other methods for remote communication are satellite, microwave, optical fiber, or radio. This method is not only costly for devices, but also costly for procurement and operation and maintenance. The GPRS Remote Control System Based on B/S architecture not only has the maintainability, scalability and security of the B/S (Browse/Server) architecture, but also has all the advantages of GPRS communication.
General Packet Radio Service (GPRS) is short for universal grouping wireless services. It is a data transmission mode developed based on GSM. GPRS-based Remote Control has the following features:
(1) Fast login, always online, wide coverage
(2) High Security: The system adds an encryption mechanism to the data transmission process, and data can be transmitted securely on the public network;
(3) high reliability. The system has a mechanism of error correction and re-transmission to ensure data integrity and correctness. Secondly, the system has the automatic recovery function. When the GPRS network is unstable, the system can work stably without manual intervention;
(4) multi-user service reuse. Different network users share the same group of GPRS channels, but only when a user needs to send or receive data will the channel resources be occupied. The system relies on the corresponding software to flexibly implement points at the same time ~ Point, point ~ Multi-point data transmission;
(5) power-saving function, the device can be in the STANDBY state during the time when no data is sent, and the timed or data triggers logon to the network.
At present, China Mobile's GPRS Service is becoming increasingly mature, and users can further reduce the cost of GPRS communication by monthly rent, monthly subscription, and other forms as needed. Therefore, GPRS, as a networking method for large-scale development at present and in the future, is distributed, distributed, networked, and open, it will be widely used in industrial control, environmental protection, water conservancy and hydrological monitoring, alarm and other industries.
1. GPRS Remote Control System
The GPRS remote control system consists of intelligent controllers, GPRS communication modules, China Mobile Communication Network (GPRS network), Internet public network, data servers, enterprise LAN and computer devices.
First, the intelligent controller collects field parameters, encrypts and compresses the data, and then connects the data to the GPRS communication module in serial form in the form of data streams to communicate with the China Mobile Base Station, the SGSN of the base station communicates with the GGSN of the gateway node, and the GGSN processes the group data accordingly. The GR47 module sends data to China Mobile's internal network (CMNET) through the GPRS network in the form of a GPRS data package, and then China Mobile sends the data to the Internet through the GPRS Service Node (GSN, find a server with a specified IP address on the Internet. Because the GPRS network is based on IP address addressing, Internet data servers on the public network only need to access the Internet and have the IP address allocated by the public network. The data server uses WINSOCK programming to send and receive network data and forward it to the internal network database. Databases facilitate data maintenance and WEB Server calls. The system can also implement reverse transmission of data and commands to achieve remote control. The workstation can access the WEB server over the Internet to view the detailed information of each monitoring point.
The GPRS-based remote control system relies on the mobile communication network. After Field Parameter collection, you only need to develop the communication program of the GPRS terminal and related software on the server, you only need to run the browser for remote control.
2. Implementation of GPRS Remote Terminal
Currently, the GPRS module mainly includes Sony Ericsson's GR47/48 module, Siemens MC35 series module, and WAVCOM's M1206B module. Among them, Sony Ericsson's GR47 module contains the complete TCP/IP protocol, you can directly use the corresponding AT command for development, the following uses Sony Ericsson's GP47 module as an example to introduce GPRS communication.
The gp47 module of Sony Ericsson uses a 32-bit real-time CPU operating system and has a built-in TCP/TP protocol stack. It allows a TCP/UDP transmission mechanism to be used with minimal preliminary configuration and operations. Its embedded controller facilitates integration with customers' applications and reduces the need for external controllers. R47 supports dual-band GSM bandwidth of 900 MHz/1800 MHz. It can send or receive data through SMS Short Message Service, CSD, HSCSD or GPRS, and can process voice and fax. Its TCP/IP protocol stack can also be accessed through AT commands or embedded applications.
The hardware diagram of the GPRS Remote Terminal:
The GPRS remote terminal consists of an intelligent controller and a GPRS module. First, sensors collect industrial field parameters, and intelligent controllers analyze and process the collected data. On the one hand, they are displayed on the site, and on the other hand, they are sent to the GPRS module to control the operations of the GPRS module, this includes starting and disabling services, establishing and closing connections, converting data and command modes, and sending encrypted and fault-tolerant data to the data server in data mode.
The communication protocol between the intelligent controller and the GPRS module is a serial port protocol. The intelligent controller can be a single-chip microcomputer system or a PLC. If it is a single-chip microcomputer system, it can be combined with an embedded operating system, developed a monitoring site that has its own web service and can upgrade firmware online. If it is a PLC, there are two methods, one is through RS instructions; the other is to use the 232 module, the PLC only needs to read and write the specified buffer zone of the 232 module. Each command starts with "at +" and ends with a carriage return. If each command is successfully executed, a corresponding response is returned. Some other unexpected information (such as dialing in or line without signal) will be prompted by the module.
The smart controller sets the GPRS module through the serial port. The setting instructions before establishing the data channel include:
At + cgdcont = 1, "ip", "cmnet"
(Initialize network sessions, and create a data account in the module to connect to China Mobile GPRS network.
Return: OK
At * e2ipa = Note: IP connection on the current session
Return: OK
At * e2ipo = 1, "218.79.163.201", 5000
Initialize a TCP connection. 218.79.163.201 is the Server IP address.
Return: connect indicates that the connection is established successfully.
After the connection is established, gr47 enters the data status, and the smart controller can send and receive data. To disable the data state, set the DTr level in the 232 interface to low. After gr47 returns OK, gr47 enters the command state, in this status, you can disable the socket connection by sending "at * e2ipa = 0, 1. In data mode, the intelligent controller must determine the commands issued by the server, including general commands and intelligent operation commands for remote terminals, identifies and processes configuration and operation commands.
3 B/S architecture of Remote Control System
The B/S application system can be divided into three layers: Interaction layer, business layer, and database layer, the interaction layer includes not only how interfaces are organized and laid out, but also how function modules are integrated and operation processes are arranged. The business layer integrates specific application work, and the database layer is responsible for data operations. The B/s application system does not need to upgrade a large number of client software as efficiently as the server and client modes, and is convenient to implement user-friendly and convenient operation interfaces in the browser. To meet users' frequent software system upgrade requirements and save time and cost for software maintenance, we adopt the B/S architecture in this remote control system.
3. 1 server side:
In the GPRS-based remote control system, the data server sends and receives data from and from the GPRS terminal by using Socket characters based on TCP/IP protocol, the developed software runs on the server to process the data and then update it to the SQL database. If it is a Windows system, the IIS (Internet Information Server) application is started. If it is a Linux system, then, start the internet service so that legal users can view information in the browser at any time and anywhere. The Browser allows you to view the information that the remote device has just updated to the database over the Internet. This allows you to analyze and display on-site data.
Workflow:
3.2 Browser:
The browser does not need special software. The system's built-in Internet Access software can access the WEB interface on the server. This is conducive to mobile office. The browser technology, which is increasingly popular in JAVA technology, has been used to implement powerful functions that originally required complex specialized software, saving development costs. Using a browser as a software interface not only makes it easy to unify various application systems, but also facilitates remote maintenance services and customer use. If a controller with embedded WEB services is designed based on the GPRS remote Smart terminal, the remote terminal can be directly accessed through a browser, however, the transformation of Remote Terminal devices is more difficult than using GR47.
4 B/S communication test of GPRS monitoring system
Test method:
1. First, you need to insert the SIM card (disconnect the power supply when inserting the card), connect the antenna, and connect the GPRS module to the computer serial port using the RS232 serial cable. Power on the GPRS module. When the signal indicator starts to flash, it indicates that the module has been started and the GSM network is successfully registered.
2. the GPRS device is powered on. After self-check, the device enters the command mode and the indicator light is displayed as normal.
3. the GPRS module can be set through a third-party software or through a Super Terminal for testing. The AT command AT + CGDCONT = 1, "IP", "CMNET ", if any data is displayed, press enter and Return OK. The hardware connection is correct. It can also be tested using the PC software provided by the GPRS module.
4. Start the application server SOCKET. Assume that the server IP address is 218.79.163.201 and the port is 5000.
5. Use AT * E2IPO = 1, "218.79.163.201", 5000 to set the IP address and port number of the data server. If you return CONNECT after the carriage return, the connection is established successfully.
6. The server uses software compiled by WINSOCK to send and receive data. The GPRS end uses a Super Terminal to simulate remote devices to send and receive data.
7. The server runs the server application, starts the IIS service, saves the data sent by GPRS to the SQL database, and displays the data on the WEB page.
8. The client starts the browser to view and modify the database content on the server.
5. Application Instances
A Remote Control System for waste water outlet Based on PLC and GPRS is provided. Wastewater sewage port remote control system mainly includes FX1N-24MR model PLC, gr47 as the core of the GPRS module, "black box" collector. The "black box" transmits data to the server every five seconds through GPRS and is saved by the server through real-time databases and historical databases. When the server detects the alert information, it immediately sends an alert to the specified mobile phone or workstation computer by short message or email. You can use a browser to display the detailed information of an alarm enterprise and send a Chinese voice alarm. The browser can also remotely control the output interface of 24 full points every day to control samples such as TOC and sewage outlet facilities. You can also directly start devices such as TOC and sampling instruments, or start other devices. In addition to Real-time Monitoring, Web software design also provides functions such as historical data query, report, statistics, trend analysis, and printing.
6 conclusion
The GPRS-based remote control system introduced in this article mainly describes the implementation process of the entire system, on-site programming for customer applications and programming for computer application software. However, from the perspective of the developed GPRS application in monitoring, promoting the use of excellent GPRS modules and the combination of the Internet and industrial control can serve as a reference for readers in the industry: using GPRS technology and B/S architecture, we can monitor the information of environmental protection and water, electricity, coal, heat, and intersection information signs on any network interface.