0% found this document useful (0 votes)
34 views

Quectel EC20 TCPIP at Commands Manual

ok pas

Uploaded by

dangthengan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Quectel EC20 TCPIP at Commands Manual

ok pas

Uploaded by

dangthengan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

EC20 TCPIP

AT Commands Manual

LTE Module Series

Rev. EC20_TCPIP_AT_Commands_Manual_V1.0

Date: 2015-05-08

www.quectel.com
LTE Module Series
EC20 TCPIP AT Commands Manual

Our aim is to provide customers with timely and comprehensive service. For any
assistance, please contact our company headquarters:

Quectel Wireless Solutions Co., Ltd.


Office 501, Building 13, No.99, Tianzhou Road, Shanghai, China, 200233
Tel: +86 21 5108 6236
Mail: info@quectel.com

Or our local office, for more information, please visit:

l
http://www.quectel.com/support/salesupport.aspx

t e
For technical support, to report documentation errors, please visit:

c l
http://www.quectel.com/support/techsupport.aspx

a
Or Email: Support@quectel.com

GENERAL NOTES

u e n t i
QUECTEL OFFERS THIS INFORMATION AS A SERVICE TO ITS CUSTOMERS. THE INFORMATION

Q ide
PROVIDED IS BASED UPON CUSTOMERS’ REQUIREMENTS. QUECTEL MAKES EVERY EFFORT
TO ENSURE THE QUALITY OF THE INFORMATION IT MAKES AVAILABLE. QUECTEL DOES NOT
MAKE ANY WARRANTY AS TO THE INFORMATION CONTAINED HEREIN, AND DOES NOT ACCEPT

f
ANY LIABILITY FOR ANY INJURY, LOSS OR DAMAGE OF ANY KIND INCURRED BY USE OF OR
RELIANCE UPON THE INFORMATION. ALL INFORMATION SUPPLIED HEREIN IS SUBJECT TO

n
CHANGE WITHOUT PRIOR NOTICE.

o
COPYRIGHT

C
THIS INFORMATION CONTAINED HERE IS PROPRIETARY TECHNICAL INFORMATION OF
QUECTEL CO., LTD. TRANSMITTABLE, REPRODUCTION, DISSEMINATION AND EDITING OF THIS
DOCUMENT AS WELL AS UTILIZATION OF THIS CONTENTS ARE FORBIDDEN WITHOUT
PERMISSION. OFFENDERS WILL BE HELD LIABLE FOR PAYMENT OF DAMAGES. ALL RIGHTS
ARE RESERVED IN THE EVENT OF A PATENT GRANT OR REGISTRATION OF A UTILITY MODEL
OR DESIGN.

Copyright © Quectel Wireless Solutions Co., Ltd. 2015. All rights reserved.

EC20_TCPIP_AT_Commands_Manual Confidential / Released 1 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

About the Document

History

el
Revision Date Author Description

t l
1.0 2015-05-08 Chris PENG Initial

e c t ia
u
Q ide n
n f
Co

EC20_TCPIP_AT_Commands_Manual Confidential / Released 2 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

Contents

About the Document ................................................................................................................................... 2


Contents ....................................................................................................................................................... 3

1 Introduction .......................................................................................................................................... 5
1.1. The Process of Using TCPIP AT Commands .............................................................................. 5
1.2. Description of Data Access Mode................................................................................................ 7

2 Description of AT Command .............................................................................................................. 8


2.1. AT+QICSGP Configure Context ................................................................................................ 8

l
2.2. AT+QIACT Activate PDP Context ............................................................................................. 9
2.3. AT+QIDEACT Deactivate PDP Context .................................................................................. 10

e
2.4. AT+QIOPEN Start Socket Service .......................................................................................... 10

t
2.5. AT+QICLOSE Close Socket Service ...................................................................................... 12

c l
2.6. AT+QISTATE Query Socket Service Status ............................................................................ 13
2.7. AT+QISEND Send Data .......................................................................................................... 15

e ia
2.8. AT+QIRD Retrieve the Received TCP/IP Data ....................................................................... 17

t
2.9. AT+QISENDEX Send HEX String ........................................................................................... 18

u
2.10. AT+QISWTMD Switch Data Access Mode .............................................................................. 19

n
2.11. AT+QPING Ping a Remote Server .......................................................................................... 20

Q ide
2.12. AT+QNTP Synchronize Local Time with NTP Server ............................................................. 21
2.13. AT+QIDNSCFG Configure Address of DNS Server ................................................................ 22
2.14. AT+QIDNSGIP Get IP Address by Domain Name .................................................................. 23

f
2.15. AT+QICFG Configure Optional Parameters............................................................................ 23
2.16. AT+QISDE Control Whether or Not to Echo the Data for QISEND ........................................ 25

n
2.17. AT+QIGETERROR Query the Last Error Code ...................................................................... 26
2.18. Description of URC .................................................................................................................... 26

o
2.18.1. URC of Connection Closed ............................................................................................ 26
2.18.2. URC of Incoming Data ................................................................................................... 27

C
2.18.3. URC of Incoming Connection Full ................................................................................. 27
2.18.4. URC of Incoming Connection ........................................................................................ 27
2.18.5. URC of PDP Deactivation .............................................................................................. 28

3 Description of Error Code ................................................................................................................. 29

4 Example .............................................................................................................................................. 31
4.1. Configure and Activate Context ................................................................................................. 31
4.1.1. Configure Context .......................................................................................................... 31
4.1.2. Activate Context ............................................................................................................. 31
4.1.3. Deactivate Context ......................................................................................................... 31
4.2. TCP Client Works in Buffer Access Mode ................................................................................. 31
4.2.1. Set up a TCP Client Connection and Enter into Buffer Access Mode ........................... 31
4.2.2. Send Data in Buffer Access Mode ................................................................................. 32
4.2.3. Receive Data from Remote Server in Buffer Access Mode ........................................... 32
4.2.4. Close Connection ........................................................................................................... 33

EC20_TCPIP_AT_Commands_Manual Confidential / Released 3 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

4.3. TCP Client Works in Transparent Access Mode ........................................................................ 33


4.3.1. Set up a TCP Client Connection and Enter into Transparent Access Mode ................. 33
4.3.2. Send Data in Transparent Access Mode ....................................................................... 33
4.3.3. Receive Data from Remote Server in Transparent Access Mode ................................. 33
4.3.4. Close TCP Client ............................................................................................................ 34
4.4. TCP Client Works in Direct Push Mode ..................................................................................... 34
4.4.1. Set up TCP Client Connection and Enter into Direct Push Mode ................................. 34
4.4.2. Send Data in Direct Push Mode..................................................................................... 34
4.4.3. Receive Data from Remote Server in Direct Push Mode .............................................. 35
4.4.4. Close TCP Client ............................................................................................................ 35
4.5. TCP Server Works in Buffer Access Mode ................................................................................ 35

l
4.5.1. Start a TCP Server ......................................................................................................... 35
4.5.2. Accept TCP Incoming Connection ................................................................................. 35

e
4.5.3. Receive Data from Incoming Connection ...................................................................... 36

t
4.5.4. Close TCP Server .......................................................................................................... 36

c l
4.6. Example of UDP Service ........................................................................................................... 36

a
4.6.1. Start UDP Service .......................................................................................................... 36

e i
4.6.2. Send UDP Data to Remote ............................................................................................ 37

u t
4.6.3. Receive Data from Remote ............................................................................................ 37

n
4.6.4. Close UDP Service ........................................................................................................ 37
4.7. PING........................................................................................................................................... 37

