Quectel UC20 TCPIP AT Commands Manual V1.2

User Manual: Pdf

Open the PDF directly: View PDF PDF.
Page Count: 37

DownloadQuectel UC20 TCPIP AT Commands Manual V1.2
Open PDF In BrowserView PDF
UC20 TCPIP
AT Commands Manual
UMTS/HSPA Module Series
Rev. UC20_TCPIP_AT_Commands_Manual_V1.2
Date: 2014-09-28

www.quectel.com

UMTS/HSPA Module Series
UC20 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
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

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

For technical support, to report documentation errors, please visit:
http://www.quectel.com/support/techsupport.aspx

GENERAL NOTES

QUECTEL OFFERS THIS INFORMATION AS A SERVICE TO ITS CUSTOMERS. THE INFORMATION
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
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
CHANGE WITHOUT PRIOR NOTICE.

COPYRIGHT

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. 2014. All rights reserved.

UC20_TCPIP_AT_Commands_Manual

Confidential / Released

1 / 36

UMTS/HSPA Module Series
UC20 TCPIP AT Commands Manual

About the Document
History

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

Revision

Date

Author

Description

1.0

2013-05-20

Jonathan WEN

Initial

1.1

1.2

2013-12-05

2014-09-28

Gibson PAN

Mandy WANG/
Chris PENG

UC20_TCPIP_AT_Commands_Manual

1.
2.
3.

Added NTP function
Added DNS function
Added maximum response time to AT
commands: AT+QIDEACT/AT+QIOPEN/
AT+QICLOSE/AT+QPING/AT+QNTP/
AT+QIDNSGIP

1.
2.

Added the description of URC
Modified the parameters of QICFG:
 and 
Added flow chart of using TCPIP AT
commands

3.

Confidential / Released

2 / 36

UMTS/HSPA Module Series
UC20 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
2.2. AT+QIACT Activate PDP Context ............................................................................................. 9
2.3. AT+QIDEACT Deactivate PDP Context .................................................................................. 10
2.4. AT+QIOPEN Start Socket Service .......................................................................................... 10
2.5. AT+QICLOSE Close Socket Service ...................................................................................... 12
2.6. AT+QISTATE Query Socket Service Status ............................................................................ 13
2.7. AT+QISEND Send Data .......................................................................................................... 15
2.8. AT+QIRD Retrieve the Received TCP/IP Data ....................................................................... 17
2.9. AT+QISWTMD Switch Data Access Mode .............................................................................. 18
2.10. AT+QPING Ping a Remote Server .......................................................................................... 19
2.11. AT+QNTP Synchronize Local Time with NTP Server ............................................................. 20
2.12. AT+QIDNSCFG Configure Address of DNS Server................................................................ 21
2.13. AT+QIDNSGIP Get IP Address by Domain Name .................................................................. 22
2.14. AT+QICFG Configure Optional Parameters............................................................................ 23
2.15. AT+QIGETERROR Query the Last Error Code ...................................................................... 24
2.16. Description of URC .................................................................................................................... 24
2.16.1. URC of Connection Closed ............................................................................................ 24
2.16.2. URC of Incoming Data ................................................................................................... 25
2.16.3. URC of Incoming Connection Full ................................................................................. 25
2.16.4. URC of Incoming Connection ........................................................................................ 26
2.16.5. URC of PDP Deactivation .............................................................................................. 26

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

3

Description of Error Code ................................................................................................................. 27

4

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

UC20_TCPIP_AT_Commands_Manual

Confidential / Released

3 / 36

UMTS/HSPA Module Series
UC20 TCPIP AT Commands Manual

4.4.

4.5.

4.6.

4.7.
4.8.
4.9.

