SIM7500 - SIM7600 - SIM7800 Series - TCPIP - Application Note - V3.00
SIM7500 - SIM7600 - SIM7800 Series - TCPIP - Application Note - V3.00
SIM7500 - SIM7600 - SIM7800 Series - TCPIP - Application Note - V3.00
Series_TCPIP_Application
Note
LTE Module
GENERAL NOTES
COPYRIGHT
www.simcom.com 2 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
About Document
Version History
Scope
This document applies to SIM7500 series SIM7600 series and SIM7800 series.
www.simcom.com 3 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
Contents
About Document............................................................................................................ 3
Version History.........................................................................................................................................................3
Scope........................................................................................................................................................................ 3
Contents........................................................................................................................... 4
1 Introduction......................................................................................................... 5
1.1 Purpose of the document...........................................................................................................................5
1.2 Related documents.....................................................................................................................................5
1.3 Conventions and abbreviations................................................................................................................ 5
2 TCPIP Introduction............................................................................................ 6
2.1 Characteristic............................................................................................................................................... 6
2.2 TCPIP Commands Process...................................................................................................................... 7
4 Bearer Configuration........................................................................................ 9
4.1 Start TCPIP Service....................................................................................................................................9
5 TCPIP Examples...............................................................................................11
5.1 TCP Client.................................................................................................................................................. 11
5.1.1 TCP Client Works in Direct Push Mode.................................................................................... 11
5.1.2 TCP Client Works in Buffer Access Mode................................................................................12
5.1.3 TCP Client Works in Transparent Access Mode.....................................................................13
5.2 UDP Client................................................................................................................................................. 14
5.2.1 UDP Client Works in Direct Push Mode................................................................................... 15
5.2.2 UDP Client Works in Buffer Access Mode............................................................................... 16
5.2.3 UDP Client Works in Transparent Access Mode.................................................................... 17
5.3 TCP Server................................................................................................................................................ 18
5.3.1 Transparent Mode........................................................................................................................ 19
5.3.2 Non-Transparent Mode................................................................................................................19
5.4 Extended Information............................................................................................................................... 21
5.4.1 UDP Data Receiving Rules.........................................................................................................21
5.5 Query Connection Status........................................................................................................................ 21
www.simcom.com 4 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
1 Introduction
Based on module AT command manual, this document will introduce TCPIP application process.
Developers could understand and develop application quickly and efficiently based on this document.
Abbreviation Description
TCP Transmission Control Protocol
UDP User Datagram Protocol
www.simcom.com 5 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
2 TCPIP Introduction
TCPIP is used to setup connections between clients and servers, which are used for TCP/UDP clients
communicating with servers.
2.1 Characteristic
TCP connections
Module works as TCP clients. It communicates with TCP servers by TCP connections.
UDP connections
Module works as UDP clients. It communicates with UDP servers.
TCP servers
Module works as TCP servers. It listens TCP clients accept request and communicates with TCP
clients.
www.simcom.com 6 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
www.simcom.com 7 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
Command Description
AT+NETOPEN Start TCPIP Service
AT+NETCLOSE Stop TCPIP Service
AT+CIPOPEN Setup TCP/UDP Client Socket Connections
AT+CIPCLOSE Destroy TCP/UDP Client Socket Connections
AT+CIPSEND Send TCP/UDP Data
AT+CIPRXGET Retrieve TCP/UDP Buffer Data
AT+IPADDR Get IP Address of PDP Context
AT+CIPHEAD Set Length Domain of Reporting Head of Data
AT+CIPSRIP Set IP Domain of Reporting Head of Data
AT+CIPMODE Enable/Disable Transparent Access Mode
AT+CIPSENDMODE Set Reporting Mode of CIPSEND result
AT+CIPTIMEOUT Set Timeout Value of NETOPEN, CIPOPEN and CIPSEND
AT+CIPCCFG Configure Socket Context
AT+SERVERSTART Setup TCP Server Socket Connections
AT+SERVERSTOP Destroy TCP Server Socket Connections
AT+CIPACK Get Statistics Information of Data Communication
AT+CDNSGIP Analysis IP Address from Domain Name
AT+CDNSGHNAME Analysis Domain Name from IP Address
AT+CIPDNSSET Configure DNS Context
For detail information, please refer to SIM7500_SIM7600 Series AT Command Manual document.
www.simcom.com 8 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
4 Bearer Configuration
OK
AT+CSQ
+CSQ: 27,99 //Check RF Signal
OK
AT+CGREG?
+CGREG: 0,1 //Check Status of PS Service
OK
AT+COPS?
+COPS: 0,0,"CHN-UNICOM",7 //Check Information of Operator
OK
AT+CPSI?
+CPSI:
LTE,Online,460-00,0x1816,27593
//Check Information of Network
483,139,EUTRAN-BAND39,38400,
5,5,-88,-868,-578,18
OK
AT+CGDCONT?
+CGDCONT:
1,"IPV4","CMNET","0.0.0.0.0.0.0. //Check Information of PDP Context
0.0.0.0.0.0.0.0.0",0,0,0,0
OK
AT+CGDCONT=1, "IP", "CMNET"
www.simcom.com 9 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
www.simcom.com 10 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
5 TCPIP Examples
5.1 TCP Client
+NETOPEN: 0
// Set up a TCP connection, <link_num> is 1.
AT+CIPOPEN=1,"TCP","117.131.85.139",5253 // Before using AT+CIPOPEN, host should
// activate PDP ontext with AT+NETOPEN first.
OK
+CIPOPEN: 1,0
+CIPSEND: 1,5,5
// send data with changeable length, <CTRL+Z>
AT+CIPSEND=1,
// to end
>HELLOWORLD<CTRL+Z>
OK
+CIPSEND: 1,10,10
www.simcom.com 11 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
+CIPCLOSE: 1,0
+NETOPEN: 0
AT+CIPRXGET=1 // buffer access mode, get data by AT+CIPRXGET
OK
AT+CIPOPEN=1,"TCP","117.131.85.139",5253 // set up a TCP connection, <link_num> is 1
OK
+CIPOPEN: 1,0
+CIPSEND: 1,5,5
OK
AT+CIPRXGET=2,1,5 // get data in ASCII form
+CIPRXGET: 2,1,5,11
data
OK
www.simcom.com 12 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
OK
AT+CIPRXGET=4,1 // read the length of unread data in buffer
+CIPRXGET: 4,1,6
OK
AT+CIPRXGET=2,2 // the connection identified by link_num=2 has not been established
+IP ERROR: No data
ERROR
AT+CIPRXGET=2,1
+CIPRXGET: 2,1,6,0
server
OK
AT+CIPRXGET=4,1 // all the data in buffer has been read, the rest_len is 0.
+CIPRXGET: 4,1,0
OK
+CIPCLOSE: 1,0
+NETOPEN: 0
AT+CIPOPEN=0,"TCP","117.131.85.139",5253 // only <link_num>=0 is allowed to operate with
www.simcom.com 13 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
// transparent mode.
CONNECT 115200
OK
ATO // ATO to enter transparent mode again
CONNECT 115200
HELLO CLIENT
CLOSED
+CIPCLOSE: 0,0
www.simcom.com 14 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
+NETOPEN: 0
// when set a UDP connection, the remote IP
AT+CIPOPEN=1,"UDP",,,5000 // address and port is not necessary, but the local
// port must be specified.
+CIPOPEN: 1,0
OK
>HELLOSERVER
OK <CTRL+Z> // <CTRL+Z> to end
+CIPSEND: 1,11,11
AT+CIPSEND=1,5,"117.131.85.139",5254 // send data with fixed length
>HELLO
OK
+CIPSEND: 1,5,5
OK
www.simcom.com 15 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
+NETOPEN: 0
AT+CIPRXGET=1 // buffer access mode, get data by AT+CIPRXGET
OK
// when set a UDP connection, the remote IP address and
AT+CIPOPEN=1,"UDP",,,5000
// port is not necessary, but the local port must be specified.
+CIPOPEN: 1,0
OK
+CIPSEND: 1,11,11
AT+CIPSEND=1,5,"117.131.85.139",5254 // send data with fixed length
>HELLO
OK
+CIPSEND: 1,5,5
OK
AT+CIPRXGET=2,1,5 // get data in ASCII form
+CIPRXGET: 2,1,5,11
data
www.simcom.com 16 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
OK
AT+CIPRXGET=3,1,5 // get data in hex form
+CIPRXGET: 3,1,5,6
66726F6D20
OK
AT+CIPRXGET=4,1 // read the length of unread data in buffer
+CIPRXGET: 4,1,6
OK
AT+CIPRXGET=2,2 // the connection identified by link_num=2 has not been established
+IP ERROR: No data
ERROR
AT+CIPRXGET=2,1
+CIPRXGET: 2,1,6,0
server
OK
AT+CIPRXGET=4,1 // all the data in buffer has been read, the rest_len is 0.
+CIPRXGET: 4,1,0
OK
+CIPCLOSE: 1,0
www.simcom.com 17 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
+NETOPEN: 0
// only <link_num>=0 is allowed to operate
AT+CIPOPEN=0,"UDP","117.131.85.139",5254,5000
// with transparent mode.
CONNECT 115200
OK
+CIPCLOSE: 0,0
OK
www.simcom.com 18 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
AT+CIPMODE=1
OK
AT+NETOPEN
OK
+NETOPEN: 0
// only <server_index>=0 is allowed to operate with
AT+SERVERSTART=8080, 0
// transparent mode.
OK
CLOSED
+CIPCLOSE: 0,0
AT+SERVERSTOP=0 // close server socket
+SERVERSTOP: 0,0
OK
+NETOPEN: 0,0
AT+SERVERSTART=8080,0
OK
AT+SERVERSTART=9090,1
OK
AT+SERVERSTART=7070,2
OK
AT+SERVERSTART=6060,3
www.simcom.com 19 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
OK
OK
AT+CIPSEND=0,5 // only supports fixed-length to send
>HELLO
OK
+CIPSEND: 0,5,5
AT+CIPCLOSE=0
OK
+CIPCLOSE: 0,0
AT+SERVERSTOP=0
+SERVERSTOP: 0,0
OK
AT+SERVERSTOP=1
+SERVERSTOP: 1,0
OK
AT+SERVERSTOP=2
+SERVERSTOP: 2,0
OK
AT+SERVERSTOP=3
www.simcom.com 20 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
+SERVERSTOP: 3,0
OK
AT+NETCLOSE
OK
+NETCLOSE: 0
One UDP connection could handle no more 1500 Bytes with once receiving. Please make sure that UDP
server sends acceptable data packets, whose length is greater than 0 and less than 1500 Bytes.
+CIPOPEN: 1,0
AT+CIPOPEN? // query the current state of all sockets
+CIPOPEN: 0
+CIPOPEN: 1,"TCP","117.131.85.139",5253,-1
+CIPOPEN: 2
+CIPOPEN: 3
+CIPOPEN: 4
+CIPOPEN: 5
+CIPOPEN: 6
+CIPOPEN: 7
+CIPOPEN: 8
+CIPOPEN: 9
OK
AT+CIPCLOSE?
+CIPCLOSE: 0,1,0,0,0,0,0,0,0,0
OK
AT+CIPCLOSE=1
www.simcom.com 21 / 22
SIM7500_SIM7600_SIM7800 Series_TCPIP_Application Note_V3.00
OK
+CIPCLOSE: 1,0
AT+CIPCLOSE?
+CIPCLOSE: 0,0,0,0,0,0,0,0,0,0
OK
www.simcom.com 22 / 22