Q ide
4.8. Synchronize Local Time ............................................................................................................. 38
4.9. Example of Getting Last Error Code .......................................................................................... 38

n f
Co

EC20_TCPIP_AT_Commands_Manual Confidential / Released 4 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

1 Introduction
The module embeds a TCP/IP stack. Host is able to access the Internet directly over AT commands. It
can reduce the dependence on the PPP and TCP/IP protocol stack and thus minimize the cost. The
module provides the following socket services: TCP client, UDP client, TCP server and UDP service.

el
1.1. The Process of Using TCPIP AT Commands

c t l
Through TCPIP AT commands, host can configure PDP context, activate/deactivate PDP context,

e ia
start/close socket service and send/receive data via socket service. Figure 1 illustrates how to use TCPIP

t
AT commands:

u
Q ide n
n f
Co

EC20_TCPIP_AT_Commands_Manual Confidential / Released 5 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

Recommended Power on/off: Power on the module


1. Power off: Send AT command
AT+QPOWD, then cut off power after
12s.
2. Power on: Keep power key as low for Send AT command and wait for the module to response OK
2s, then pull to high.

Query SIM Card Status:


Execute AT+CPIN, reboot the module if Query SIM card If failed to find SIM card in
AT+CPIN? failed to find SIM card in status by AT+CPIN? 20s, then reboot the module.
20s.

CS Service: Find SIM card


1. <stat> of AT+CREG? equals to 1 or 5,
means the module has registered to CS
domain service. If failed to register to CS
Query CS service
2. Reboot the module if failed to register domain service in 90s,
by AT+CREG?
to CS domain service in 90s. then reboot the module.

PS Service:

l
Register to CS domain service in 60s
1. <stat> of AT+CGREG?/AT+CEREG?
equales to 1 or 5, means the module has
Query PS service in 60s by
registered to PS domain service in

e
AT+CGREG?/
UMTS/LTE network.
AT+CEREG?

t
2. Go to next step no matter register to PS
domain service or not in 60s.

c l
Configure PDP Context:
1. Configure APN, user name, password Configure PDP context and Qos by

a
and auth type by AT+QICSGP. AT+QICSGP/AT+CGQREQ/

e
2. Configure QoS settings by AT+CGEQREQ/AT+CGQMIN/

i
AT+CGQMIN/AT+CGEQMIN/ AT+CGEQMIN

t
AT+CGQREQ/AT+CGEQREQ.

u
Activate PDP Context:

n
1. Activate PDP context by
AT+QIACT=<contextID>. Reboot the 1. Reboot the module if
Succeed to

Q ide
2. Query IP address of PDP context module if Activate PDP context by there is no response in 150s.
deactivate AT+QIACT=<contextID> 2. If failed to deactivate
by AT+QIACT?. there is no
PDP and AT+QIACT? PDP context for 3 times,
Notes: response in
context then reboot the module.
a) All above commands should be 40s.
executed together in sequence.
b) Reboot the module if there is no Fail to activate
PDP context Succeed to activate PDP context
response for AT+QIACT in 150s.

f
c) If failed to deactivate PDP Deactivate
context for 3 times, then reboot the PDP context by Open connection
module.

n
AT+QIDEACT= by AT+QIOPEN
3. Deactivate PDP context: <contextID>
Reboot the module if there is no
response for AT+QIDEACT in 40s. 1. Fail to open connection

o
continuously for 5 times. +QIOPEN: <connectID>,<err>
Open Connection: 2. There is no response in 150s.
1. If failed to get response of AT+QIOPEN in 150s, then

C
close connection.
Send data by
2. If failed to open connection for 5 times, deactivate PDP
AT+QISEND=<connectID>
context, then re-activate PDP context and open connection
again.
Get ACK
in 90s
TCP Connection Maintenance and Detection: Query sending
1. Send data by AT+QISEND =<connectID>[,<send_length>]. ACK by AT+QISEND=
It is recommended to periodically send a small data packet to the remote <connectID>,0
end to maintian and detect the TCP connection.
2. Query sending ACK by AT+QISEND=<connectID>,0.
If the package is still not acknowledged after two minutes (query every 5 Fail to get ACK in 90s
seconds, 24 times in total), the TCP connection may be abnormal,
execute AT+QICLOSE to close the current connection, and then execute
AT+QIOPEN to re-establish the TCP connection. Close connection
OK
by AT+QICLOSE=
<connectID>
Reboot the module if there is
no response in 10s.

Notes:
1. Please note that you need to wait for the final response (for example OK, CME error, CMS error) of the last AT command you entered before
you enter the next AT command. You can reboot the module if the module failed to get response in 60s.
2. Reboot the module if the module has not got response of AT+QIACT in 150s or response of AT+QICLOSE in 10s and AT+QIDEACT in 40s .
3. When you constantly failed to restart for 3 times, you can restart immediately for the first time after that, if it still fails, you should restart after
10 minutes for the second time, and restart after 30 minutes for the third time, 1 hour for the fourth time, etc..

Figure 1: Flow Chart of Using TCPIP AT Commands

EC20_TCPIP_AT_Commands_Manual Confidential / Released 6 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

1.2. Description of Data Access Mode

The TCPIP AT commands of the module include three kinds of data access modes:

1. Buffer access mode


2. Direct push access mode
3. Transparent access mode

When opening a socket service via AT+QIOPEN, specify the data access mode by the parameter
<access_mode>. After a socket service is opened, AT+QISWTMD could be used to change the data

l
access mode.

e
1. In buffer access mode, send data by AT+QISEND. When the data has been received, the module will

t
buffer the data and report an URC as +QIURC: “recv”,<connectID>. Then host can read data by

c l
AT+QIRD. Note: If the buffer is not empty, the module will not report a new URC until all the received

a
data has been read by AT+QIRD from buffer.

u e t i
2. In direct push mode, send data by AT+QISEND. The received data will be outputted to COM port
directly by +QIURC: “recv”,<connectID>,<currectrecvlength><CR><LF><data>.

Q ide n
3. In transparent access mode, the corresponding port (such as UART, USB modem port, etc.) enters
into the exclusive mode (Note that the USB AT port does not support transparent access mode). The
data received from COM port will be sent to Internet directly, and the received data from Internet will

f
be output to COM port directly as well. “+++” is used to exit from transparent access mode. When
“+++” returns OK, the module will be switched to buffer access mode. AT+QISWTMD can be used to

n
return back to transparent access mode. Note: In transparent access mode, host cannot execute AT

o
command. If the socket connection is closed because of network error or else, the module will report
NO CARRIER and exit from the transparent access mode. In this case, AT+QICLOSE should be
executed to close socket service.

C
4. To exit from the transparent access mode, use “+++” or DTR (AT&D1 should be set). To prevent the
“+++” from being misinterpreted as data, it should comply to the following sequence:
1) Do not input any character within T1 time (1 second) before inputting “+++”.
2) Input “+++” during 1s, and no other characters can be inputted during this time.
3) Do not input any character within T1 time (1 second) after “+++” has been inputted.
4) Exit from transparent access mode, return OK.

5. There are two methods to return back to the transparent access mode:
1) By AT+QISWTMD. Specify the <access_mode> as 2. If it enters into transparent access mode
successfully, CONNECT will be returned.
2) By ATO. ATO will change the access mode of connection that exits from transparent access mode
lately. If it enters into transparent access mode successfully, CONNECT will be returned. If there is
no connection enters into transparent access mode before, ATO will return NO CARRIER.