4.3.2. Send Data in Transparent Access Mode ....................................................................... 31
4.3.3. Receive Data from Remote Server in Transparent Access Mode ................................. 31
4.3.4. Close TCP Client ............................................................................................................ 31
TCP Client Works in Direct Push Mode ..................................................................................... 32
4.4.1. Set up TCP Client Connection and Enter into Direct Push Mode ................................. 32
4.4.2. Send Data in Direct Push Mode..................................................................................... 32
4.4.3. Receive Data from Remote Server in Direct Push Mode .............................................. 32
4.4.4. Close TCP Client ............................................................................................................ 33
TCP Server Works in Buffer Access Mode ................................................................................ 33
4.5.1. Start a TCP Server ......................................................................................................... 33
4.5.2. Accept TCP Incoming Connection ................................................................................. 33
4.5.3. Receive Data from Incoming Connection ...................................................................... 33
4.5.4. Close TCP Server .......................................................................................................... 34
Example of UDP Service ........................................................................................................... 34
4.6.1. Start UDP Service .......................................................................................................... 34
4.6.2. Send UDP Data to Remote ............................................................................................ 34
4.6.3. Receive Data from Remote ............................................................................................ 35
4.6.4. Close UDP Service ........................................................................................................ 35
PING........................................................................................................................................... 35
Synchronize Local Time ............................................................................................................. 36
Example of Getting Last Error Code .......................................................................................... 36

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

UC20_TCPIP_AT_Commands_Manual

Confidential / Released

4 / 36

UMTS/HSPA Module Series
UC20 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, UDP service.

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

1.1. The Process of Using TCPIP AT Commands

Through TCPIP AT commands, host can configure PDP context, activate/deactivate PDP context,
start/close socket service and send/receive data via socket service. Figure 1 illustrates how to use TCPIP
AT commands:

UC20_TCPIP_AT_Commands_Manual

Confidential / Released

5 / 36

UMTS/HSPA Module Series
UC20 TCPIP AT Commands Manual

Recommended Power on/off:
1. Power off: Send AT command
AT+QPOWD=1, then cut off power
after 12s.
2. Power on: Keep power key as low for
2s, then pull to high.

Power on the module

Send AT command and wait for the module to response OK

Query SIM Card Status:
Execute AT+CPIN/AT+QINISTAT,
reboot the module if AT+CPIN? failed
to find SIM card in 20s.

If failed to find SIM card in
20s, then reboot the module.

Query SIM card
status by AT+CPIN?

CS Service:
1.  of AT+CREG? equals to 1 or 5,
means the module has registered to CS
domain service.
2. Reboot the module if failed to register
to CS domain service in 90s.

Find SIM card
If failed to register to CS
domain service in 90s,
then reboot the module.

Query CS service
by AT+CREG?

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Register to CS domain service in 60s

PS Service:
1.  of AT+CGREG? equales to 1 or
5, means the module has registered to PS
domain service.
2. Go to next step no matter register to PS
domain service or not in 60s.

Query PS service in 60s by
AT+CGREG?

Configure PDP Context:
1. Configure APN, user name, password
and auth type by AT+QICSGP.
2. Configure QoS settings by
AT+CGQMIN/AT+CGEQMIN/
AT+CGQREQ/AT+CGEQREQ.
Activate PDP Context:
1. Activate PDP context by
AT+QIACT=.
2. Query IP address of PDP context
by AT+QIACT?.
Notes:
a) All above commands should be
executed together in sequence.
b) Reboot the module if there is no
response for AT+QIACT in 150s.
c) If failed to deactivate PDP
context for 3 times, then reboot the
module.
3. Deactivate PDP context:
Reboot the module if there is no
response for AT+QIDEACT in 40s.

Reboot the
module if
there is no
response in
40s.

Configure PDP context and Qos by
AT+QICSGP/AT+CGQREQ/
AT+CGEQREQ/AT+CGQMIN/
AT+CGEQMIN

Succeed to
deactivate
PDP
context

Activate PDP context by
AT+QIACT=
and AT+QIACT?

Fail to activate
PDP context

Deactivate
PDP context by
AT+QIDEACT=


Open Connection:
1. If failed to get response of AT+QIOPEN in 150s, then
close connection.
2. If failed to open connection for 5 times, deactivate PDP
context, then re-activate PDP context and open connection
again.

Succeed to activate PDP context

Open connection
by AT+QIOPEN

1. Fail to open connection
continuously for 5 times.
2. There is no response in 150s.

