You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
M2M User Guide<br />
<strong>Qisda</strong> M-<strong>series</strong><br />
GSM / GPRS Wireless Modules<br />
M2M User Guide<br />
Rev. 1.0.8<br />
2009/03/13<br />
Document ID: M8-21-0012-108<br />
Copyright © 2007, 2008 <strong>Qisda</strong> Corporation. All rights reserved.<br />
This document contains proprietary technical information which is the property of <strong>Qisda</strong><br />
Corporation and is issued in strict confidential and shall not be disclosed to others parties in<br />
whole or in parts without written permission of <strong>Qisda</strong> Corporation.<br />
The documents contain information on a product, which is under development and is issued<br />
for customer evaluation purposes only.<br />
<strong>Qisda</strong> may make changes to product specifications at any time, without notice.<br />
Module Business Division<br />
Mobile Communications BU<br />
<strong>Qisda</strong> Corporation<br />
18 Jihu Road, Nei-Hu, Taipei 114, Taiwan<br />
Tel: +886-2-2799-8800<br />
Fax: +886-2-2656-6398<br />
http://<strong>Qisda</strong>.com<br />
Copyright ©2007, 2008 <strong>Qisda</strong> Corporation.<br />
Confidential Property
M2M User Guide<br />
Date Originator Reviewer<br />
04-JAN-2008<br />
Joey Ni<br />
12-MAR-2008<br />
Joy Lai<br />
03-AUG-2008<br />
B<strong>ru</strong>ce Wang<br />
01-SEP-2008<br />
Joey Ni<br />
13-MAR-2009<br />
Joey Ni<br />
History<br />
Version Date Note<br />
VER: 1.0.0 04-JAN-2008 First release<br />
VER: 1.0.1 18-JAN-2008 Modify $NWRX<br />
VER: 1.0.2 01-FEB-2008 1. Add new feature of $NWTX<br />
2. Modify $NWDR<br />
3. Modify $NWRX<br />
4. Modify chapter 4 - example<br />
VER: 1.0.3 12-FEB-2008 1. Modify $NWTX<br />
2. Add query function of $NWTX<br />
VER: 1.0.4 15-FEB-2008<br />
VER: 1.0.5 03-AUG-2008 Add new module-id<br />
VER: 1.0.6 01-SEP-2008<br />
VER: 1.0.7 26-SEP-2008 Add multi-session feature<br />
Add $NWSO<br />
Add $NWDW<br />
Modify $NWTX<br />
VER: 1.0.8 13-MAR-2009 Modify $NWACT<br />
Modify $NWCN<br />
Modify $NWTX<br />
Modify example<br />
M8-21-0012-108 - 2 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
Contents<br />
1 ABOUT M2M .................................................................................................................. 4<br />
1.1 INTRODUCTION OF M2M .................................................................................................... 4<br />
1.2 M2M IN QISDA M-SERIES MODULES .................................................................................... 4<br />
1.3 MODULE SUPPORT LIST......................................................................................................... 4<br />
2 PREPARATION FOR M2M............................................................................................... 5<br />
2.1 EQUIPMENT ......................................................................................................................... 5<br />
2.2 PROCEDURE BEFORE M2M AT COMMANDS........................................................................ 5<br />
2.3 NETWORK INFORMATION ..................................................................................................... 5<br />
3 M2M AT COMMANDS................................................................................................... 6<br />
3.1 $NWACT: M2M ACTIVATE OR DEACTIVATE ....................................................................... 6<br />
3.2 $NWSO: OPEN OR CLOSE A SESSION ................................................................................. 8<br />
3.3 $NWDF: SELECT M2M DATA FORMAT .............................................................................. 10<br />
3.4 $NWDW: WRITE DATA INTO THE TX-BUFFER....................................................................... 12<br />
3.5 $NWDR: READ DATA FROM THE RX-BUFFER ...................................................................... 14<br />
3.6 $NWCN: ESTABLISH OR CLOSE THE CONNECTION TO A SERVER ......................................... 17<br />
3.7 $NWTX: SEND DATA TO A SERVER..................................................................................... 19<br />
3.8 $NWRX: INDICATION OF RECEIVING DATA........................................................................ 22<br />
4 COMPLETE EXAMPLES ..................................................................................................24<br />
4.1 EXAMPLE 1: TRANSMIT UCP DATA (HEX MODE) ................................................................ 24<br />
4.2 EXAMPLE 2: TRANSMIT TCP DATA (TEXT MODE).................................................................. 25<br />
4.3 EXAMPLE 3: SEND TCP DATA SPEEDILY (TEXT MODE) .......................................................... 27<br />
4.4 EXAMPLE 4: SEND LARGE SIZE TCP DATA (TEXT MODE) ....................................................... 29<br />
5 M2M SPECIFIC ERROR RESULT CODE...........................................................................31<br />
M8-21-0012-108 - 3 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
1 About M2M<br />
1.1 Introduction of M2M<br />
M2M (machine to machine) is a technology which enables machines talking to each<br />
other. M2M is often referred as wireless but can also operate through the wired<br />
infrast<strong>ru</strong>cture, like Internet, leased lines or the telephone network. M2M can be used<br />
for both fixed and mobile objects.<br />
There are many communication methods can be a bearer for wireless M2M<br />
application. The common methods are GSM/GPRS/3G, IEEE 802.11, and Bluetooth.<br />
1.2 M2M in <strong>Qisda</strong> M-<strong>series</strong> modules<br />
<strong>Qisda</strong> M-<strong>series</strong> module can apply M2M to send data to the remote server.<br />
The feature of <strong>Qisda</strong> M-<strong>series</strong> module:<br />
Embedded TCP/IP<br />
Connect to a TCP/UDP server on Internet over GPRS<br />
AT Commands interface<br />
1.3 Module support list<br />
The <strong>Qisda</strong> M-<strong>series</strong> modules which support M2M are:<br />
Module ID M25 M26 M27 M33G<br />
M2M supported ○ ○ ○ ○<br />
M8-21-0012-108 - 4 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
2 Preparation for M2M<br />
2.1 Equipment<br />
<br />
<br />
<br />
A SIM with GPRS capability<br />
Device connected with UART connector (UART connects module and device.)<br />
TCP/UDP server with public IP address in Internet Network<br />
2.2 Procedure before M2M AT commands<br />
1. Plug in a SIM card, which with enabled GPRS function, into the SIM card slot.<br />
2. Turn on the power.<br />
3. Set module to full functionality mode, thus we can execute all AT commands in<br />
module.<br />
AT Command: +CFUN=1<br />
4. Register GSM network.<br />
AT Command: +COPS=0<br />
5. In order to use the GPRS service, we must register GPRS network.<br />
AT Command : +CGATT=1<br />
6. After 5. We can execute M2M AT commands. The complete example of M2M<br />
application will be described in chapter 4.<br />
2.3 Network information<br />
<br />
<br />
<br />
Before setting up module to access the GPRS network, we must contact the<br />
network provider to obtain the following information:<br />
APN (access point name)<br />
User ID & password (optional)<br />
M8-21-0012-108 - 5 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
3 M2M AT Commands<br />
3.1 $NWACT: M2M activate or deactivate<br />
This command is used to activate or deactivate M2M.<br />
When M2M is activated:<br />
<br />
<br />
GPRS service will be attached<br />
The PDP context will be activated<br />
Before executing “$NWACT=1”, setting “+COPS=0” and “+CGATT=1” are<br />
recommended. If both of them are executed successfully, we can guarantee the<br />
GSM and GPRS network has camped on.<br />
GPRS attachment procedure may take place if it has not already been performed<br />
using the +CGATT commands.<br />
Syntax<br />
AT$NWACT=[,[,,]]<br />
(if activating M2M)<br />
AT$NWACT=1,[,,]<br />
(if deactivating M2M)<br />
AT$NWACT=0<br />
Response(s) OK<br />
+CME ERROR: <br />
AT$NWACT<br />
Response(s) $NWACT: [,[,,]]<br />
OK<br />
AT$NWACT=<br />
Response(s) $NWACT: (list of supported s)<br />
OK<br />
Unsolicited Result Codes<br />
When network deactivate PDP context:<br />
$NWACT: 0<br />
Parameter(s)<br />
State of M2M activation Numeric<br />
0 Deactivated<br />
1 Activated<br />
2 M2M suspended (when enter no signal region or be in GSM voice call)<br />
M8-21-0012-108 - 6 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
<br />
(Access Point Name) a logical name that is used to String<br />
select the GGSN or the external packet data network.<br />
User ID String<br />
User password String<br />
Example(s)<br />
Activate M2M only with <br />
AT$NWACT=1,"internet"<br />
OK<br />
AT$NWACT<br />
$NWACT: 1,"internet","",""<br />
OK<br />
1. Activate M2M only with <br />
2. Query<br />
AT$NWACT=0<br />
3. Deactivate M2M<br />
OK<br />
Activate M2M with , , <br />
AT$NWACT=1,"internet","user_A","pw"<br />
OK<br />
1. Activate M2M with , ,<br />
<br />
AT$NWACT<br />
$NWACT: 1,"internet","user_A","pw"<br />
OK<br />
2. Query<br />
M8-21-0012-108 - 7 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
3.2 $NWSO: Open or close a session<br />
This command is used to open a session or close a session.<br />
Before executing $NWSO, M2M must be activated. ($NWACT:1)<br />
When a session is open, $NWDF, $NWDW, $NWDR, $NWCN can be executed on this<br />
session.<br />
The read command returns the current opened sessions.<br />
Syntax<br />
AT$NWSO=,<br />
Response(s) OK<br />
+CME ERROR: <br />
AT$NWSO<br />
Response(s) $NWSO: ,1<br />
[$NWSO: ,1]<br />
…<br />
OK<br />
AT$NWSO=<br />
Response(s) $ NWSO: (list of supported s),(list of supported s)<br />
OK<br />
Parameter(s)<br />
<br />
(M2M session identifier) Specifies a particular M2M Numeric<br />
session.<br />
1-5 Support at most 5 sessions.<br />
State of session Numeric<br />
0 Closed<br />
1 Open<br />
Example(s)<br />
AT$NWACT=1,”internet”<br />
OK<br />
AT$NWSO=1,1<br />
OK<br />
AT$NWSO=2,1<br />
OK<br />
1. Activate M2M with APN<br />
2. Open session-1<br />
3. Open session-2<br />
M8-21-0012-108 - 8 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
AT$NWSO=3,1<br />
OK<br />
AT$NWSO<br />
$NWSO: 1,1<br />
$NWSO: 2,1<br />
$NWSO: 3,1<br />
OK<br />
AT$NWSO=2,0<br />
OK<br />
AT$NWSO<br />
$NWSO: 1,1<br />
$NWSO: 3,1<br />
OK<br />
4. Open session-3<br />
5. List current opened sessions<br />
6. Close session-2<br />
7. List current opened sessions<br />
M8-21-0012-108 - 9 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
3.3 $NWDF: Select M2M data format<br />
This command is used to select format of transmission data.<br />
Before executing $NWDF on a session, the session must be opened. ($NWSO: ,1)<br />
The read command returns the current data format of all opened sessions.<br />
Syntax<br />
AT$NWDF=,<br />
Response(s) OK<br />
+CME ERROR: <br />
$NWDF<br />
Response(s) $NWDF: ,<br />
[$NWDF: ,]<br />
…<br />
OK<br />
$NWDF=<br />
Response(s) $NWDF: (list of supported s), (list of supported s)<br />
OK<br />
Parameter(s)<br />
<br />
(M2M session identifier) Specifies a particular M2M<br />
session.<br />
1-5 Support at most 5 sessions.<br />
<br />
The format of data.<br />
Numeric<br />
Numeric<br />
When hex mode, the one byte is displayed as two<br />
characters in hexadecimal format. For example, the<br />
byte 0x36 (decimal 54) is displayed as "36" (two<br />
characters).<br />
In hex mode, only characters '0'..'9', 'A'..F' and 'a'..'f'<br />
are valid.<br />
0 HEX mode<br />
1 Text mode<br />
Example(s)<br />
AT$NWACT=1,”internet”<br />
OK<br />
AT$NWSO=1,1<br />
OK<br />
1. Activate M2M with APN<br />
2. Open session-1<br />
M8-21-0012-108 - 10 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
AT$NWSO=2,1<br />
OK<br />
AT$NWDF<br />
$NWDF: 1,0<br />
$NWDF: 2,0<br />
OK<br />
AT$NWDF=2,1<br />
OK<br />
AT$NWSO<br />
$NWDF: 1,0<br />
$NWDF: 2,1<br />
OK<br />
3. Open session-2<br />
4. Query data format of the opened<br />
sessions.<br />
5. Set data format to Text mode of<br />
session-2.<br />
6. Query data format of the opened<br />
sessions.<br />
M8-21-0012-108 - 11 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
3.4 $NWDW: Write data into the TX-buffer<br />
This command is used to write data into the TX-buffer.<br />
Before executing $NWDW on a session, the session must be opened.<br />
($NWSO: ,1)<br />
Every session has its own TX-buffer. The size of a TX-buffer is 1470 bytes. The data stored<br />
in TX-buffer will not be influenced when executing $NWCN. All data stored in TX-buffer<br />
will be cleared when the session is closed.<br />
The read command returns the current length of stored data in TX-buffer of all<br />
opened sessions.<br />
Syntax<br />
AT$NWDW=,[,]<br />
Response(s) OK<br />
+CME ERROR: <br />
AT$NWDW<br />
Response(s) $NWDW: ,<br />
[$NWDW: ,]<br />
…<br />
OK<br />
Parameter(s)<br />
<br />
(M2M session identifier) Specifies a particular M2M<br />
session.<br />
1-5 Support at most 5 sessions.<br />
A string parameter which is sent to the server.<br />
Numeric<br />
String<br />
If $NWDF is text mode:<br />
The maximum length of is 600. The<br />
content of must be visible character<br />
(ASCII 20~7E), but no semicolon(;) and double<br />
quote(").<br />
If $NWDF is HEX mode:<br />
The maximum length of is 600. Only<br />
characters '0'..'9', 'A'..F' and 'a'..'f' are valid.<br />
<br />
0 Clear old data.<br />
1 New data is appended to old data.<br />
Numeric<br />
M8-21-0012-108 - 12 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
The length of stored data in TX-buffer. Numeric<br />
0-1470<br />
Example(s)<br />
Write data into the TX-buffer of session-1 (HEX mode)<br />
AT$NWSO=1,1<br />
OK<br />
1. Open session-1<br />
(Default data format is HEX mode)<br />
AT$NWDW=1,"313233616263",0<br />
OK<br />
2. Write 6 bytes data into TX-buffer.<br />
(“123abc”)<br />
AT$NWDW<br />
$NWDW: 1,6<br />
OK<br />
Write data into the TX-buffer of session-2 (text mode)<br />
AT$NWSO=2,1<br />
1. Open session-2<br />
OK<br />
3. Query length of stored data in<br />
TX-buffer.<br />
AT$NWDF=2,1<br />
OK<br />
AT$NWDW=2,"aaaaabbbbb",0<br />
OK<br />
AT$NWDW<br />
$NWDW: 2,10<br />
OK<br />
AT$NWDW=2,”cccccdddddeeeee”,1<br />
OK<br />
AT$NWDW<br />
$NWDW: 2,25<br />
OK<br />
2. Set data format to text mode.<br />
3. Write 10 bytes data into TX-buffer.<br />
4. Query length of stored data in<br />
TX-buffer.<br />
5. Write 15 bytes data into TX-buffer.<br />
(append mode)<br />
6. Query length of stored data in<br />
TX-buffer.<br />
M8-21-0012-108 - 13 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
3.5 $NWDR: Read data from the RX-buffer<br />
This command is used to read data from the RX-buffer.<br />
Before executing $NWDR on a session, the session must be opened.<br />
($NWSO: ,1)<br />
Every session has its own RX-buffer. The size of a RX-buffer is 1470 bytes. The data<br />
stored in RX-buffer will not be influenced when executing $NWCN. All data stored in<br />
RX-buffer will be cleared when the session is closed.<br />
The read command returns the current length of stored data in RX-buffer of all<br />
opened sessions.<br />
Syntax<br />
AT$NWDR=,<br />
Response(s) $NWDR: ,,[,]<br />
OK<br />
+CME ERROR: <br />
AT$NWDR<br />
Response(s) $NWDR: ,0,<br />
[$NWDR: ,0,]<br />
…<br />
OK<br />
Parameter(s)<br />
<br />
(M2M session identifier) Specifies a particular M2M Numeric<br />
session.<br />
1-5 Support at most 5 sessions.<br />
The length of received data. Numeric<br />
0-1470<br />
The length of total data in the RX-buffer. Numeric<br />
0-1470<br />
A string parameter read from the RX-buffer.<br />
Max length is 1470.<br />
String<br />
M8-21-0012-108 - 14 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
Read data (HEX mode)<br />
AT$NWDF=1,0<br />
OK<br />
$NWRX: 1,10,10<br />
Example(s)<br />
(In the beginning, length of stored data in<br />
RX-buffer is 0)<br />
1. Set data format to HEX mode<br />
2. (URC) Receive 1 st data from server (10<br />
bytes)<br />
(the content of new received data:<br />
“11111aaaaa”)<br />
AT$NWDR= 1,10<br />
$NWDR: 1,10,0,”31313131316161616161”<br />
OK<br />
Read data (text mode)<br />
AT$NWDF=1,1<br />
OK<br />
$NWRX: 1,15,15<br />
AT$NWDR=1,10<br />
$NWDR: 1,10,5,“aaaaabbbbb”<br />
OK<br />
$NWRX: 1,25,30<br />
AT$NWDR=1,10<br />
$NWDR: 1,10,20,”ccccc11111”<br />
OK<br />
AT$NWDR=1,1470<br />
$NWDR: 1,20,0,”22222333334444455555”<br />
OK<br />
Query remain data length in RX-buffer<br />
$NWRX: 1,20,20<br />
3. Request read data (10 bytes)<br />
(In the beginning, length of stored data in<br />
RX-buffer is 0)<br />
1. Set data format to text mode<br />
2. (URC) Receive 1 st data from server (15<br />
bytes)<br />
(the content of new received data:<br />
“aaaaabbbbbccccc”)<br />
3. Request read data (10 bytes)<br />
4. (URC)Receive 2 nd data from server (25<br />
bytes)<br />
(the content of new received data:<br />
“1111122222333334444455555”)<br />
5. Request read data (10 bytes)<br />
6. Request read data.<br />
(request 1470 bytes, but only 20 bytes in<br />
RX-buffer)<br />
(In the beginning, length of stored data in<br />
RX-buffer is 0)<br />
1. (URC) Receive data from server (20<br />
bytes)<br />
M8-21-0012-108 - 15 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
(the content of new received data:<br />
“12345123451234512345”)<br />
AT$NWDR= 1,0<br />
$NWDR: 1,0,17<br />
OK<br />
2. Query length of stored data in RX-buffer<br />
of session-1.<br />
M8-21-0012-108 - 16 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
3.6 $NWCN: Establish or close the connection to a server<br />
This command is used to establish or close the connection to a server.<br />
Before executing $NWCN on a session, the session must be opened.<br />
($NWSO: ,1)<br />
When execute $NWCN:<br />
If server type is TCP server, AT$NWCN will establish the connection to a TCP server<br />
actually.<br />
If server type is UDP server, AT$NWCN just records remote IP & port for preparing<br />
to send data to a UDP server.<br />
When a connection is established, $NWTX & $NWRX are ready to use on this session.<br />
The read command returns the current connection state of all opened sessions.<br />
Syntax<br />
AT$NWCN=,[,,,]<br />
(if connect to M2M server)<br />
AT$NWCN =,1,,,<br />
(if disconnect to M2M server)<br />
AT$NWCN =,0<br />
Response(s) OK<br />
+CME ERROR: <br />
AT$NWCN<br />
Response(s) $NWCN: ,,,,<br />
[$NWCN: ,,,,]<br />
…<br />
OK<br />
AT$NWCN=<br />
Response(s) $NWCN: (list of supported s),(list of supported s),(list<br />
of supported s)<br />
OK<br />
Unsolicited Result Codes<br />
When connection is established successfully:<br />
$NWCN: ,1<br />
When connection with server is closed or becomes unworkable:<br />
$NWCN: ,0<br />
M8-21-0012-108 - 17 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
Parameter(s)<br />
<br />
(M2M session identifier) Specifies a particular M2M Numeric<br />
session.<br />
1-5 Support at most 5 sessions.<br />
State of M2M connection Numeric<br />
0 Disconnection<br />
1 Connection<br />
2 Connection is being established or being closed.<br />
Protocol of M2M connection Numeric<br />
0 TCP connection<br />
1 UDP connection<br />
Ip address of the remote server String<br />
Port of the remote server Numeric<br />
Example(s)<br />
Connect to a server<br />
AT$NWACT=1,”internet”<br />
OK<br />
AT$NWSO=1,1<br />
OK<br />
AT$NWCN=1,1,0,”111.222.333.444”,1234<br />
OK<br />
AT$NWCN<br />
$NWCN:1,2<br />
OK<br />
$NWCN:1,1<br />
AT$NWCN<br />
$NWCN: 1,1,0,”111.222.333.444”,1234<br />
OK<br />
AT$NWCN=1,0<br />
OK<br />
$NWCN:1,0<br />
AT$NWCN<br />
$NWCN: 1,0<br />
OK<br />
1. Activate M2M with APN<br />
2. Open session-1<br />
3. Request module to connect to a TCP<br />
server on session-1.<br />
4. Query state of connection.<br />
(Because the connection establishment<br />
is not finished, the M2M connection<br />
state is 2)<br />
5. (URC) Connection is established<br />
successfully. Session-1 is ready to<br />
transmit data.<br />
6. Query connection state and connection<br />
information of all opened sessions.<br />
7. Request module to close the connection<br />
to the server on session-1.<br />
8. (URC) Closing connection is finished.<br />
9. Query state of connection.<br />
M8-21-0012-108 - 18 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
3.7 $NWTX: Send data to a server<br />
This command is used to send data to a server.<br />
Before executing “$NWTX”, the server must be connected. ($NWCN: ,1)<br />
The can be omitted. In this case, the default of is 0.<br />
The TX-buffer is a memory pool with 1470 bytes.<br />
Syntax<br />
AT$NWTX=,[,]<br />
Response(s) OK<br />
+CME ERROR: <br />
AT$NWTX=<br />
Response(s) $NWTX: (list of supported s),,(list of supported s)<br />
OK<br />
Unsolicited Result Codes<br />
When all sent data bytes are acknowledged from the TCP server:<br />
(only for TCP connection)<br />
$NWTX: ,0<br />
Parameter(s)<br />
<br />
(M2M session identifier) Specifies a particular M2M<br />
session.<br />
1-5 Support at most 5 sessions.<br />
A string parameter which is sent to the server.<br />
Numeric<br />
String<br />
If $NWDF is text mode:<br />
The maximum length of is 600. The<br />
content of must be visible character<br />
(ASCII 20~7E), but no semicolon(;) and double<br />
quote(").<br />
If $NWDF is HEX mode:<br />
The maximum length of is 600. Only<br />
characters '0'..'9', 'A'..F' and 'a'..'f' are valid.<br />
<br />
0 Send to the server.<br />
1 Send all stored data in TX-buffer to the server.<br />
In this mode, must be omitted.<br />
Numeric<br />
M8-21-0012-108 - 19 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
Example(s)<br />
Send data to a UDP server (HEX mode)<br />
AT$NWTX=1,"313131323232"<br />
OK<br />
AT$NWTX=1,"333333343434"<br />
OK<br />
(Assume the connection is established,<br />
and the data format is HEX mode)<br />
1. Send data to the server.<br />
(server will receive “111222”)<br />
2. Send data to the server.<br />
(server will receive “333444”)<br />
Send data to a TCP server (text mode)<br />
AT$NWTX=1,"aaabbb"<br />
OK<br />
$NWTX:1,0<br />
AT$NWTX=1,"cccddd"<br />
OK<br />
$NWTX:1,0<br />
(Assume the connection is established,<br />
and the data format is text mode)<br />
1. Request to send data to the server.<br />
2. (URC) The TCP server received<br />
“aaabbb” and sent acknowledgment<br />
back. <strong>Qisda</strong> module receives the<br />
acknowledgment.<br />
3. Request to send data to the server.<br />
4. (URC) <strong>Qisda</strong> module receives the<br />
acknowledgment of all sent data from<br />
TCP server.<br />
Send data to a TCP server speedily (text mode)<br />
(Assume the connection is established,<br />
and the data format is text mode)<br />
AT$NWTX=1,"aaabbb"<br />
OK<br />
(0.7 sec )<br />
AT$NWTX=1,"cccddd"<br />
OK<br />
1. Request to send data to the server.<br />
2. <strong>Qisda</strong> module not receives the<br />
acknowledgment from TCP server<br />
yet.<br />
3. Request to send data to the server.<br />
(0.7 sec )<br />
AT$NWTX=1,"eeefff"<br />
OK<br />
$NWTX:1,0<br />
4. Request to send data to the server.<br />
5. (URC) <strong>Qisda</strong> module receives the<br />
acknowledgment of all sent data from<br />
TCP server.<br />
M8-21-0012-108 - 20 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
Send large size data to a server from TX-buffer (text mode)<br />
(Assume the connection is established,<br />
and the data format is text mode)<br />
AT$NWDW=1,"1111111111222222222233333<br />
3333344444444445555555555666666666677<br />
7777777788888888889999999999000000000<br />
0111111111122222222223333333333444444<br />
4444555555555566666666667777777777888<br />
8888888999999999900000000001111111111<br />
2222222222333333333344444444445555555<br />
5556666666666777777777788888888889999<br />
9999990000000000111111111122222222223<br />
3333333334444444444555555555566666666<br />
6677777777778888888888999999999900000<br />
0000011111111112222222222333333333344<br />
4444444455555555556666666666777777777<br />
7888888888899999999990000000000111111<br />
1111222222222233333333334444444444555<br />
5555555666666666677777777778888888888<br />
99999999990000000000",0<br />
OK<br />
AT$NWDW=1,"1111111111222222222233333<br />
3333344444444445555555555666666666677<br />
7777777788888888889999999999000000000<br />
0111111111122222222223333333333444444<br />
4444555555555566666666667777777777888<br />
888888899999999990000000000",1<br />
OK<br />
AT$NWDW<br />
$NWDW: 1,800<br />
OK<br />
AT$NWTX=1,,1<br />
OK<br />
$NWTX:1,0<br />
AT$NWDW<br />
$NWDW: 1,0<br />
OK<br />
1. Write 600 bytes data into TX-buffer.<br />
2. Write next 200 bytes data into<br />
TX-buffer.<br />
3. Query length of data stored in<br />
TX-buffer.<br />
4. Send all 800 bytes data in TX-buffer<br />
to the server.<br />
5. (URC) <strong>Qisda</strong> module receives the<br />
acknowledgment of all sent data from<br />
TCP server.<br />
6. TX-buffer is clear.<br />
M8-21-0012-108 - 21 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
3.8 $NWRX: Indication of receiving data<br />
This command is an unsolicited result code. It is indicated when the server send data<br />
to the module.<br />
When RX data is received, it will be stored in the RX-buffer. Every session has its own<br />
Rx-buffer. The size of a RX-buffer is 1470 bytes.<br />
When new data is received, front part of old data will be discarded if RX-buffer’s free<br />
space is not enough.<br />
Syntax<br />
Unsolicited Result Codes<br />
$NWRX: ,,<br />
Parameter(s)<br />
<br />
(M2M session identifier) Specifies a particular M2M Numeric<br />
session.<br />
1-5 Support at most 5 sessions.<br />
The length of received data. Numeric<br />
1-1470<br />
The length of total data in the RX-buffer. Numeric<br />
0-1470<br />
M8-21-0012-108 - 22 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
Example(s)<br />
(In the beginning, data in RX-buffer is 0)<br />
(buffer size: 1470 bytes)<br />
$NWRX: 1,300,300<br />
1. Receive 1st data from server (300 bytes)<br />
$NWRX: 1,400,700<br />
2. Receive 2nd data from server (400 bytes)<br />
$NWRX: 1,500,1200<br />
3. Receive 3rd data from server (500 bytes)<br />
$NWRX: 1,500,1470<br />
4. Receive 4th data from server (500 bytes)<br />
M8-21-0012-108 - 23 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
4 Complete Examples<br />
4.1 Example 1: transmit UCP data (HEX mode)<br />
AT+CFUN=1<br />
OK<br />
AT+COPS=0<br />
OK<br />
AT+CGATT=1<br />
OK<br />
AT$NWACT=1,"INTERNET" // Note: "INTERNET" is a example APN<br />
OK<br />
AT$NWSO=1,1<br />
OK<br />
AT$NWCN=1,1,1,"168.95.100.100",3000<br />
OK // Not really connect to UDP server, just record remote IP & port for preparing to send<br />
data to a UDP server.<br />
$NWCN:1,1 // (URC) Connection is established successfully. This session is ready to transmit<br />
data.<br />
AT$NWTX=1,"5544502074657374" // "UDP test"<br />
OK<br />
(Server receives "UDP test" and responses "Data received!")<br />
$NWRX: 1,14,14 // (URC, module receives 14 bytes data<br />
AT$NWDR=1,14<br />
$NWDR: 1,14,0,"4461744120726563656976656421" // "Data received!"<br />
OK<br />
M8-21-0012-108 - 24 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
4.2 Example 2: transmit TCP data (text mode)<br />
AT+CFUN=1<br />
OK<br />
AT+COPS=0<br />
OK<br />
AT+CGATT=1<br />
OK<br />
AT$NWACT=1,"INTERNET"<br />
OK<br />
AT$NWSO=1,1<br />
OK<br />
AT$NWDF=1,1<br />
OK<br />
AT$NWCN=1,1,0,"168.95.100.100",5000<br />
OK<br />
$NWCN:1,1 // (URC) Connection is established successfully. This session is ready to transmit<br />
data.<br />
AT$NWTX=1,"TCP test 1"<br />
OK<br />
(Server receives "TCP test 1")<br />
$NWTX:1,0 // (URC) Module receives the acknowledgment of all sent data from TCP server.<br />
(Server responses "10 bytes data received!")<br />
M8-21-0012-108 - 25 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
$NWRX: 1,23,23 // (URC, module receives 23 bytes data<br />
AT$NWDR=1,23<br />
$NWDR: 1,23,0,"10 bytes data received!"<br />
OK<br />
AT$NWTX=1,"TCP test 2"<br />
OK<br />
(Server receives "TCP test 2")<br />
$NWTX:1,0 // (URC) Module receives the acknowledgment of all sent data from TCP server.<br />
(Server responses "10 bytes data received!")<br />
$NWRX: 1,23,23 // (URC, module receives 23 bytes data<br />
AT$NWDR=1,23<br />
$NWDR: 1,23,0,"10 bytes data received!"<br />
OK<br />
M8-21-0012-108 - 26 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
4.3 Example 3: send TCP data speedily (text mode)<br />
AT+CFUN=1<br />
OK<br />
AT+COPS=0<br />
OK<br />
AT+CGATT=1<br />
OK<br />
AT$NWACT=1,"INTERNET"<br />
OK<br />
AT$NWSO=1,1<br />
OK<br />
AT$NWDF=1,1<br />
OK<br />
AT$NWCN=1,1,0,"168.95.100.100",5000<br />
OK<br />
$NWCN:1,1 // (URC) Connection is established successfully. This session is ready to transmit<br />
data.<br />
AT$NWTX=1,"TCP data 1"<br />
OK<br />
(Sent next data before URC "$NWTX:1,0")<br />
AT$NWTX=1,"TCP data 2"<br />
OK<br />
(Sent next data before URC "$NWTX:1,0")<br />
AT$NWTX=1,"TCP data 3"<br />
M8-21-0012-108 - 27 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
OK<br />
(Sent next data before URC "$NWTX:1,0")<br />
AT$NWTX=1,"TCP data 4"<br />
OK<br />
(Server receives "TCP data 1", "TCP data 2", "TCP data 3" & "TCP data 4")<br />
$NWTX:1,0 // (URC) Module receives the acknowledgment of all sent data from TCP server.<br />
M8-21-0012-108 - 28 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
4.4 Example 4: send large size TCP data (text mode)<br />
AT+CFUN=1<br />
OK<br />
AT+COPS=0<br />
OK<br />
AT+CGATT=1<br />
OK<br />
AT$NWACT=1,"INTERNET"<br />
OK<br />
AT$NWSO=1,1<br />
OK<br />
AT$NWDF=1,1<br />
OK<br />
AT$NWCN=1,1,0,"168.95.100.100",5000<br />
OK<br />
$NWCN:1,1 // (URC) Connection is established successfully. This session is ready to transmit<br />
data.<br />
AT$NWDW=1,"1111111111222222222233333333334444444444555555555566666666667<br />
77777777788888888889999999999000000000011111111112222222222333333333344444<br />
44444555555555566666666667777777777888888888899999999990000000000111111111<br />
12222222222333333333344444444445555555555666666666677777777778888888888999<br />
99999990000000000111111111122222222223333333333444444444455555555556666666<br />
66677777777778888888888999999999900000000001111111111222222222233333333334<br />
44444444455555555556666666666777777777788888888889999999999000000000011111<br />
11111222222222233333333334444444444555555555566666666667777777777888888888<br />
899999999990000000000",0<br />
M8-21-0012-108 - 29 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
OK // Write 600 bytes data into TX-buffer. there are 600 bytes data in TX-buffer.<br />
AT$NWDW=1,"1111111111222222222233333333334444444444555555555566666666667<br />
77777777788888888889999999999000000000011111111112222222222333333333344444<br />
44444555555555566666666667777777777888888888899999999990000000000111111111<br />
12222222222333333333344444444445555555555666666666677777777778888888888999<br />
99999990000000000111111111122222222223333333333444444444455555555556666666<br />
66677777777778888888888999999999900000000001111111111222222222233333333334<br />
44444444455555555556666666666777777777788888888889999999999000000000011111<br />
11111222222222233333333334444444444555555555566666666667777777777888888888<br />
899999999990000000000",1<br />
OK // Write next 600 bytes data into TX-buffer. Totally, there are 1200 bytes data in TX-buffer.<br />
AT$NWDW=1,"1111111111222222222233333333334444444444555555555566666666667<br />
77777777788888888889999999999000000000011111111112222222222333333333344444<br />
44444555555555566666666667777777777888888888899999999990000000000111111111<br />
1222222222233333333334444444444555555555566666666667777777777",0<br />
OK // Write next 270 bytes data into TX-buffer. Totally, there are 1470 bytes data in TX-buffer.<br />
AT$NWTX=1,,1<br />
OK<br />
(Server receives 1470 bytes data)<br />
$NWTX:1,0 // (URC) Module receives the acknowledgment of all sent data from TCP server.<br />
M8-21-0012-108 - 30 - Version: 1.0.8 – 2009/03/13
M2M User Guide<br />
5 M2M specific error result code<br />
<br />
+CME ERROR: <br />
Syntax<br />
Result Code<br />
201 parameter not allowed<br />
202 GPRS suspended<br />
203 M2M already activated<br />
204 M2M not activated<br />
205 internal error<br />
206 M2M session is in use<br />
207 No free M2M session<br />
208 M2M session not open<br />
209 other process is <strong>ru</strong>nning<br />
210 connection already established<br />
211 connection not established<br />
212 TX-buffer space insufficient<br />
213 No data in TX-buffer<br />
214 data format error in hex mode<br />
215 GPRS busy temporarily<br />
216 address or port is already in use<br />
217 server cannot be reached<br />
218 connection is refused by peer<br />
219 size of the data is too large<br />
220 connection has been reset<br />
221 connection has been abort<br />
222 bearer has been disconnected<br />
223 GPRS not ready<br />
224 GPRS bear not ready<br />
225 a similar operation is in progress<br />
226 GPRS connection is already open<br />
M8-21-0012-108 - 31 - Version: 1.0.8 – 2009/03/13