The system composition is shown in Figure 1. Among them, the single-chip microcomputer 77E58 has two serial ports, the serial port O is used for communication with the BENQ23G module, and the BENQ23G is used to send the MMS message; the serial port 1 is used for communication with the serial port camera (such as the C328-JPEG module) to control the camera to capture images. The external sensor alarm interface is used to connect the external alarm sensor. After the 77E58 minimum system receives the external sensor alarm trigger signal, it captures the photo, encapsulates the MMS MMS, controls the BENQ23G module to send the MMS message to the designated mobile phone or remote receiving device, and can also dial the designated phone. The number is passed to the live sound. The MIC and signal amplification circuits are used to capture and amplify external scene sounds.
This article refers to the address: http://
As can be seen from the previous analysis, the system makes full use of the hardware resources of each component, and minimizes the hardware cost. This paper mainly introduces the transmission protocol command format and transmission data format used by the wireless remote monitoring system shown in Figure 1 when sending MMS messages through China Mobile Monternet.
1 Introduction to BENQ23G module BENQ23G is a GSM/GPRS module embedded in TCP/IP protocol produced by BenQ Company of Taiwan. It adds M2M (Machine-to-Maehine) function based on the BENQ23A module, which can be carried over GPRS in BENQ23G module and Internet TCP. The connection is implemented on the /UDP server. The control device and the BENQ23G module are connected via a UART serial port to transfer commands and data.
The control device first sets the network connection parameters through the UART serial port, and then dials the connection GPRS. The BENQ23G module establishes a GPRS connection and establishes a Socket connection with the designated Internet TCP/UDP server. If the Socket connection is successful, the module establishes a point-to-point data connection mode between the control device and the Internet TCP/UDP server through the UART serial port, and the control device can upload the data to the Internet TCP/UDP server through the UART serial port, and at the same time, The UART serial port downloads the data on the Internet TCP/UDP server intact, and the TCP/UDP packaging and unpacking of uploading and downloading data is implemented by the BENQ23G module.
When the control device sends data through the UART serial port in the data mode, if the BENQ23G module does not continue to receive the data of the UART serial port within the specified time interval, the previously received data is TCP/UDP packaged and sent to the server.
When the BENQ23G module continuously receives the three "+" symbols sent by the control module through the UART serial port, it will exit the peer-to-peer data mode and enter the command mode, and can receive the AT command sent by the control device through the UART serial port. However, the TCP/UDP protocol Socket connection between the BENQ23G module and the server is not interrupted. If the control device wants to enter the data mode again to upload data to the server, you can type the ATO command.
The control device can interrupt the Socket connection between the BENQ23G module and the server by typing the ATH command in command mode. An example of a connection between a control device and a MMS gateway server is given below:
This example shows how to connect to a remote server and upload and download data through the BENQ23G module. A detailed description of the BEN command for the BENQ23G module can be found in the references.
The analysis of the MMS composition and coding format is slightly omitted. The detailed coding meanings can be found in the references.
2 Based on BENQ23G sending MMS encoding format analysis When the control device needs to send MMS, firstly transmit the AT command through the UART serial port to complete the corresponding parameter setting (as shown in the previous example), and then transmit the “ATD*97#†command for GPRS dialing, and Wait for the BENQ23G module to complete the Socket connection with the server. When the response "Wait Socket Open" sent by the BENQ23G module is received, it indicates that the BENQ23G module has completed the connection with the server and enters the data mode, and the control device can perform the MMS operation.
2.1 First establish a session connection control device to send a session to establish a connection request (8 bytes):
0001 0A OO OO 12 01 10 OO 00
The first 4 bytes "0A 00 00 12" in the transmit data sequence are WTP In-voke PDUs. WTP Invoke PDUs are in fixed length format and are structured as shown in Table 1.
Among them, CON=0, PDU Type=0001, GTR=0, TTR=1, RID=0, so the first byte is 0A; TID High Byte=00000000, so the second byte is 00; TID Low Byte=00000000 Therefore, the third byte is 00; Version = 00, TIDnew = 0, U / p = 1, RES = 00, TCL = 10, so the fourth byte is 12.
The 5th to 8th bytes "01 10 O000" in the transmission data sequence are WSP protocol data units. The 5th byte "01" is the code for the WSP session connection Connect, and the 6th to 8th bytes are the WSP Connect PDU. The WSP Connect PDU structure is listed in Table 2.
Wherein, the sixth byte "10" is the WSP protocol version number, the upper 4 bits are the integer part of the version number, the lower 4 bits are the fractional part of the version number, here is V1.0; the 7th byte is the capability field length, The capability request is not used, so the length is 00; the 8th byte is the length of the header field, and there is no header, so the length is 00.
The server returns the following data (30 bytes):
0001 12 80 00 02 B5 C5 1 5 00 15 45 6E 63 6F 64 69 6E. . . . . . . . Encodin
0017 67 2D 76 65 72 73 69 6F 6E 00 31 2F 32 00 00 00 g—version. 1.2. . .
The first to third bytes in the returned data are WTP Result PDUs, and the rest are WSP protocol data units. The WTP Result PDU is in fixed length format and its structure is listed in Table 3.
Among them, CON=0, PDU Type=0010, GTR=0, TTR=1, RID=O, so the first byte is 12; TID High Byte=10000000, so the second byte is 80; TID Low Byte=00000000 Therefore, the third byte is OO.
The 4th byte "02" in the returned data is the code of the WSP session connection confirmation ConnectReply; the 5th to 30th bytes are the WSP ConnectReply PDU.
The WSP ConneetReply PDU structure is listed in Table 4.
The 5th to 8th bytes "B5 C5 15" are session identifiers; the 10th byte "15" is HeadersLen (21 bytes), and the Headers are strings ending with 00, that is, Encoding_version 1.2.
2.2 The control device sends a WTP acknowledgment to complete the session. The connection control device sends a WTP acknowledgment (WTP Acknowledgement, 3 bytes): 18 00 00. WTP Acknowledgement PDUs are in fixed length format as listed in Table 5.
Among them, CON=0, PDU Type=0011, Tve/Tok=0, RES=0, RID=0, so the first byte is 18; TID High Byte=00000000, so the second byte is 00; TID Low Byte =00000000, so the third byte is OO.
2.3 The control device sends WTP, WSP and MMS packet control devices to send WTP and WSP (49 bytes) first:
0001 0E 00 01 1 2 60 1A 10 68 74 74 70 3A 2F 2F 6D 6D. . . . . . . Http://mm
0017 73 63 2E 6D 6F 6E 74 6 5 72 6E 65 74 2E 63 6F 6D SC. Monternet. Com
0033 2F BE 80 BE C7 80 A1 09 80 77 61 70 00 77 61 70/. . . . . . . . Wap. Wap
0049 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00. . . . . . . . . . . . . . . .
In the transmit data sequence, the first 4 bytes "0E 00 01 12" are WTPInvoke PDUs, and the last 45 bytes are WSP protocol data units.
WTP Invoke PDUs also use a fixed structure format (as listed in Table 1). Among them, CON=0, PDU Type=0001, GTR=1, TTR=1, RID=0, so the first byte is 0E; TID High Byte=00000000, so the second byte is 00; TID Low Byte=00000001 Therefore, the third byte is 01; Version = 00, TIDnew = 0, U / P = 1, RES = 00, TCL = 10, so the fourth byte is 12.
The fifth byte "60" in the transmission data sequence is the code of the WSP method Post, and the sixth to 49th bytes are the WSP Post PDU. The WSP Post PDU structure is listed in Table 6.
The 6th byte "1A" is UriLen (26 bytes); the 7th byte "10" is HeadersLen (16 bytes); the 8th to 33rd bytes are Uri fields, URI=http:/mmsc. Monternet. Com/(China Mobile Monternet); the 34th byte "BE" is the content type of ContentType (the code of the famous domain value applica-tion/vnd.wap.mms-message), ie Content Type=application/vnd. Wap. Mms-message; the 35th to 49th bytes are Headers field consisting of 3 Headers, the 35th and 36th bytes are the first Header, the 37th and 38th bytes are the 2nd Header, the 39th to 49th bytes It is the 3rd Header.
Headerl: 80 BE (Accept: application/vnd.wap.mms-message).
Header2: C7 80 (Cashe Control: None).
Header3: A1 is the code of the domain Proxy authorization, the 40th byte "09" is the domain length (9 bytes), the 41st byte "80" is the Basic code, and the 42nd to 44th bytes are the User_id=wap The 46th to 48th bytes are Password=wap.
The data field is the MMS packet that is sent immediately.
The server returns the data sequence as follows:
In the returned data, the first to third bytes are WTP Result PDUs, and the rest are WSP protocol data units. The WTP Result PDU format is the same as before, except that TID=8001, which corresponds to TID=0001 in the WTP Invoke PDU.
The 4th byte "04" in the returned data is the code of the WSP session response Reply, and the 5th to 173th bytes are the WSP Reply PDU. The WSP Reply PDU structure is listed in Table 7.
The 5th byte "20" is the Status code, indicating success; the 6th, 7th byte "81 26" is the length of the Headers (A6 after decoding, ie 166 bytes, from the 8th byte "61" to 173 Byte "B1"); the 8th to 38th bytes are the field values ​​of Cont_entType, ContentType=application/vnd. Wap.
Mms-message; 40th to 173th bytes are Headers field consisting of 6 Headers, 40th to 52nd bytes are the first Header, and the 53th to 78th bytes are the 2nd Header, 79th to 111th bytes It is the third Header, the 112th to 143th bytes are the 4th Header, the 144th to 167th bytes are the 5th Header, and the 168th to 173th bytes are the 6th Header.
Header6: Date=48 29 41 EB, date in seconds, starting date is 1970-01-01.
In the returned data, the 174th to 209th bytes are Data fields, and the content thereof corresponds to the MMS header content, and the meaning after decoding is:
2.4 The control device sends a WTP acknowledgment to complete the session control device to send a WTP acknowledgment (WTP Acknowledgement PDU, 3 bytes): 1C 00 01.
The WTP Acknowledgement PDU format is the same as Table 5. Among them, CON=0, PDU Type=0011, Tve/Tok=1, RES=0, RID=0, so the first byte is 1C; TID High Byte=00000000, so the second byte is 00; TID Low Byte =00000001, so the third byte is 01.
2.5 Disconnecting the server If you want to exit the data mode, the control device can transmit the symbol +++ through the UART serial port. The BENQ23G returns to the command mode, but the connection with the server's Socket is not disconnected. If you want to disconnect the Socket connection between BENQ23G and the server, the control device needs to send the ATH command to the BENQ23G module through the UART serial port.
3 Conclusions <br> This article describes a low-cost remote monitoring system that delivers images via MMS. The system uses Winbond's 77E58 microcontroller as the controller, triggered by an external alarm sensor, controls the serial port camera to capture the live image, encapsulates the MMS MMS, and transmits it by controlling BenQ's GSM/GPRS module BENQ23G, and can also dial the preset number. Send the live sound out.
On-Grid Inverter converts DC power to AC power for feeding back to the grid. The frequency of the output voltage of the grid-connected inverter needs to be the same as the grid frequency (50 or 60Hz), which is generally achieved by the oscillator in the machine, and the output voltage will also be limited not to exceed the grid voltage. Modern high-quality grid-connected inverters can have an output power factor of 1, which means that the output voltage and current phases are the same, and the phase difference between them and the grid voltage is within 1 degree. There is a microprocessor in the inverter that can sense the AC waveform of the grid, and according to this waveform, generate voltage and send it back to the grid. However, the electricity sent back to the grid needs to have a certain proportion of reactive power, so that the power of the nearby grid is within the allowable limit. noon) its voltage may rise too high.
If the power of the grid is cut off, the grid-connected inverter needs to be disconnected from the grid quickly. This is a regulation of the National Electrical Code (NEC) in the United States to ensure that when the grid is out of power, the grid-connected inverter will not provide power to the grid, and at this time the workers who maintain the grid will not be electrocuted.
Properly configured, grid-tie inverters allow a home to use alternative energy sources that it generates itself (such as solar or wind power) without cumbersome wiring and without the need for batteries. If there is insufficient alternative energy, the insufficient part will still be provided by electricity from the grid.
Grid-connected inverters are widely used in household photovoltaic power generation systems, commercial and industrial photovoltaic power plants and other scenarios. By connecting to the grid, they help to achieve efficient use of renewable energy and reduce carbon emissions, promoting sustainable development and popularization of clean energy.
on grid solar inverter, micro inverter on grid, 25 kw on grid inverter, on grid power inverter, 15kw on grid inverter
Ningbo Autrends International Trade Co., Ltd. , https://www.china-energystorage.com