TCP Connection Maintenance and Detection:
1. Send data by AT+QISEND =[,].
It is recommended to periodically send a small data packet to the remote
end to maintian and detect the TCP connection.
2. Query sending ACK by AT+QISEND=.
If the package is still not acknowledged after two minutes (query every 5
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.

1. Reboot the module if
there is no response in 150s.
2. If failed to deactivate
PDP context for 3 times,
then reboot the module.

+QIOPEN: ,

Send data by
AT+QISEND=

Get ACK
in 90s

Query sending
ACK by AT+QISEND=
,0

Fail to get ACK in 90s

Close connection
by AT+QICLOSE=


OK

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

UC20_TCPIP_AT_Commands_Manual

Confidential / Released

6 / 36

UMTS/HSPA Module Series
UC20 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.
2.
3.

Buffer access mode
Direct push access mode
Transparent access mode

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

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

1. In buffer access mode, send data by AT+QISEND. When the data has been received, the module will
buffer the data and report an URC as +QIURC: “recv”,. Then host can read data by
AT+QIRD. Note: If the buffer is not empty, the module will not report a new URC until all the received
data has been read by AT+QIRD from buffer.
2. In direct push mode, send data by AT+QISEND. The received data will be outputted to COM port
directly by +QIURC: “recv”,,.

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
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
return back to transparent access mode. Note: In transparent access mode, host cannot execute AT
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.
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  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.

UC20_TCPIP_AT_Commands_Manual

Confidential / Released

7 / 36

UMTS/HSPA Module Series
UC20 TCPIP AT Commands Manual

2

Description of AT Command

2.1. AT+QICSGP Configure Context

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

Configure the , ,  and other contexts by AT+QICSGP. The QoS of the
context can be configured by AT+CGQMIN, AT+CGEQMIN, AT+CGQREQ and AT+CGEQREQ.

AT+QICSGP Configure Context
Test Command
AT+QICSGP=?

Response
+QICSGP: (1-16),1-IPV4,APN,USER NAME,
PASSWORD,(0-3)
OK

Query the configuration of context
AT+QICSGP=

Response
+QICSGP:
,,,,
OK

Write Command, configure the context
AT+QICSGP=,,[[,,)[,]]]

Parameter








Response
OK
ERROR

Integer type, context ID, range is 1-16
Integer type, protocol type
1
IPV4
String type, access point name
String type, user name
String type, password
Integer type, the authentication methods
0
NONE
1
PAP
2
CHAP

UC20_TCPIP_AT_Commands_Manual

Confidential / Released

8 / 36

UMTS/HSPA Module Series
UC20 TCPIP AT Commands Manual

3

PAH_OR_CHAP

Example
AT+QICSGP=1
+QICSGP: 1,"","","",0

//Query the configuration of context 1.

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

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

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

2.2. AT+QIACT

Activate PDP Context

Before activating context by AT+QIACT, host should configure the context by AT+QICSGP. After activation,
the IP address can be queried by AT+QIACT?. The range of  is 1-16, but the maximum
number of context which can be activated at the same time is 3. Depending on the Network, it may take at
most 150 seconds to return OK or ERROR after executing AT+QIACT. Before the response is returned,
other AT commands cannot be executed.

AT+QIACT

Activate PDP Context

Test Command
AT+QIACT=?

Response
+QIACT: (1-16)
OK

Read command
AT+QIACT?

Response
Return the list of the current activated context and its IP
address:
+QIACT:
1,,[,]
[.....
+QIACT:
16,,[,]]
OK

Write Command
AT+QIACT=

Response
Activate the context of specified :
OK
ERROR

Maximum Response Time

150 seconds, determined by network.

UC20_TCPIP_AT_Commands_Manual

Confidential / Released

9 / 36

UMTS/HSPA Module Series
UC20 TCPIP AT Commands Manual

Parameter



Integer type, context ID, range is 1-16
Integer type, context state
0
Deactivated
1
Activated
Integer type, protocol type
1
IPV4
The local IP address after context is activated




l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

2.3. AT+QIDEACT

Deactivate PDP Context

AT+QIDEACT will deactivate the specific context  and close all TCPIP connections set up in
this context. Depending on the Network, it may take at most 40 seconds to return OK or ERROR after
executing AT+QIDEACT. Before the response is returned, other AT commands cannot be executed.

AT+QIDEACT Deactivate PDP Context
Test Command
AT+QIDEACT=?