EC20_TCPIP_AT_Commands_Manual Confidential / Released 7 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

2 Description of AT Command

2.1. AT+QICSGP Configure Context

l
Configure the <APN>, <username>, <password> and other contexts by AT+QICSGP. The QoS of the

e
context can be configured by AT+CGQMIN, AT+CGEQMIN, AT+CGQREQ and AT+CGEQREQ.

t l
AT+QICSGP Configure Context

c
Test Command Response

e ia
AT+QICSGP=? +QICSGP: (1-16),1,<APN>,<username>,<password>,(0-3)

u t
OK

n
Query the configuration of context Response

Q ide
AT+QICSGP=<contextID> +QICSGP:
<context_type>,<APN>,<username>,<password>,<authent
ication>

f
OK

n
Write Command, configure the context Response

o
AT+QICSGP=<contextID>,<context_t OK
ype>,[<APN>[,<username>,<passwor ERROR
d>)[,<authentication>]]]

Parameter

<contextID>
<context_type>

<APN>
C Integer type, context ID, range is 1-16
Integer type, protocol type
1 IPV4
String type, access point name
<username> String type, username
<password> String type, password
<authentication> Integer type, the authentication methods
0 NONE
1 PAP
2 CHAP
3 PAP_OR_CHAP

EC20_TCPIP_AT_Commands_Manual Confidential / Released 8 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

Example

AT+QICSGP=1 //Query the configuration of context 1.


+QICSGP: 1,"","","",0

OK
AT+QICSGP=1,1,"UNINET","","",1 //Configure context 1, APN is “UNINET” for China Unicom.
OK

l
2.2. AT+QIACT Activate PDP Context

t e
Before activating context by AT+QIACT, host should configure the context by AT+QICSGP. After activation,

l
the IP address can be queried by AT+QIACT?. The range of <contextID> is 1-16, but the maximum

c
number of context which can be activated at the same time is 3. Depending on the Network, it may take at

e ia
most 150 seconds to return OK or ERROR after executing AT+QIACT. Before the response is returned,

t
other AT commands cannot be executed.

u n
AT+QIACT Activate PDP Context

Q ide
Test Command Response
AT+QIACT=? +QIACT: (1-16)

OK

f
Read command Response

n
AT+QIACT? Return the list of the current activated context and its IP
address:

o
+QIACT:
1,<context_state>,<context_type>[,<IP_address>]

C
[.....
+QIACT:
16,<context_state>,<context_type>[,<IP_address>]]

OK
Write Command Response
AT+QIACT=<contextID> Activate the context of specified <contextID>:
OK
ERROR

Maximum Response Time 150 seconds, determined by network.

EC20_TCPIP_AT_Commands_Manual Confidential / Released 9 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

Parameter

<contextID> Integer type, context ID, range is 1-16


<context_state> Integer type, context state
0 Deactivated
1 Activated
<contex_type> Integer type, protocol type
1 IPV4
<IP_address> The local IP address after context is activated

l
2.3. AT+QIDEACT Deactivate PDP Context

t e l
AT+QIDEACT will deactivate the specific context <contextID> and close all TCPIP connections set up in

c
this context. Depending on the Network, it may take at most 40 seconds to return OK or ERROR after

e a
executing AT+QIDEACT. Before the response is returned, other AT commands cannot be executed.

u t i
AT+QIDEACT Deactivate PDP Context

n
Test Command Response

Q ide
AT+QIDEACT=? OK
Write Command Response
AT+QIDEACT=<contextID> OK

f
ERROR

n
Maximum Response Time 40 seconds, determined by network.

o
Parameter

C
<contextID> Integer type, context ID, range is 1-16

2.4. AT+QIOPEN Start Socket Service

Start a socket service by AT+QIOPEN. The service type can be specified by the parameter
<service_type>. The data access mode (buffer access mode, direct push access mode and transparent
access mode) can be specified by parameter <access_mode>. The URC “+QIOPEN” indicates whether
the socket service is started successfully.

1. If <service_type> is “TCP LISTENER”, module works as TCP SERVER. After accepting a new TCP
connection, module will auto specify a <connectID> and report a URC as “+QIURC:

EC20_TCPIP_AT_Commands_Manual Confidential / Released 10 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

“incoming”,<connectID>,<serverID>,<remoteIP>,<remote_port>”. The range of <connectID> is 0-11.


The type of this new incoming connection is “TCP INCOMING” and the <access_mode> of “TCP
INCOMING” is the same with the <access_mode> of “TCP LISTENER”.

2. If <service_type> is “UDP SERVICE”, UDP data can be sent to or received from the remote IP via
<local_port>.
 Send data: AT+QISEND=<connectID>,<send_length>,<remoteIP>,<remote_port>.
 Receive data in direct push access mode: report a URC as “+QIURC:
“recv”,<connectID>,<currentrecvlength>,<remoteIP>,<remote_port><CR><LF><data>”
 Receive data in buffer access mode: report a URC as +QIURC: “recv”,<connectID>, then
retrieve data by AT+QIRD=<connectID>.

l
3. It is suggested to wait 150 seconds for the URC response as “+QIOPEN: <connectID>,<err>”. If the

e
URC response has not been received in 150 seconds, host could use AT+QICLOSE to close the

t
socket.

c a l
AT+QIOPEN Start Socket Service

e i
Test Command Response

u t
AT+QIOPEN=? +QIOPEN: (1-16),(0-11),"TCP/UDP/TCP LISTENER/UDP

n
SERVICE","<IP_address>/<domain_name>",<remote_port
>,<local_port>,(0-2)

Q ide
OK
Read Command Response

f
AT+QIOPEN?

n
OK
Write Command Response

o
AT+QIOPEN=<contextID>,<connectID If the <access_mode> is transparent access mode and it is
>,<service_type>,<IP_address>/<dom successful to start the service, response:

C
ain_name>,<remote_port>[,<local_po CONNECT
rt>[,<access_mode>]] Else, response:
ERROR
Error description can be got via AT+QIGETERROR.

If the <access_mode> is buffer access mode or direct push


mode, response:
OK

+QIOPEN: <connectID>,<err>
<err> is 0 when service is started successfully, else
<err> is not 0.

Maximum Response Time 150 seconds, determined by network.

EC20_TCPIP_AT_Commands_Manual Confidential / Released 11 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

Parameter

<contextID> Integer type, context ID, range is 1-16


<connectID> Integer type, socket service index, range is 0-11
<service_type> String type, socket service type
“TCP” Start a TCP connection as a client
“UDP” Start a UDP connection as a client
“TCP LISTENER” Start a TCP server to listen to TCP connection
“UDP SERVICE” Start a UDP service
<IP_address> String type
If <service_type> is TCP or UDP, it indicates the IP address of remote server, such as

l
“220.180.239.201”
If <service_type> is TCP LISTENER or UDP SERVICE, please enter “127.0.0.1”

e
<domain_name> String type, the domain name address of the remote server

t
<remote_port> The port of the remote server, only valid when <service_type> is “TCP” or “UDP”,

c l
range is 0-65535

a
<local_port> The local port, range is 0-65535

e i
If <service_type> is “TCP LISTENER” or “UDP SERVICE”, this parameter must be

u t
specified

n
If <service_type> is “TCP” or “UDP”, if <local_port> is 0, then the local port will be
assigned automatically, else the local port is assigned as specified

Q ide
<access_mode> Integer type, the data access mode of the socket services
0 Buffer access mode
1 Direct push mode

f
2 Transparent access mode
<err> Integer type, error code. Please refer to Chapter 3 for details

