SIM7020 Series - TCPIP - Application Note - V1.04
SIM7020 Series - TCPIP - Application Note - V1.04
TCPIP_Application Note
LPWA Module
GENERAL NOTES
COPYRIGHT
www.simcom.com 2 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
About Document
Version History
Scope
www.simcom.com 3 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
Contents
Contents ................................................................................................................................. 4
1 Introduction ...................................................................................................................... 6
1.1 Purpose of the document ............................................................................................................ 6
1.2 Related documents ..................................................................................................................... 6
1.3 Conventions and abbreviations ................................................................................................... 6
www.simcom.com 4 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
www.simcom.com 5 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
1 Introduction
Based on module AT command manual, this document will give an entire and complete concept and TCPIP
architecture introduction.
Developers could understand and develop application quickly and efficiently based on this Document.
In application, controlling device controls the GSM engine by sending AT Command via its serial interface.
The controlling device at the other end of the serial line is referred to as following term:
TE (Terminal Equipment);
DTE (Data Terminal Equipment) or plainly "the application" which is running on an embedded system;
www.simcom.com 6 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
Command Description
AT+CSOC Create a TCP/UDP socket
AT+CSOCON Connect socket to remote address and port
AT+CSOB Bind local address and local port
AT+CSOLIS Open Listening Function of the Server
AT+RETENTION Retention of socket scence
AT+CSOSEND Send data to remote via socket
AT+CSODSEND Send data to remote via socket with data mode
AT+CSOCL Close socket
AT+CSOSENDFLAG Set TCP send flag
AT+CSORCVFLAG Set receive flag
AT+CSOSTATUS Get socket status
AT+CSOACK Query previous connection data transmitting state
AT+CSOALIVE Set TCP keepalive parameters
AT+CSORXGET Get Data from Network Manually
+CSONMI Socket message arrived indicator
+CSOERR Socket error indicator
Serials
Command Description
AT+CIPMUX Start up multi-IP connection
AT+CIPSTART Start up TCP or UDP connection
AT+CIPSEND Send data through TCP or UDP connection
AT+CIPQSEND Select data transmitting mode
AT+CIPACK Query previous connection data transmitting state
AT+CIPCLOSE Close TCP or UDP connection
AT+CIPSHUT Deactivate GPRS PDP context
www.simcom.com 7 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
www.simcom.com 8 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
3 Bearer Configuration
AT+CPIN?
//Check SIM card status
+CPIN:READY
OK
AT+CSQ //Check RF signal
+CSQ: 20,0
OK
AT+CGREG?
//Check PS service
+CGREG: 0,1
OK
AT+CGACT? //Activated automatically
+CGACT: 1,1
OK
AT+COPS? Check operator info
+COPS: 0,0,"CHN-UNICOM",9 CHN-UNICOM is operator’s name9 is NB-IOT
network
OK
AT+CGCONTRDP
+CGCONTRDP: //Get APN and IP address from network
1,5,"shnbiot","10.250.0.213.255.255.255.0"
OK
www.simcom.com 9 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
AT+CFUN=0
//Disable RF
+CPIN: NOT READY
OK
AT*MCGDEFCONT="IP","3GNET" //Configure new APN
OK
AT+CFUN=1 //Enable RF
OK
+CPIN: READY
AT+CGREG? //Inquiry PS service
+CGREG: 0,1
OK
AT+CGCONTRDP
//Attached PS domain and got IP address
+CGCONTRDP:
automatically
1,5,"3GNET","10.250.0.253.255.255.255.0"
OK
www.simcom.com 10 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
+CDNSGIP:
1,"www.baidu.com","111.13.100.92"
4.2 PING
//example of ping
AT+CIPPING="61.135.169.121" //Ping this IP address
OK
+CIPPING: 1,61.135.169.121,11,52
+CIPPING: 2,61.135.169.121,2,52
+CIPPING: 3,61.135.169.121,3,52
+CIPPING: 4,61.135.169.121,2,52
www.simcom.com 11 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
5 TCPIP Connection
SIM7020 TCPIP supports multi-client and one-way TCP server architecture, and supports six-way sockets,
including TCP or UDP.
id=0
id=1
SIM7020
id=2
Cellular
Network Server
id=3
TCPIP
id=4
id=5
AT+CSOC=1,1,1
+CSOC: 0
//Created one TCP socket, <socket_id>=0
OK
AT+CSOCON=0,5245,"116.247.119.165"
//Connected remote TCP server
OK
AT+CSOSEND=0,0,”Hello World”
//Send TCP data out
OK
AT+CSOCL=0 //Close socket
www.simcom.com 12 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
OK
OK
AT+CSOCON=0,5246,"116.247.119.165" //Connected remote UDP peer
OK
AT+CSOSEND=0,0,”Hello World” //Send UDP data out
OK
AT+CSOCL=0 //Close socket
OK
SIM7020 series of module can act as TCP server. Users should use the command “AT+CSOC” to create
one socket for server listening, then use the command “AT+CSOB” to bind a local port and the local IP
address, which will be the server IP address and port for connection from client. After successfully binding
IP address and port, users should use the command “AT+CSOLIS” to open the server listening function. At
this point, the server is established successfully, waiting for one client to connect.
OK
AT+CSOB=0,5678,”10.78.103.220” //Bind local port and local IP address
OK
AT+CSOLIS=0 //Open the server listening function,the listening
OK port is 5678
+NEW CLIENT CONNEC: 1 //Remote client access
www.simcom.com 13 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
OK
AT+CSOCON=0,5555,"112.74.93.163" //Bind local port and local IP address
OK
AT+CSORXGET=1 //Enable getting data from network manually
+CSORXGET: 1,0
AT+CSORXGET=2,0,1000
//The module can get data, but the length of output
+CSORXGET: 2,0,1000,700 data does not exceed 1460 bytes at a time.
f111111111222222222222222333333333333333
333333333444444444444411111111122222222
222222233333333333333333333333344444444
444441111111112222222222222223333333333
333333333333334444444444444111111111222
222222222222333333333333333333333333444
444444444411111111122222222222222233333
333333333333333333344444444444441111111
112222222222222223333333333333333333333
334444444444444111111111222222222222222
333333333333333333333333444444444444411
111111122222222222222233333333333333333
333333344444444444441111111112222222222
222223333333333333333333333334444444444
444111111111222222222222222333333333333
333333333333444444444444411111111122222
222222222233333333333333333333333344444
444444441111111112222222222222223333333
333333333333333334444444444444111111111
222222222222222333333333333333333333333
444444444444411111111122222222222222233
333333333333333333333344444444444441111
111112222222222222223333333333333333333
333334444444444444111111111222222222222
www.simcom.com 14 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
222333333333333333333333333444444444444
411111111122222222222222
OK
AT+CSORXGET=3,0,700
+CSORXGET: 3,0,700,0
323333333333333333333333333333333333333
333333333333434343434343434343434343431
313131313131313132323232323232323232323
232323233333333333333333333333333333333
333333333333333334343434343434343434343
434313131313131313131323232323232323232
323232323232333333333333333333333333333
333333333333333333333343434343434343434
343434343131313131313131313232323232323
232323232323232323333333333333333333333
333333333333333333333333333434343434343
434343434343431313131313131313132323232
323232323232323232323233333333333333333 //The module can get data, but in HEX mode,
333333333333333333333333333333334343434
343434343434343434313131313131313131323 module can get 730 bytes maximum at a time.
232323232323232323232323232333333333333
333333333333333333333333333333333333343
434343434343434343434343131313131313131
313232323232323232323232323232323333333
333333333333333333333333333333333333333
333434343434343434343434343461616161616
161616161616161616161616161616161616161
616161626262626262626262626262626262626
263663131313131313131313232323232323232
323232323232323333333333333333333333333
333333333333333333333333434343434343434
343434343431313131313131313132323232323
232323232323232323233333333333333333333
333333333333333333333333333334343434343
434343434343434313131313131313131323232
323232323232323232323232333333333333333
333333333333333333333333333333333343434
343434343434343434343131313131313131313
232323232323232323232323232323333333333
333333333333333333333333333333333333333
43434343434343434343434343131313131
OK
AT+CSORXGET=3,0,700 //Get data completely
+CSORXGET: 3,0,0,0
OK
AT+CSOCL=0 //Close socket 0
www.simcom.com 15 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
OK
OK
AT+CSOC=1,2,1 //Created one UDP socket, <socket_id>=1
+CSOC: 1
OK
AT+CSOCON=0,5245,"116.247.119.165" //Connected remote TCP server
OK
AT+CSOCON=1,5246,"116.247.119.165" //Connected remote UDP peer
OK
AT+CSOSEND=0,0,”Hello World” //Send TCP data out
OK
AT+CSOSEND=1,10,”3132333435” //Send UDP data
OK
AT+CSOCL=0 //Close socket 0
OK
AT+CSOCL=1 //Close socket 1
OK
Command AT+CSOSEND=<socket_id>,<len>,<data> supports both Hex and Ascii code message. If <data>
is pure hex, the <len> parameter must be configured correct bytes and must be even number.
Also Incoming message from remote socket are printed in Hex code.
www.simcom.com 16 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
OK
AT+CSOSENDFLAG=1 //Configure TCP ACK report
OK
AT+CSOCON=0,5245,"116.247.119.165" //Connected remote TCP server
OK
AT+CSOSEND=0,0,”Hello World” //Send TCP data out, 11 bytes had been sent out
OK successfully.
SEND: 0,11
AT+CSOCL=0 //Close socket
OK
After UDP connection is established, if user want to continue to use this connection when module is waked
from PSM mode, the command AT+RETENTION should be set to 1.
OK
www.simcom.com 17 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
Code Description
-1 Common error
1 Route error (host unreachable)
2 Connection abort error
3 Connection Reset error
4 Connected error
5 Illegal error
6 Buffer error
7 Block error
8 Address in use error
9 Already connecting error
10 Already connected error
11 Bearer error
www.simcom.com 18 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
Power On
Delay 10s
AT+CPIN
>3 Retry
Ready? AT+CFUN=
0
AT+CS 5s
>3 Retry
AT+CFUN=
+CSQ:X 1 Standby
x>5
AT+CGRE
>3 Retry Finish
AT+CSOSC
X !=1or
eate
+CGREG:
Re-cr
X=1 or 5
AT+CSOSE
AT+CGPAD
www.simcom.com 19 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
SIM7020 TCPIP supports multi-client and one-way TCP server architecture, and supports six-way sockets,
including TCP or UDP.
id=0
id=1
SIM7020
id=2
Cellular
Network Server
id=3
TCPIP
id=4
id=5
www.simcom.com 20 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
AT+CIPSEND
> hello TCP serve
//Remote server receives data. For TCP, “SEND OK” means
SEND OK
data has been sent out and received successfully by the remote
server
hello SIM7020 //Received data from remote server
CLOSED //Remote server closed the connection
www.simcom.com 21 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
In UDP extended mode, SIM7020 series can receive UDP data from any IP address and port, meanwhile it
can send UDP data to any IP address and port.
OK
AT+CIPSEND //Send data to 116.228.221.51: 9600
> Hello 9600
SEND OK
RECVFROM: 116.228.221.51:9600 //Receiving data from 116.228.221.51:9600
+IPD,5:test1
AT+CIPUDPMODE=2,"116.228.221.5 //Re-set UDP port to be sent data to.
1",1234
OK
AT+CIPSEND
//Send data to 116.228.221.51: 1234
> Hello 1234
SEND OK
RECV FROM: 116.228.221.51:1234 //Receiving data from 116.228.221.51: 1234
+IPD,5:test2
AT+CIPUDPMODE=2,"10.78.103.220 //Re-set UDP address and port to be sent data to.
www.simcom.com 22 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
",5678
OK
AT+CIPSEND //Send data to 10.78.103.220:5678
> Hello 5678
SEND OK
RECV FROM: 10.78.103.220: 5678 //Receiving data from 10.78.103.220: 5678
+IPD,5:test3
AT+CIPUDPMODE=2,"211.136.131.6 //Re-set UDP address to be sent data to.
5",4500
OK
AT+CIPUDPMODE?
//The destination UDP address has been Updated, and UDP
+CIPUDPMODE:
extended mode is still on.
1,"211.136.131.65",4500
OK
AT+CIPSEND //Send data to 211.136.131.65:4500
>Hello 4500
SEND OK
In single connection mode, when configured as TCP server, SIM7020 series allows one client to connect in.
User should use the command “AT+CIPSERVER=1,”<port>” to start the server function and set listening
port. If it is successful, response “SERVER OK” will be returned, and now the server starts to listen to the
TCP port. And then, user should use command “AT+CIFSR” to get local IP address, which is the server IP
address.
If the client connects to the server successfully, the IP address of remote client will be displayed at server
side. And the server can receive TCP data from remote side. Also user can use command AT+CIPSEND to
send data to remote client. User can use “AT+CIPSERVER=0” to close the listening status. Also, user can
use AT+CIPCLOSE to close the TCP connection.
OK
AT+CIPSERVER=1,1234 //Start the TCP server, listening port:1234
OK
www.simcom.com 23 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
Being a client, SIM7020 series can establish both TCP and UDP connection to remote server. Total 6
connections are supported. The command “AT+CIPSTART=<n>,<mode>,<IP Address>,<port> “is needed.
When the connection is established successfully, “<n>, CONNECT OK” will be returned. And then user can
use command AT+CIPSNED=<n> to send data to the connection <n>. User should write data after the
promoting mark “>” and use CTRL+Z (0x1a) to send. If sending is successfully, “<n>, SEND OK” will be
returned.
www.simcom.com 24 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
0,CONNECT OK
AT+CIPSTART=1,”UDP”,”116.228.2 //Establish a UDP connection, connection number 1
21.51”,“9600”
OK
1,CONNECT OK
AT+CIPSEND=0 //Send data to connection 0
>TCP test
0,SEND OK
AT+CIPSEND=1 //Send data to connection 1
>UDP test
1,SEND OK
+RECEIVE,0,16: //Received data from connection 0, data length 16
SIM7020 TCP test
+RECEIVE,1,16: //Received data from connection 1, data length 16
SIM7020UDP test
AT+CIPSTATUS //Query the current connection status
OK
STATE: IP PROCESSING
C:
0,0,"TCP","116.228.221.51","8500",
"CONNECTED"
C:1,0,"UDP","116.228.221.51","960
0","CONNECTED"
C: 2,,"","","","INITIAL"
C: 3,,"","","","INITIAL"
C: 4,,"","","","INITIAL"
C: 5,,"","","","INITIAL"
Being a TCP server, SIM7020 series allows remote clients to connect in; meanwhile, it can establish
TCP/UDP connections to remote servers as well.
Before launching the server function, command group “AT+CSTT, AT+CIICR, AT+CIFSR” should be
executed to activate the PDP context and get local IP address. Then user can send command
“AT+CIPSERVER=1, <port>” to start the server function. If it is successfully, response “SERVER OK” will
be returned, and now the server starts to listen to the TCP port.
If the clients connect to the server successfully, the IP addresses of remote clients together with connection
numbers <n> will be displayed at server side. Then the server can receive TCP data from remote clients.
Also user can use command AT+CIPSEND=<n> to send data to remote client <n>. Simultaneously, user
can connect the server SIM800 series to remote servers by TCP/UDP using command
www.simcom.com 25 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
SERVER OK
//Remote client connect in, connection number 0
0,REMOTE IP: 10.76.40.73
allocated
+RECEIVE,0,26: //Received data from remote client, data length 26
connection TCP server test
AT+CIPSEND=0 //Send data to remote client
>TCP test
0,SEND OK
AT+CIPSTART=1,”TCP”,”116.228.221.51 //Establish TCP connection to remote server
”,”8500”
OK
1,CONNECT OK
AT+CIPSTART=2,”UDP”,”116.228.221.51 //Establish UDP connection to remote server
”,”9600”
OK
2,CONNECT OK
AT+CIPCLOSE=2 //Close the UDP connection with remote server
2,CLOSE OK
AT+CIPSTATUS //Query current connection status
OK
STATE: IP PROCESSING
S: 0,0,"8888","LISTENING"
C:
0,0,"TCP","10.76.40.73","2020","CONNE
CTED"
www.simcom.com 26 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
C:
1,0,"TCP","116.228.221.51","8500","CO
NNECTED"
C:
2,0,"UDP","116.228.221.51","9600","CL
OSED"
C: 3,,"","","","INITIAL"
C: 4,,"","","","INITIAL"
C: 5,,"","","","INITIAL"
AT+CIPSERVER=0 //Close server listening
OK
SERVER CLOSE
AT+CIPSHUT //Deactivate the PDP context &close all connections
SHUT OK
CONNECT OK
AT+CIPSNED //Send data
www.simcom.com 27 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
SIM7020 series provides 3 ways to send data: changeable data length sending, fixed data length sending
and timed sending. SIM7020 series also provides a method to let user know how much data is sent out from
the module and received by remote server on an active TCP connection.
SIM7020 series provides 3 ways to send data: changeable data length sending, fixed data length sending
and timed sending. SIM7020 series also provides a method to let user know how much data is sent out from
the module and received by remote server on an active TCP connection.
User can send the fixed length of data with “AT+CIPSEND=<LENGTH>”, then input data after getting
promoting mark “>”. Data will be sent automatically when the length of the input data equals to the value
“LENGTH”. User does not need the terminal symbol CTRL+Z (0x1a) in this case. For multi connection
mode, the command is “AT+CIPSEND=<n>,<LENGTH>”.
Single connection:
www.simcom.com 28 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
OK
AT+CIPSEND //Data has been sent, not sure whether to be
>hello accepted
DATA ACCEPT: 5
Multi connection:
0,CONNECT OK
AT+CIPQSEND=1 //Enable quick sending mode
OK
AT+CIPSEND=0
//Data has been sent, not sure whether to be
> 1234567890
accepted
DATA ACCEPT: 0,10
The command “AT+CIPACK” is used to query previous connection data transmitting state. In single
connection, the execution command “AT+CIPACK” will return “+CIPACK: <txlen>,<acklen>, <nacklen>”.
---- The 1st parameter <txlen> is the data amount which has been sent;
---- The 2nd parameter <acklen> is the data amount confirmed successfully by the server;
---- The 3rd parameter <nacklen> is the data amount without confirmed by the server.
As long as the connection is still active, user can know how much TCP data user sent to server and how
much is received successfully by the server in total. By this means, user can get the total data transmitting
amount.
CONNECT OK
AT+CIPSTATUS //Query connection’s status
OK
STATE: CONNECT OK
www.simcom.com 29 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
AT+CIPSEND
> 012345678912
DATA ACCEPT: 12
AT+CIPACK //12 be Send , 12 be confirmed
+CIPACK: 12,12,0
OK
STATE: IP PROCESSING
C: 0,,"","","","INITIAL"
C:
//Query connection’s status
1,0,"TCP","116.228.221.51","8500","CONNE
CTED"
C:
2,0,"UDP","116.228.221.51","9600","CONNE
CTED"
C: 3,,"","","","INITIAL"
C: 4,,"","","","INITIAL"
C: 5,,"","","","INITIAL"
AT+CIPSEND=1
//Send data at 1 channel
>TCP
DATA ACCEPT: 1,3
AT+CIPACK=1 //3 be send, 3 be confirm
+CIPACK: 3,3,0
OK
AT+CIPSEND=2 //Send data at 2 channel
>UDP
DATA ACCEPT: 2,3
AT+CIPACK=2 //3 be send, 3 be unconfirmed.
+CIPACK: 3,0,3
OK
www.simcom.com 30 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
The module will receive data automatically if there is data coming from remote server. Several commands
can help to get the information header.
“AT+CIPHEAD=1” helps to add IP header in the format “+IPD (data length): payload”.
“AT+CIPSRIP=1” helps to show the data source information in the format “RECV FROM: <IP
ADDRESS>:<PORT >”.
“AT+CIPSHOWTP” helps to show the protocol (TCP/UDP) in the IP header. It takes effect only if
“CIPHEAD” is enabled.
With this information, user can easily know the source of the data frame, the amount of the payload and the
protocol. It can also help user to distinguish the received data from AT command responses.
The module provides user a way to get data from the network manually instead of pushing data to the TE
automatically.
“AT+CIPRXGET=1” is used to enable getting data from network manually, which should be set before
connection. If it is set to “0” (default value), data will be pushed to TE directly.
CONNECT OK
+CIPRXGET:1 //Data incoming from server
//The mode is set to 2, the output data will be in
AT+CIPRXGET=2,1460 normal mode, with the length not exceeding1460
bytes at a time.
+CIPRXGET:2,11,0
HELLO WORLD
OK
www.simcom.com 31 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
For single connection, there are 10 GPRS states in total; for multi connection, there are 7 GPRS states.
After some AT commands are executed, the corresponding state will be changed. User can get a general
idea from the following diagrams:
AT+CSTT
0. IP INITIAL
AT+CGATT
AT+CIPSHUT AT+CIICR
7. TCP/UDP
3. IP GPRSACT
CLOSING
AT+CIFSR
AT+CIPCLOSE
6. CONNECT OK 4. IP STATUS
5. TCP/UDP
CONNECTING/
SERVER LISTENING AT+CIPSTART
www.simcom.com 32 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
AT+CSTT
0. IP INITIAL
9. PDP DEACT 1. IP START
AT+CIPSHUT AT+CIICR
AT+CGATT=0
AT+CGATT=0
2. IP CONFIG
5. IP PROCESSING
AT+CIPCLOSE
3. IP GPRSACT
4. IP STATUS
AT+CIPSTART AT+CIFSR
User can use the command “AT+CIPCLOSE=<mode>” to close the TCP or UDP connection.
If <mode> is “0”, it is slow closing;
If <mode> is “1”, it is quick closing.
In slow closing, the module will interactive with the server when it closes the TCP connection. Thus, the
time of returning “CLOSE OK” will be a bit long. This method is suitable for steady network.
In quick closing, the module will disconnect the connection compulsorily and return “CLOSE OK”
www.simcom.com 33 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
The default setting is slow closing, so the “<mode>=0” can be omitted. And in multi connection, the
connection number <n> should be added in front of <mode>.
Be noted that command “AT+CIPCLOSE” only closes current TCP/UDP connection, but PDP context is still
active. Also user can close connection by AT+CIPSHUT, with current PDP context being deactivated.
If an error occurs in TCP/UDP connection, for example TCP sending data error or TCP connection dropping,
it is suggested to close the connection by command “AT+CIPCLOSE” and then restart the connection by
“AT+CIPSTART”.
If the error still occurs, command “AT+CIPSHUT” is recommended to shut off the PDP context and then
restart the connection.
If these two methods above can’t help to solve it, SIMCom recommends user to reset the module.
SIM7020 series supports transparent mode which provides a special data mode for data receiving and
sending by TCP/IP application task. Once the connection is established under transparent mode, the
module will be in data mode. All received data from serial port will be treated as data packet to be
transferred later, similarly all data received from remote side will be sent to serial port directly. In transparent
mode, all AT commands are not available. Methods are provided to switch back and forth between data
mode and command mode. Once it is switched to command mode, all AT commands can be used again.
To enable transparent mode, the command AT+CIPMODE should be set to 1. The transparent mode is only
supported under single connection.
www.simcom.com 34 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
OK
AT+CIPMODE=1 //Enable transparent mode
OK
6.14.3 How to Establish Connection and Enter into Transparent Mode after Enable
Transparent Mode
After enable transparent mode, SIM7020 series can work as two modes too: TCP client, UDP client. Once
the connection is established, “CONNECT OK” will be returned in the serial port. After establish connection,
executing “AT+CIPCHAN” to enter into transparent mode.
To switch from data mode to command mode, following methods are available:
(1) The default escape sequence is +++, and to use this sequence, there should be 1000ms idle period
before this sequence and 1000ms idle period after this sequence. Besides, the interval between each +
should not exceed 1000ms, otherwise it will be treated as TCP/IP data.
(2) If the remote server closes the connection, the module will be switched back to command mode
automatically.
(3) If the module is deactivated from PDP context (+PDP DEACT) during data transferring, module will be
switched back to command mode automatically.
ATO command can be used to switch the module from command mode to data mode again if the
connection is active.
www.simcom.com 35 / 36
SIM7020 Series_TCPIP_Application Note_V1.04
OK
ATO //switch the module to data mode
CONNECT
123456 //Send data to server
1234567890 //Receive data from server
www.simcom.com 36 / 36