Response
OK

Write Command
AT+QIDEACT=

Response
OK
ERROR

Maximum Response Time

40 seconds, determined by network.

Parameter


2.4. AT+QIOPEN

Integer type, context ID, range is 1-16

Start Socket Service

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

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

UC20_TCPIP_AT_Commands_Manual

Confidential / Released

10 / 36

UMTS/HSPA Module Series
UC20 TCPIP AT Commands Manual

“incoming”,,,,”. The range of  is 0-11.
The type of this new incoming connection is “TCP INCOMING” and the  of “TCP
INCOMING” is the same with the  of “TCP LISTENER”.
2.

If  is “UDP SERVICE”, UDP data can be sent to or received from the remote IP via
.
 Send data: AT+QISEND=,,,.
 Receive data in direct push access mode: report a URC as “+QIURC:
“recv”,,,,”
 Receive data in buffer access mode: report a URC as +QIURC: “recv”,, then
retrieve data by AT+QIRD=.

3.

It is suggested to wait 150 seconds for the URC response as “+QIOPEN: ,”. If the
URC response has not been received in 150 seconds, host could use AT+QICLOSE to close the
socket.

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

AT+QIOPEN Start Socket Service
Test Command
AT+QIOPEN=?

Response
+QIOPEN: (1-16),(0-11),"TCP/UDP/TCP LISTENER/UDP
SERVICE","/",,,(0-2)
OK

Read Command
AT+QIOPEN?

Response
OK

Write Command
AT+QIOPEN=,,,/,[,[,]]

Response
If the  is transparent access mode and it is
successful to start the service, response:
CONNECT
Else, response:
ERROR
Error description can be got via AT+QIGETERROR.
If the  is buffer access mode or direct push
mode, response:
OK
+QIOPEN: ,
 is 0 when service is started successfully, else
 is not 0.

Maximum Response Time

UC20_TCPIP_AT_Commands_Manual

150 seconds, determined by network.

Confidential / Released

11 / 36

UMTS/HSPA Module Series
UC20 TCPIP AT Commands Manual

Parameter






l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C









Integer type, context ID, range is 1-16
Integer type, socket service index, range is 0-11
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
String type
If  is TCP or UDP, it indicates the IP address of remote server, such as
“61.190.19.174”
If  is TCP LISTENER or UDP SERVICE, please enter “127.0.0.1”
String type, the domain name address of the remote server
The port of the remote server, only valid when  is “TCP” or “UDP”,
range is 0-65535
The local port, range is 0-65535
If  is “TCP LISTENER” or “UDP SERVICE”, this parameter must be
specified
If  is “TCP” or “UDP”, if  is 0, then the local port will be
assigned automatically, else the local port is assigned as specified
Integer type, the data access mode of the socket services
0
Buffer access mode
1
Direct push mode
2
Transparent access mode
Integer type, error code. Please refer to Chapter 3 for details

2.5. AT+QICLOSE

Close Socket Service

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 ) 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
AT+QICLOSE=?

Response
OK

Write Command
AT+QICLOSE=[,]

Response
If closes successfully, response:
OK
If failed to close, response:

UC20_TCPIP_AT_Commands_Manual

Confidential / Released

12 / 36

UMTS/HSPA Module Series
UC20 TCPIP AT Commands Manual

ERROR

Parameter



Integer type, socket service index, range is 0-11
Integer type. If the FIN ACK of the other peers is still not received until 
expires, the module will force to close the socket. Range is 0-65535. Default: 10. Unit:
second

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

2.6. AT+QISTATE

Query Socket Service Status

AT+QISTATE can be used to query the socket service status. If the  is 0, it will return the
status of all existing socket services in the context of specified . If the  is 1, it will
return the status of specified  socket service.

AT+QISTATE

Query Socket Service Status

Test Command
AT+QISTATE=?

Response
OK

If  is 0, query by specified

AT+QISTATE=,

Response
Return the status of all existing connections in specified

List of (+QISTATE:
,,,
,,,,,,)
OK

If  is 1, query by specified

AT+QISTATE=,

Response
+QISTATE:
,,,
,,,,,,
OK

Parameter


Integer type, the query type
0 Query connection status by 