2.5. AT+QICLOSE

o n Close Socket Service

C
Close the specified socket service by AT+QICLOSE. Depending on the Network, it will take at most 10
seconds (default value, host could modify the time with <timeout>) to return OK or ERROR after
executing AT+QICLOSE. Before the response is returned, other AT commands cannot be executed.

AT+QICLOSE Close Socket Service


Test Command Response
AT+QICLOSE=? OK
Write Command Response
AT+QICLOSE=<connectID>[,<timeout If closes successfully, response:
>] OK

If failed to close, response:

EC20_TCPIP_AT_Commands_Manual Confidential / Released 12 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

ERROR

Parameter

<connectID> Integer type, socket service index, range is 0-11


<timeout> Integer type. If the FIN ACK of the other peers is still not received until <timeout>
expires, the module will force to close the socket. Range is 1-65535. Default: 10. Unit:
second

l
2.6. AT+QISTATE Query Socket Service Status

c t e l
AT+QISTATE can be used to query the socket service status. If the <query_type> is 0, it will return the

a
status of all existing socket services in the context of specified <contextID>. If the <query_type> is 1, it will

e i
return the status of specified <connectID> socket service.

u t
AT+QISTATE Query Socket Service Status

n
Test Command Response

Q ide
AT+QISTATE=? OK
Read Command Response
AT+QISTATE? Return the status of all existing connections

f
List of (+QISTATE:
<connectID>,<service_type>,<IP_address>,<remote_port>

n
,<local_port>,<socket_state>,<contextID>,<serverID>,<ac

o
cess_mode>,<AT_port>)

C
OK
If <query_type> is 0, query by specified Response
<contextID> Return the status of all existing connections in specified
AT+QISTATE=<query_type>,<context <contextID>
ID> List of (+QISTATE:
<connectID>,<service_type>,<IP_address>,<remote_port>
,<local_port>,<socket_state>,<contextID>,<serverID>,<ac
cess_mode>,<AT_port>)

OK
If <query_type> is 1, query by specified Response
<connectID> +QISTATE:
AT+QISTATE=<query_type>,<connect <connectID>,<service_type>,<IP_address>,<remote_port>
ID> ,<local_port>,<socket_state>,<contextID>,<serverID>,<ac

EC20_TCPIP_AT_Commands_Manual Confidential / Released 13 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

cess_mode>,<AT_port>

OK

Parameter

<query_type> Integer type, the query type


0 Query connection status by <contextID>
1 Query connection status by <connectID>
<contextID> Integer type, context ID, range is 1-16

l
<connectID> Integer type, socket service index, range is 0-11
<service_type> String type, the service type

e
“TCP” TCP connection as a client

t
“UDP” UDP connection as a client

c l
“TCP LISTENER” TCP listener socket as a TCP server

a
“TCP INCOMING” TCP connection accepted by a TCP server

e i
“UDP SERVICE” UDP service

t
<IP_address> IP address

u
If <service_type>=“TCP” or “UDP”, <IP_address> is the IP address of remote server

n
If <service_type>=“TCP LISTENER” or “UDP SERVICE”, <IP_address> is local IP

Q ide
address
If <service_type>=“TCP INCOMING”, <IP_address> is the IP address of remote client
<remote_port> Remote port number

f
If <service_type>=“TCP” or “UDP”, <remote_port> is the port of remote server
If <service_type>=“TCP LISTENER” or “UDP SERVICE”, <remote_port> is invalid

n
If <service_type>=“TCP INCOMING”, <remote_port> is the port of remote client
<local_port> Local port number

o
If <local_port> is 0, local port is assigned automatically
<socket_state> Integer type, socket service state

C
0 “Initial” connection has not been established
1 “Opening” client is connecting or server is trying to listen
2 “Connected” client/incoming connection has been established
3 “Listening” server is listening
4 “Closing” connection is closing
<serverID> Only valid when <service_type> is “TCP INCOMING”. <serverID> represents which
server accepts this TCP incoming connection, the value is the same as <connectID> of
this server’s “TCP LISTENER”
<access_mode> Data access mode
0 Buffer access mode
1 Direct push mode
2 Transparent access mode
<AT_port> String type, COM port of socket service
“usbmodem” USB MODEM PORT

EC20_TCPIP_AT_Commands_Manual Confidential / Released 14 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

“usbat” USB AT PORT


“uart1” UART PORT1
“cmux1” MUX PORT 1
“cmux2” MUX PORT 2
“cmux3” MUX PORT 3
“cmux4” MUX PORT 4

2.7. AT+QISEND Send Data

l
If <access_mode> of the specified socket service is buffer access mode or direct push mode, send data
by AT+QISEND. If data is sent to the module successfully, return “SEND OK”, else return “SEND FAIL” or

t e
“ERROR”. “SEND FAIL” indicates the send buffer is full and host can try to resend the data. “ERROR”

l
indicates it encounters error in the process of sending data. The host should delay some time for sending

c
data. The maximum length of sending data is 1460. “SEND OK” does not mean the data has been sent to

e a
the server successfully. Through the “AT+QISEND=<connectID>, 0” command, host can query whether

t i
the data has reached the server.

u n
AT+QISEND Send Data

Q ide
Test Command Response
AT+QISEND=? +QISEND: (0-11),(0-1460)

OK

f
If<service_type> is “TCP”, “UDP” or Response

n
“TCP INCOMING”, send data with >
changeable length <input data>

o
AT+QISEND=<connectID> CTRL+Z
Response “>”, then type data to send,

C
tap CTRL+Z to send, tap ESC to cancel If connection has been established and sending is successful,
the operation response:
SEND OK

If connection has been established but sending buffer is full,


response:
SEND FAIL

If connection has not been established, abnormally closed, or


parameter is incorrect, response:
ERROR
If<service_type> is “TCP”, “UDP” or Response
“TCP INCOMING”, send data with fixed >
length <input data with specified length>

EC20_TCPIP_AT_Commands_Manual Confidential / Released 15 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

AT+QISEND=<connectID>,<send_len If connection has been established and sending is successful,


gth> response:
Response “>”, type data until the data SEND OK
length is equal to <send_length>
If connection has been established but sending buffer is full,
response:
SEND FAIL

If connection has not been established, abnormally closed, or


parameter is incorrect, response:
ERROR

l
If <service_type> is “UDP SERVICE” Response

e
AT+QISEND=<connectID>,<send_len This command is used to send fixed length data to specified

t
gth>,<remoteIP>,<remote_port> remote IP address and remote port. The <service_type> must

l
Response “>”, type data until the data be “UDP SERVICE”.

c
length is equal to <send_length> >

e a
<input data with specified length>

u t i
If connection has been established and sending is successful,

n
response:

Q ide
SEND OK

If connection has been established but sending buffer is full,


response:

f
SEND FAIL

n
If connection has not been established, abnormally closed, or

o
parameter is incorrect, response:
ERROR

C
When <send_length> is 0, query the Response
sent data If the specified <connectID> connection has existed, return:
AT+QISEND=<connectID>,0 +QISEND:
<total_send_length>,<ackedbytes>,<unackedbytes>

OK
Else, return:
ERROR

Parameter

<connectID> Integer type, socket service index, range is 0-11


<send_length> Integer type, the length of data to be sent, which cannot exceed 1460
<remoteIP> String type, the remote IP address(must dot format), only valid when

EC20_TCPIP_AT_Commands_Manual Confidential / Released 16 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

<service_type> is “UDP SERVICE”


