SIM800C realizes the AT command of GPRS Internet access

Platform: Notebook + USB to RS232 serial cable + SIM800C module (Unicom SIM card)

Realize that the computer sends AT commands through the serial port debugging assistant, and realizes the use of GPRS communication to send messages to the TCP server.

Here are a few commonly used AT commands and their meanings (note the order):

1. AT+CGDCONT=1,"IP","CMNET"

    Defining PDP Mobile Scenarios

2. AT+CGATT=1

    Activate PDP, get IP address

3. AT+CIPCSGP=1,"CMNET"

    Set the module connection mode to GPRS link mode, and the access point to "CMNET" (same for China Mobile and China Unicom, the same as above)

4. AT+CIPSTATUS

    There are a total of ten states. Only in the three states of IP_INITIAL, IP_CLOSE and IP_STATUS can the connection be established correctly, otherwise an error will be returned.

5. AT+CIPSTART="TCP","b17664507c.51mypc.cn","38149"

    To establish a GPRS connection, b17664507c.51mypc.cn is the domain name of the TCP server (it can be replaced with an IP address here), and 38149 is the port number of the server. Sometimes the connection fails, and you can reconnect several times.

6. AT+CIPSEND

    Send data, enter the data to be transmitted after returning ">", and then send CTRL+Z (or 0x1a in hexadecimal format) to send the data to be sent to the server with the specified IP or domain name.

7. AT+CIPCLOSE

    close the TCP connection

8. AT+CIPSHUT

    close mobile scene

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326925656&siteId=291194637