UC20_TCPIP_AT_Commands_Manual

Confidential / Released

13 / 36

UMTS/HSPA Module Series
UC20 TCPIP AT Commands Manual

1 Query connection status by 

Integer type, context ID, range is 1-16

Integer type, socket service index, range is 0-11
 String type, the service type
“TCP”
TCP connection as a client
“UDP”
UDP connection as a client
“TCP LISTENER”
TCP listener socket as a TCP server
“TCP INCOMING”
TCP connection accepted by a TCP server
“UDP SERVICE”
UDP service
 IP address
If =“TCP” or “UDP”,  is the IP address of remote server
If =“TCP LISTENER” or “UDP SERVICE”,  is local IP
address
If =“TCP INCOMING”,  is the IP address of remote client
 Remote port number
If =“TCP” or “UDP”,  is the port of remote server
If =“TCP LISTENER” or “UDP SERVICE”,  is invalid
If =“TCP INCOMING”,  is the port of remote client

Local port number
If  is 0, local port is assigned automatically
 Integer type, socket service state
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

Only valid when  is “TCP INCOMING”.  represents which
server accepts this TCP incoming connection, the value is the same as  of
this server’s “TCP LISTENER”
 Data access mode
0
Buffer access mode
1
Direct push mode
2
Transparent access mode

String type, COM port of socket service
“usbmodem”
USB MODEM PORT
“usbat”
USB AT PORT
“uart”
UART PORT
“cmux1”
MUX PORT 1
“cmux2”
MUX PORT 2
“cmux3”
MUX PORT 3
“cmux4”
MUX PORT 4

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

UC20_TCPIP_AT_Commands_Manual

Confidential / Released

14 / 36

UMTS/HSPA Module Series
UC20 TCPIP AT Commands Manual

2.7. AT+QISEND

Send Data

If  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
“ERROR”. “SEND FAIL” indicates the send buffer is full and host can try to resend the data. “ERROR”
indicates it encounters error in the process of sending data. The host should delay some time for sending
data. The maximum length of sending data is 1460. “SEND OK” does not mean the data has been sent to
the server successfully. Through the “AT+QISEND=, 0” command, host can query whether
the data has reached the server.

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

AT+QISEND Send Data
Test Command
AT+QISEND=?

Response
+QISEND: (0-11),(0-1460)
OK

If is “TCP”, “UDP” or
“TCP INCOMING”, send data with
changeable length
AT+QISEND=
Response “>”, then type data to send,
tap CTRL+Z to send, tap ESC to cancel
the operation

Response
>

CTRL+Z

If connection has been established and sending is successful,
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 is “TCP”, “UDP” or
“TCP INCOMING”, send data with fixed
length
AT+QISEND=,
Response “>”, type data until the data
length is equal to 

Response
>


If connection has been established and sending is successful,
response:
SEND OK

If connection has been established but sending buffer is full,
response:
SEND FAIL

UC20_TCPIP_AT_Commands_Manual

Confidential / Released

15 / 36

UMTS/HSPA Module Series
UC20 TCPIP AT Commands Manual

If connection has not been established, abnormally closed, or
parameter is incorrect, response:
ERROR
If  is “UDP SERVICE”
AT+QISEND=,,,
Response “>”, type data until the data
length is equal to 

Response
This command is used to send fixed length data to specified
remote IP address and remote port. The  must
be “UDP SERVICE”.
>

If connection has been established and sending is successful,
response:
SEND OK

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
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

When  is 0, query the
sent data
AT+QISEND=,0

Response
If the specified  connection has existed, return:
+QISEND:
,,

OK
Else, return:
ERROR

Parameter




Integer type, socket service index, range is 0-11
Integer type, the length of data to be sent, which cannot exceed 1460
String type, the remote IP address, only valid when  is “UDP
SERVICE”

Integer type, the remote port, only valid when  is “UDP SERVICE”
 Integer type, the total length of sent data

Integer type, the total length of acknowledged data

Integer type, the total length of unacknowledged data

Integer type, error code. Please refer to Chapter 3 for details

UC20_TCPIP_AT_Commands_Manual

Confidential / Released

16 / 36