<remote_port> Integer type, the remote port, only valid when <service_type> is “UDP SERVICE”
<total_send_length> Integer type, the total length of sent data
<ackedbytes> Integer type, the total length of acknowledged data
<unackedbytes> Integer type, the total length of unacknowledged data
<err> Integer type, error code. Please refer to Chapter 3 for details

2.8. AT+QIRD Retrieve the Received TCP/IP Data

l
In buffer access mode, after receiving data, the module will buffer it and report a URC as +QIURC:
“recv”,<connectID> to notify the host. Then host can retrieve data by AT+QIRD.

t e l
Notes: If the buffer is not empty, and the module receives data again, then it will not report a new URC

c
until all the received data has been retrieved by AT+QIRD from buffer.

e ia
AT+QIRD Retrieve the Received TCP/IP Data

u t
Test Command Response

n
AT+QIRD=? +QIRD: (0-11),(0-1500)

Q ide
OK
When <service_type> is Response
“TCP”/“UDP”/“TCP INCOMING”

f
If the specified connection has received data, response:
AT+QIRD=<connectID>[,<read_length +QIRD: <read_actual_length><CR><LF><data>

n
>]
OK

o
If no data, return:
+QIRD: 0

C
OK

If connection does not exist, return:


ERROR
When <service_type> is “UDP Response
SERVICE” If data exists, return:
AT+QIRD=<connectID> +QIRD:
<read_actual_length>,<remoteIP>,<remote_port><CR><LF
><data>

OK

If there is no data, return:


+QIRD: 0

EC20_TCPIP_AT_Commands_Manual Confidential / Released 17 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

OK
If connection does not exist, return:
ERROR
When <read_length> is 0, query Response
retrieved data If the specified connection has existed, return:
AT+QIRD=<connectID>,0 +QIRD:
<total_receive_length>,<have_read_length>,<unread_leng
th>

OK

l
Else response:
ERROR

Parameter

c t e l
e ia
<connectID> Integer type, the socket service index, the range is 0-11

u t
<read_length> The maximum length of data to be retrieved, the range is 0-1500

n
<read_actual_length> The actual length of received data
<remoteIP> String type, the remote IP address, only valid when <service_type> is “UDP

Q ide
SERVICE”
<remote_port> Integer type, the remote port, only valid when <service_type> is “UDP
SERVICE”

f
<data> The retrieved data
<total_receive_length> The total length of received data

n
<have_read_length> The read length of received data

o
<unread_length> The unread length of received data

C
2.9. AT+QISENDEX Send HEX String

This command cannot be applied for “UDP SERVICE” and “TCP LISTENER” Socket.

AT+QISENDEX Send HEX String


Test Command Response
AT+QISENDEX=? +QISENDEX: (0-11),<hex_string>

OK
Write Command Response
AT+QISENDEX=<connectID>,<h SEND OK
ex_string>

EC20_TCPIP_AT_Commands_Manual Confidential / Released 18 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

If no data, return:
SEND FAIL

If connection does not exist, return:


ERROR

Parameter

<connectID> Integer type, the socket service index, the range is 0-11
<hex_string> String type, hex string, the max length is 512

t el
2.10. AT+QISWTMD Switch Data Access Mode

e c a l
AT+QISWTMD can switch the data access mode: buffer access mode, direct push mode and transparent

t i
access mode. When starting a socket service, host can specify the data access mode by the parameter

u
<access_mode> of AT+QIOPEN. After a socket has been started, host can change the data access mode

n
by AT+QISWTMD.

Q ide
AT+QISWTMD Switch Data Access Mode
Test Command Response
AT+QISWTMD=? +QISWTMD: (0-11),(0-2)

n f
OK
Read Command Response

o
AT+QISWTMD? OK
Write Command Response

C
AT+QISWTMD=<connectID>,<access If switch successfully and <access_mode> is 0 or 1, response:
_mode> OK

If switch successfully and <access_mode> is 2, module will


enter into data mode, response:
CONNECT
Else response:
ERROR

EC20_TCPIP_AT_Commands_Manual Confidential / Released 19 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

Parameter

<connectID> Integer type, the socket service index, the range is 0-11
<access_mode> Integer type, the data access mode of the connection
0 Buffer access mode
1 Direct push mode
2 Transparent access mode

2.11. AT+QPING Ping a Remote Server

el
AT+QPING is used to test the Internet Protocol reachability of a host. Before using ping tools, host should

t
activate the context corresponding to <contextID> via AT+QIACT first. It will return the result during

l
<timeout> and the default value of <timeout> is 4 second.

c a
AT+QPING Ping a Remote Server

e t i
Test Command Response

u
AT+QPING=? +QPING: (1-16),<host>,(1-255),(1-10)

Q ide n
OK
Write Command Response
AT+QPING=<contextID>,<host>[,<tim If ping successfully, return:

f
eout>[,<pingnum>]] OK

n
[+QPING:
<result>[,<IP_address>,<bytes>,<time>,<ttl>]<CR><LF>…]

o
+QPING:
<finresult>[,<sent>,<rcvd>,<lost>,<min>,<max>,<avg>]

C
Else response:
ERROR

Parameter

<contextID> Integer type, the context ID, the range is 1-16


<host> The host address in string type, format is a domain name or a dotted decimal IP
address
<timeout> Integer type, set the maximum time to wait for the response of each ping request
Unit: second, range: 1-255, default: 4
<pingnum> Integer type, set the maximum time of ping request. Range: 1-10. Default: 4
<result> The result of each ping request
0 Received the ping response from the server. In this case, it is followed by
“,<IP_address>,<bytes>,<time>,<ttl>”

EC20_TCPIP_AT_Commands_Manual Confidential / Released 20 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

Others Refer to Chapter 3


<IP_address> The IP address of the remote server formatted as a dotted decimal IP
<bytes> The length of sending each ping request
<time> The time wait for the response of the ping request. Unit: ms
<ttl> Time To Live value of the response packet for the ping request
<finresult> The final result of the command
0 It is finished normally. It is successful to activate the context and find the host.
In this case, it is followed by “,<sent>,<rcvd>,<lost>,<min>,<max>,<avg>”
Others Refer to Chapter 3
<sent> Total number of sending the ping requests
<rcvd> Total number of the ping requests that received the response

l
<lost> Total number of the ping requests that are timeout
<min> The minimum response time. Unit: ms

e
<max> The maximum response time. Unit: ms

t
<avg> The average response time. Unit: ms

e c ia l
t
2.12. AT+QNTP Synchronize Local Time with NTP Server

u
Q ide n
NTP is intended to synchronize the Coordinated Universal Time (UTC) with the time server. Before using
NTP, host should activate the context corresponding to <contextID> via AT+QIACT first. Depending on
the Network, it will take at most 125 seconds to return the result.

f
AT+QNTP Synchronize Local Time with NTP Server

n
Test command Response
AT+QNTP=? +QNTP: (1-16),<server>,(list of supported<port>s),(0,1)

o
OK

C
Read command Response
AT+QNTP? If in the process of synchronizing local time:
+QNTP: <server>,<port>

OK
Write command Response
AT+QNTP=<contextID>,<server> If synchronize local time with NTP server successfully:
[,<port>][,<autosettime>] OK

+QNTP: <err>,<time>
Else response:
ERROR
Maximum Response Time 125s, determined by network.

EC20_TCPIP_AT_Commands_Manual Confidential / Released 21 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

Parameter

<contextID> Integer type, indicates context ID, range is 1-16