UMTS/HSPA Module Series
UC20 TCPIP AT Commands Manual

2.8. AT+QIRD

Retrieve the Received TCP/IP Data

In buffer access mode, after receiving data, the module will buffer it and report a URC as +QIURC:
“recv”, 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, then it will not report a new URC
until all the received data has been retrieved by AT+QIRD from buffer.
For UDP socket, the  should be ignored; and for TCP socket, the  must be
specified.

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C

AT+QIRD Retrieve the Received TCP/IP Data
Test Command
AT+QIRD=?

Response
+QIRD: (0-11),(0-1500)
OK

When  is “TCP” or “TCP Response
INCOMING”
If the specified connection has received data, response:
AT+QIRD=,
>
OK
If no data, return:
+QIRD: 0
OK
If connection does not exist, return:
ERROR

When

AT+QIRD=

is

“UDP”

Response
If the specified connection has received data, response:
+QIRD: 

OK
If no data, return:
+QIRD: 0
OK

If connection does not exists, return:
ERROR
When

SERVICE”
AT+QIRD=

is

“UDP Response
If data exists, return:
+QIRD:
,,
OK
If there is no data, return:
+QIRD: 0
OK
If connection does not exist, return:
ERROR
When  is
retrieved data
AT+QIRD=,0

0,

query

Response
If the specified connection has existed, return:
+QIRD:
,,

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
OK
Else response:
ERROR

Parameter












Integer type, the socket service index, the range is 0-11
The maximum length of data to be retrieved, the range is 0-1500
The actual length of received data
String type, the remote IP address, only valid when  is “UDP
SERVICE”
Integer type, the remote port, only valid when  is “UDP
SERVICE”
The retrieved data
The total length of received data
The read length of received data
The unread length of received data

2.9. AT+QISWTMD Switch Data Access Mode

AT+QISWTMD can switch the data access mode: buffer access mode, direct push mode and transparent
access mode. When starting a socket service, host can specify the data access mode by the parameter
 of AT+QIOPEN. After a socket has been started, host can change the data access mode
by AT+QISWTMD.

UC20_TCPIP_AT_Commands_Manual

Confidential / Released

18 / 36

UMTS/HSPA Module Series
UC20 TCPIP AT Commands Manual

AT+QISWTMD Switch Data Access Mode
Test Command
AT+QISWTMD=?

Response
+QISWTMD: (0-11),(0-2)
OK

Read Command
AT+QISWTMD?

Response
OK

Write Command
AT+QISWTMD=,

Response
If switch successfully and  is 0 or 1, response:
OK

l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
If switch successfully and  is 2, module will
enter into data mode, response:
CONNECT
Else response:
ERROR

Parameter




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

2.10. AT+QPING

Ping a Remote Server

AT+QPING is used to test the Internet Protocol reachability of a host. Before using ping tools, host should
activate the context corresponding to  via AT+QIACT first. It will return the result during
 and the default value of  is 1 second.

AT+QPING

Ping a Remote Server

Test Command
AT+QPING=?

Response
+QPING: (1-16),“HOST”,(1-255),(1-10)
OK

Write Command
AT+QPING=,[,[,]]

UC20_TCPIP_AT_Commands_Manual

Response
If ping successfully, return:
OK

Confidential / Released

19 / 36

UMTS/HSPA Module Series
UC20 TCPIP AT Commands Manual

[+QPING:
[,,,

Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.5
Linearized                      : No
Has XFA                         : No
Language                        : zh-CN
XMP Toolkit                     : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:08:04
Format                          : application/pdf
Creator                         : Amy.Feng
Create Date                     : 2014:09:28 10:59:40+08:00
Creator Tool                    : Microsoft® Word 2010
Modify Date                     : 2014:09:28 11:24:24+08:00
Metadata Date                   : 2014:09:28 11:24:24+08:00
Producer                        : Microsoft® Word 2010
Document ID                     : uuid:6843ba67-9366-40da-be11-4955241a6aa7
Instance ID                     : uuid:65433298-35a6-46d0-94d0-b80d012f38c8
Page Mode                       : UseOutlines
Page Count                      : 37
Author                          : Amy.Feng
EXIF Metadata provided by EXIF.tools

Navigation menu