<server> String type, indicates the address of NTP server
<port> Integer type, indicates the port of NTP server
<autosettime> Integer type, indicates whether auto set synchronized time to local time
0 Not set
1 Set
<err> Integer type, indicates synchronized result, please refer to Chapter 3
<time> String type, indicates time which is synchronized from NTP server
The format is “YYYY/MM/DD,hh:mm:sszz”. The range of zz is -48~56

2.13. AT+QIDNSCFG

t el Configure Address of DNS Server

e c a l
Before setting the DNS address, host must activate the context corresponding to <contextID> via

t i
AT+QIACT first.

u n
AT+QIDNSCFG Configure Address of DNS Server

Q ide
Test command Response
AT+QIDNSCFG=? +QIDNSCFG: (1-16),<pridnsaddr>,<secdnsaddr>

OK

f
Configure DNS server address for Response

n
specified PDP context OK
AT+QIDNSCFG=<contextID>,<pri ERROR

o
dnsaddr>[,<secdnsaddr>]
Query DNS server address of Response

C
specified PDP context +QIDNSCFG: <contextID>,<pridnsaddr>,<secdnsaddr>
AT+QIDNSCFG=<contextID>
OK

Parameter

<contextID> Integer type, indicates PDP context ID, range is 1-16


<pridnsaddr> String type, indicates primary DNS server address
<secdnsaddr> String type, indicates secondary DNS server address

EC20_TCPIP_AT_Commands_Manual Confidential / Released 22 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

2.14. AT+QIDNSGIP Get IP Address by Domain Name

Before querying the DNS, host should activate the context corresponding to <contextID> via AT+QIACT
first. Depending on the Network, it will take at most 60 seconds to return the result.

.AT+QIDNSGIP Get IP Address by Domain Name


Test Command Response
AT+QIDNSGIP=? +QIDNSGIP: (1-16),<hostname>

OK

l
Write Command Response

e
AT+QIDNSGIP=<contextID>,<hos

t
tname> OK

l
ERROR

c
The result will be returned as URC.

e a
+QIURC: "dnsgip",<err>,<IP_count>,<DNS_ttl>

t i
[.....

u
+QIURC: "dnsgip",<hostIPaddr>]

n
Maximum Response Time 60s, determined by network.

Q ide
Parameter

f
<contextID> Integer type, indicates PDP context ID, range is 1-16

n
<hostname> String type, indicates domain name
<err> Integer type, please refer to Chapter 3

o
<IP_count> Integer type, the number of the IP address corresponding to the <hostname>
<DNS_ttl> Integer type, the time of the DNS to live

C
<hostIPaddr> String type, the IP address of <hostname>

2.15. AT+QICFG Configure Optional Parameters

AT+QICFG Configure Optional Parameters


Test Command Response
AT+QICFG=? +QICFG: "transpktsize",(1-1460)
+QICFG: "transwaittm",(0-20)
+QICFG: "dataformat",(0,1),(0,1)
+QICFG: "viewmode",(0,1)
+QICFG: "tcp/retranscfg",(3-20),(5-1000)

EC20_TCPIP_AT_Commands_Manual Confidential / Released 23 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

OK

Set packet size for transparent Response


mode
[+QICFG: "transpktsize",<transpktsize>]
AT+QICFG="transpktsize"[,<tran
spktsize>]
OK
ERROR
Set waiting time for transparent Response
mode
[+QICFG: "transwaittm",<transwaittm>]
AT+QICFG="transwaittm"[,<tran
swaittm >]
OK

l
ERROR
Set the data format for sending and Response

e
receiving (only for non-transparent
[+QICFG:

t
mode)
"dataformat",<send_data_format>,<recv_data_format>]

l
AT+QICFG=“dataformat”[,<send

c
_data_format>,<recv_data_forma

a
t>] OK

e i
ERROR

u t
Set the display format for receiving Response
data (only for non-transparent

n
[+QICFG: “viewmode”,<mode>]
mode)

Q ide
AT+QICFG=“viewmode”[,<view_
mode>] OK
ERROR
Set the maximum interval time and Response

f
number for TCP retransmission [+QICFG: "tcp/retranscfg",<max_backoffs>,<max_rto>]
AT+QICFG="tcp/retranscfg"[,<m

n
ax_backoffs>,<max_rto>]
OK

o
ERROR

C
Parameter

<transpktsize> Integer type, indicates the max length of sending data packet, range is
1-1460, default: 1024
<transwaittm> Integer type, in transparent access mode, if the length of data received from
the port is less than the specified value of <transpktsize>, after exceeding the
time of <transwaittm>, data will be sent directly. Unit: 100ms, range: 0-20,
default: 2
<send_data_format> Integer type
0 Text mode
1 Hex mode
<recv_data_format> Integer type
0 Text mode
1 Hex mode
<view_mode> Integer type

EC20_TCPIP_AT_Commands_Manual Confidential / Released 24 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

0 Receive data output format: data header\r\ndata


1 Receive data output format: data header,data
<max_backoffs> Integer type, indicates the maximum number of TCP retransmission
Range: 3-20, default is 8
<max_rto> Integer type, indicates the maximum interval time of TCP retransmission
Range: 5-1000, default is 600, unit: 100ms

NOTE

The value of AT+QICFG="tcp/retranscfg"[,<max_backoffs>,<max_rto>] cannot be saved to NV, it will take


effect to all the TCP sockets.

t el
c l
2.16. AT+QISDE Control Whether or Not to Echo the Data for QISEND

e ia
AT+QISDE Control Whether or Not to Echo the Data for QISEND

u t
Test command Response

n
AT+QISDE=? +QISDE: (0,1)

Q ide
OK
Read command Response

f
AT+QISDE? +QISDE: <echo>

n
OK

o
Execution Command Response
AT+QISDE=<echo> OK

C
ERROR

Parameter

<echo> A numeric indicates whether or not to echo the data for AT+QISEND
0 Do not echo the data
1 Echo the data

EC20_TCPIP_AT_Commands_Manual Confidential / Released 25 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

2.17. AT+QIGETERROR Query the Last Error Code

If TCPIP AT commands respond ERROR, the details of error can be queried by AT+QIGETERROR.
Please note that AT+QIGETERROR just returns error code of the last TCPIP AT command.

AT+QIGETERROR Query the Last Error Code


Test command Response
AT+QIGETERROR=? OK
Execution Command Response
AT+QIGETERROR +QIGETERROR: <err>,<errcode_description>

el
OK

c t l
Parameter

e ia
<err> Integer type, error code. Please refer to Chapter 3

u t
<errcode_description> A string parameter indicates the details of error information. Please refer to

n
Chapter 3

Q ide
2.18. Description of URC

n f
The URC of TCPIP AT commands will be reported to the host by the type of “+QIURC:”. It contains the
reports about incoming data, connection closed and incoming connection and so on. Actually, there is

o
“<CR><LF>” both before and after URC, but “<CR><LF>” is omitted intentionally.

C
2.18.1. URC of Connection Closed

When TCP socket service is closed by remote peer or network error, this report will be outputted. The
<socket_state> of <connectID> will be “closing”. Host must execute AT+QICLOSE=<connectID> to
change the <socket_state> to “initial”.

URC of Connection Closed


+QIURC: “closed”,<connectID> <connectID> connection is closed

Parameter

<connectID> Integer type, socket service index, range is 0-11

EC20_TCPIP_AT_Commands_Manual Confidential / Released 26 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

2.18.2. URC of Incoming Data

In buffer access mode or direct push mode, after receiving data, the module will report URC to host.

In buffer access mode, after receiving data, the module will report URC as +QIURC: “recv”,<connectID>
to notify the host. Then host can retrieve data by AT+QIRD. Notes: if the buffer is not empty, and the
module receives data again, it will not report a new URC until all the received data has been retrieved by
AT+QIRD from buffer. In direct push mode, the received data will be outputted to COM port directly.

URC of Incoming Data


+QIURC: “recv”,<connectID> The URC of incoming data in buffer access mode. The host

l
can receive data by AT+QIRD.

e
+QIURC: The URC of incoming data in direct push mode when the

t
“recv”,<connectID>,<currentrecvleng <service_type> is “TCP”, “UDP” or “TCP INCOMING”.

l
th><CR><LF><data>

c
+QIURC: The URC of data incoming in direct push mode when

e ia
“recv”,<connectID>,<currentrecvleng <service_type> is “UDP SERVICE”.

t
th>,<remoteIP>,<remote_port><CR><

u
LF><data>

Q ide n
Parameter

<connectID> Integer type, socket service index, range is 0-11

f
<currentrecvlength> Integer type, the length of actual received data

n
<remoteIP> Remote IP address
<remote_port> Remote port

o
<data> The received data

C
2.18.3. URC of Incoming Connection Full

If the incoming connection reaches the limit, or no socket system resources can be allocated, then the
module will report the URC as +QIURC: “incoming full” for the new incoming connection request.

URC of Incoming Connection Full

+QIURC: “incoming full” Incoming connection is full.

2.18.4. URC of Incoming Connection

If the <service_type> is “TCP LISTENER”, when remote client connects to this server, host will auto
assign a free <connectID> for the new connection. The range of <connectID> is 0-11. The module will
report URC as below. The <service_type> of new connection is “TCP INCOMING”, and the

EC20_TCPIP_AT_Commands_Manual Confidential / Released 27 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

<access_mode> is buffer access mode.

URC of Incoming Connection


+QIURC: When new incoming connection is accepted by <serverID>,
“incoming”,<connectID>,<serverID>, the allocated <connectID>, <remoteIP> and <remote_port>
<remoteIP>,<remote_port> will be informed from this URC.

Parameter

<connectID> Integer type, assign this <connectID> for the incoming connection, which is auto

l
specified by the module. The range is 0-11
<serverID> The incoming <connectID> accepted by the server whose <service_type> is “TCP

e
LISTENER” and listening socket ID is <serverID>

t
<remoteIP> Remote IP address of the incoming <connectID>

c l
<remote_port> Remote port of the incoming <connectID>

e t ia
2.18.5. URC of PDP Deactivation

u n
PDP context may be deactivated by the network. The module will report URC to the host. Host must

Q ide
execute AT+QIDEACT to deactivate the context and reset all connections.

URC of PDP Deactivation


+QIURC: “pdpdeact”,<contextID>

f
<contextID> context is deactivated.

n
Parameter

o
<contextID> Integer type, context ID, range is 1-16

C
EC20_TCPIP_AT_Commands_Manual Confidential / Released 28 / 38
L Module Series
EC20 TCPIP AT Commands Manual

3 Description of Error Code


If TCPIP AT commands respond ERROR, the details of error can be queried by AT+QIGETERROR. Note:
AT+QIGETERROR just returns error code of the last TCPIP AT command.

l
Table 1: The Description of Error Code

t e
<err> Description of Error Code

c l
0 operate successfully

e ia
550 unknown error

u t
551 operation blocked

n
552 invalid parameters

Q ide
553 memory not enough

f
554 create socket failed

n
555 operation not supported

o
556 socket bind failed

557 socket listen failed

C
558 socket write failed

559 socket read failed

560 socket accept failed

561 open PDP context failed

562 close PDP context failed

563 socket Identity has been used

564 DNS busy

565 DNS parse failed

EC20_TCPIP_AT_Commands_Manual Confidential / Released 29 / 33


LTE Module Series
EC20 TCPIP AT Commands Manual

566 socket connect failed

567 socket has been closed

568 operation busy

569 operation timeout

570 PDP context break down

571 cancel send

l
572 operation not allowed

e
573 APN not configured

t l
574 port busy

e c t ia
u
Q ide n
n f
Co

EC20_TCPIP_AT_Commands_Manual Confidential / Released 30 / 38


L Module Series
EC20 TCPIP AT Commands Manual

4 Example

4.1. Configure and Activate Context

l
4.1.1. Configure Context

e
//Configure context 1, APN is “UNINET” for China Unicom.

t
AT+QICSGP=1,1,"UNINET","","",1

l
OK

e c ia
4.1.2. Activate Context

u n t
AT+QIACT=1 //Activate context 1. Depending on the Network, the maximum
response time is 150s.

Q ide
OK //Activate successfully.
AT+QIACT? //Query the state of context.
+QIACT: 1,1,1,"10.7.157.1"

f
OK

4.1.3.

o n
Deactivate Context

C
AT+QIDEACT=1 //Deactivate context 1.
OK //Deactivate successfully. Depending on the Network, the
maximum response time is 40s.

4.2. TCP Client Works in Buffer Access Mode

4.2.1. Set up a TCP Client Connection and Enter into Buffer Access Mode

AT+QIOPEN=1,0,"TCP","220.180.239.201",8705,0,0 //Context is 1 and <connectID> is 0. Before


using AT+QIOPEN, host should activate the
context with AT+QIACT first.
OK

EC20_TCPIP_AT_Commands_Manual Confidential / Released 31 / 33


LTE Module Series
EC20 TCPIP AT Commands Manual

+QIOPEN: 0,0 //Connect successfully. It is suggested to wait 150 seconds for the
URC response as “+QIOPEN: <connectID>,<err>”. If the URC
response has not been received in 150 seconds, host could use
AT+QICLOSE to close the socket.
AT+QISTATE=1,0 //Query if connection state of <connectID> is 0.
+QISTATE: 0,“TCP”,“220.180.239.201”,8705,65514,2,1,0,0,“usbmodem”

OK

l
4.2.2. Send Data in Buffer Access Mode

e
AT+QISEND=0 //Send changeable length data. “SEND OK” does not mean the

t
data has been sent to the server successfully. Host can query

c l
whether the data has reached the server via AT+QISEND=0,0.

a
>test1<ctrl+Z>

e i
SEND OK

u t
AT+QISEND=0,4 //Send fixed length data and the data length is 4.

n
>test
SEND OK

Q ide
AT+QISEND=0,0 //Query the length of sent data.
+QISEND: 9,9,0

f
OK
AT+QISENDEX=0,"3132333435" //Send HEX string.

n
OK

o
AT+QISEND=0,0 //Query the length of sent data.
+QISEND: 14,14,0

C
OK

4.2.3. Receive Data from Remote Server in Buffer Access Mode

+QIURC: “recv”,0 //The <connectID> 0 received data.


AT+QIRD=0,1500 //Read data, the length is 1500.
+QIRD: 5 //The actual received data length is 5.
test1

OK
AT+QIRD=0,1500
+QIRD: 0 //No data in buffer.

EC20_TCPIP_AT_Commands_Manual Confidential / Released 32 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

OK
AT+QIRD=0,0 //Query length of total received data, including read and unread.
+QIRD: 5,5,0

OK

4.2.4. Close Connection

AT+QICLOSE=0 //Close a connection whose <connectID> is 0.


Depending on the Network, the maximum

l
response time is 10s.
OK

c t e l
a
4.3. TCP Client Works in Transparent Access Mode

u e t i
4.3.1. Set up a TCP Client Connection and Enter into Transparent Access Mode

Q ide n
AT+QIOPEN=1,0,"TCP","220.180.239.201",8705,0,2 //Context is 1 and <connectID> is 0. Before using
AT+QIOPEN, host should activate the context
with AT+QIACT first.
CONNECT //Connect successfully. It is suggested to wait 150

f
seconds for the URC response as “CONNECT”.

n
If the URC response has not been received in
150 seconds, host could use AT+QICLOSE to

o
close the socket.

C
4.3.2. Send Data in Transparent Access Mode

<All data got from COM port will be sent to internet directly>

4.3.3. Receive Data from Remote Server in Transparent Access Mode

Test 1 //All data received from internet will be outputted to


COM port directly.

EC20_TCPIP_AT_Commands_Manual Confidential / Released 33 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

4.3.4. Close TCP Client

AT+QICLOSE=0 //After using “+++” to exit from the transparent access


mode, host could use AT+QICLOSE to close the
TCP link. Depending on the Network, the maximum
response time is 10 seconds.
OK

4.4. TCP Client Works in Direct Push Mode

el
4.4.1. Set up TCP Client Connection and Enter into Direct Push Mode

c t l
AT+QIOPEN=1,0,"TCP","220.180.239.201",8705,0,1 //Context is 1 and <connectID> is 0. Before using

a
AT+QIOPEN, host should activate the context

e i
with AT+QIACT first.

u t
OK

n
+QIOPEN: 0,0 //Connect successfully. It is suggested to wait 150

Q ide
seconds for the URC response as “+QIOPEN:
<connectID>,<err>”. If the URC response has not
been received in 150 seconds, host could use

f
AT+QICLOSE to close the socket.
AT+QISTATE=1,0 //Query if connection state of <connectID> is 0.

n
+QISTATE: 0,“TCP”,“220.180.239.201”,8705,65344,2,1,0,1,“usbmodem”

o
OK

C
4.4.2. Send Data in Direct Push Mode

AT+QISEND=0 //Send changeable length data. “SEND OK” does not


mean the data has been sent to the server
successfully. Host can query whether the data has
reached the server via AT+QISEND=0,0.
>test1<ctrl+Z>
SEND OK
AT+QISEND=0,5 //Send fixed length data and the data length is 5.
>test2
SEND OK
AT+QISEND=0,0 //Query the length of sent data. .
+QISEND: 10,10,0

EC20_TCPIP_AT_Commands_Manual Confidential / Released 34 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

OK

4.4.3. Receive Data from Remote Server in Direct Push Mode

+QIURC: “recv”,0,4 //Receive data from remote server.


test

4.4.4. Close TCP Client

el
AT+QICLOSE=0 //Close the connection of which <connectID>

t
is 0. Depending on the Network, the

l
maximum response time is 10s.

c
OK

u e t ia
n
4.5. TCP Server Works in Buffer Access Mode

Q ide
4.5.1. Start a TCP Server

f
AT+QIOPEN=1,1,"TCP LISTENER","127.0.0.1",0,2020,0 //Context is 1 and <connectID> is 1. Before
using AT+QIOPEN, host should activate the

n
context with AT+QIACT first.
OK

o
+QIOPEN: 1,0 //Start TCP server successfully.

C
AT+QISTATE=0,1 //Query if connection state of <contextID> is 1.
+QISTATE: 1,“TCP LISTENER”,“10.7.157.1”,0,2020,3,1,1,0,“usbmodem”

OK

4.5.2. Accept TCP Incoming Connection

+QIURC: "incoming",11,1,"172.31.242.222",54091 //Accept a TCP connection, <service_type> is


TCP incoming, <connectID> is 11.

EC20_TCPIP_AT_Commands_Manual Confidential / Released 35 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

4.5.3. Receive Data from Incoming Connection

+QIURC: “recv”,11 //Receive data from remote incoming connection.


AT+QIRD=11,1500 //Read data received from incoming connection
+QIRD: 4 //Actual data length is 4.
test

OK
AT+QIRD=11,1500
+QIRD: 0 //No data in buffer.

l
OK

e
AT+QIRD=11,0 //Query the data length of total received, including

t
read and unread.

c l
+QIRD: 4,4,0

e ia
OK

u n t
4.5.4. Close TCP Server

Q ide
AT+QICLOSE=11 //Close incoming connection. Depending on the
Network, the maximum response time is 10s.

f
OK
AT+QICLOSE=1 //Close TCP server listening.

n
OK

4.6.1.

Co
4.6. Example of UDP Service

Start UDP Service

AT+QIOPEN=1,2,"UDP SERVICE","127.0.0.1",0,3030,0 //Start a UDP Service, <connectID> is 2 and


<context> is 1. Before using AT+QIOPEN,
host should activate the context with
AT+QIACT first.
OK

+QIOPEN: 2,0 //Start UDP service successfully.


AT+QISTATE=0,1 //Query if connection status of <contextID> is 1.
+QISTATE: 2,“UDP SERVICE”,“10.7.157.1”,0,3030,2,1,2,0,“usbmodem”

EC20_TCPIP_AT_Commands_Manual Confidential / Released 36 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

OK

4.6.2. Send UDP Data to Remote

AT+QISEND=2,10,“10.7.89.10”,6969 //Send 10 bytes data to remote which IP is


10.7.89.10 and remote port is 6969.
>1234567890
SEND OK

l
4.6.3. Receive Data from Remote

e
+QIURC: “recv”,2 //Receive data from remote.

t
AT+QIRD=2 //Read UDP data. One whole UDP packet will be

c l
outputted. There is no need to specify the read

a
length.

e i
+QIRD: 4,“10.7.76.34”,7687 //Data length is 4, remote IP address is 10.7.76.34

u t
and remote port is 7687 test.

n
AAAA

Q ide
OK
AT+QIRD=2 //Read data.
+QIRD: 0 //No data in buffer.

f
OK

n
AT+QISEND=2,10,“10.7.76.34”,7687 //Send data to remote (10.7.76.34:7687).
>1234567890

o
SEND OK

C
4.6.4. Close UDP Service

AT+QICLOSE=2 //Close the service.


OK

4.7. PING

AT+QPING=1,“www.baidu.com” //Ping www.baidu.com in context 1. Before pinging


the destination IP address, host should activate the
context with AT+QIACT first.
OK

EC20_TCPIP_AT_Commands_Manual Confidential / Released 37 / 38


LTE Module Series
EC20 TCPIP AT Commands Manual

+QPING: 0,"61.135.169.125",32,192,255

+QPING: 0,"61.135.169.125",32,240,255

+QPING: 0,"61.135.169.125",32,241,255

+QPING: 0,"61.135.169.125",32,479,255

+QPING: 0,4,4,0,192,479,287

el
4.8. Synchronize Local Time

c t l
AT+QNTP=1,“202.120.2.101”,123 //Synchronize local time with NTP server

a
“202.120.2.101:123”. Before synchronizing the

e i
time, host should activate the context with

u t
AT+QIACT first.

n
OK

Q ide
+QNTP: 0,"2013/08/19,11:10:10+32"
AT+CCLK?
+CCLK: "13/08/19,11:10:57+32"

f
OK

o n
4.9. Example of Getting Last Error Code

C
AT+QIOPEN=1,"TCP","220.180.239.201",8033,0,1 //Start socket service, forget the <connectID>.
ERROR
AT+QIGETERROR
+QIGETERROR: 552, invalid parameters

OK

EC20_TCPIP_AT_Commands_Manual Confidential / Released 38 / 38

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy