M66-DS DSDS Application Note - orcam.eu › res › Datablad › quectel_m66ds_dsds... · M66-DS...
Transcript of M66-DS DSDS Application Note - orcam.eu › res › Datablad › quectel_m66ds_dsds... · M66-DS...
M66-DS DSDS
Application Note
GSM/GPRS Module Series
Rev. M66-DS_DSDS_Application_Note_V1.0
Date: 2016-04-05
www.quectel.com
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 1 / 23
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
Email: [email protected]
Or our local office. For more information, please visit:
http://www.quectel.com/support/salesupport.aspx
For technical support, or to report documentation errors, please visit:
http://www.quectel.com/support/techsupport.aspx
Or email to: [email protected]
GENERAL NOTES
QUECTEL OFFERS THE 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. TRANSMITTING, REPRODUCTION, DISSEMINATION AND EDITING OF THIS
DOCUMENT AS WELL AS UTILIZATION OF THE CONTENT 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. 2016. All rights reserved.
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 2 / 23
About the Document
History
Revision Date Author Description
1.0 2016-04-05 Thomas ZHANG Initial
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 3 / 23
Contents
About the Document ................................................................................................................................... 2
Contents ....................................................................................................................................................... 3
Table Index ................................................................................................................................................... 4
1 Introduction .......................................................................................................................................... 5
2 Rules of DSDS Command and URC ................................................................................................... 6
3 Examples of Common Procedures .................................................................................................... 7
3.1. Initialization after Power on ..................................................................................................... 7
3.2. Make a Voice Call .................................................................................................................... 8
3.3. Accept a Voice Call ................................................................................................................. 9
3.4. Attach GPRS ......................................................................................................................... 11
3.5. PPP Dialup ............................................................................................................................ 12
3.6. Establish TCP Connection..................................................................................................... 13
4 DSDS Commands Description ......................................................................................................... 16
4.1. AT Command Syntax ............................................................................................................. 16
4.2. Select the SIM Card .............................................................................................................. 16
4.2.1. AT+QDSEL Select the SIM Card ................................................................................. 16
4.3. Set/Query the Properties of the Dual SIMs ........................................................................... 17
4.3.1. AT+QDSIMEI Set the IMEI for Dual SIMs ................................................................... 17
4.3.2. AT+QDSQ Query the Signal Quality of Dual SIMs ..................................................... 18
4.3.3. AT+QDSREG Query the Network Registration Status of Dual SIMs .......................... 19
4.3.4. AT+QDSGREG Query the GPRS Status of Dual SIMs .............................................. 20
5 URC ...................................................................................................................................................... 21
6 Appendix A References ..................................................................................................................... 23
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 4 / 23
Table Index
TABLE 1: EXAMPLES OF AT COMMANDS ................................................................................................ 7
TABLE 2: URC LIST ................................................................................................................................... 21
TABLE 3: TERMS AND ABBREVIATIONS ................................................................................................ 23
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 5 / 23
1 Introduction
This document mainly introduces how to use the Dual SIM Dual Standby (DSDS) function of Quectel
M66-DS module.
M66-DS can be connected to two SIM cards simultaneously, and perform Location Update for them.
Working with two protocol stacks, the module can monitor the paging and do Cell Reselection
independently for the two SIMs. However, as the module has only one RF channel, any of these two SIMs
but only one of them can attach GPRS or stay in dedicated state for voice call or GPRS transferring. For
example, if the module is ringing from one SIM, the other will be disabled from making a MO or MT call; if
one SIM has already activated the PDP, the PDP activation request from the other SIM will be rejected.
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 6 / 23
2 Rules of DSDS Command and URC
The general rules of DSDS commands and URCs are illustrated below:
For URCs:
SIM1 uses the standard URC string, while SIM2 comes with a suffix “DS”. For example, “RING”
indicates SIM1 is ringing, while “RING DS” indicates SIM2 is ringing. Please refer to Chapter 5 for
detailed URCs.
For AT commands:
For most AT commands, the two SIMs share the same format. After using AT+QDESL command to
specify a SIM, subsequent commands will be applied for the specified SIM only.
Example
AT+QDSEL=1
OK
AT+CPIN?
+CPIN: READY
OK
AT+QDSEL=2
OK
AT+CPIN?
+CPIN: READY //Note: It‟s not +CPINDS:
OK
Some commonly used AT commands also have their dual-SIM version, so as to query the properties
of both SIMs. These commands can be executed on any of the SIM context. AT+QDSQ,
AT+QDSREG, and AT+QDSGREG commands are some of the examples.
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 7 / 23
3 Examples of Common Procedures
This chapter will describe how the module initializes the dual SIMs after power on and how to perform
some common procedures with the dual SIM cards, such as making a voice call, accepting a voice call,
GPRS attachment, PPP dialup and TCP connecting. In general, the target SIM card needs to be chosen
first before these procedures are performed. The command AT+QDSEL is used to select which SIM will
be used to perform these actions.
The following is an example list of the AT commands. For more details, please refer to Chapter 4.
Table 1: Examples of AT Commands
3.1. Initialization after Power on
After power on, the module will detect both SIM cards and initialize them if they are inserted. After the two
SIMs are initialized, the module will automatically register the network. Only SIM1 will attach the GPRS
automatically if both cards are inserted. When only SIM2 is inserted, SIM2 will also attach the GPRS
automatically. Some of the initialization URC will output in this stage.
RDY
+CFUN: 1 // Phone functionality status report based on SIM1 protocol stack
+CPIN: READY // SIM1 Ready
+CFUNDS: 1 // Phone functionality status report based on SIM2 protocol stack
AT Commands Description
AT+QDSEL Choose which SIM to be operated. All the following commands will target to
the selected SIM and protocol stack.
AT+QDSQ DS version of AT+CSQ. Query the signal quality of the two networks.
AT+QDSREG DS version of AT+CREG. Query the CS registration state of the two SIMs.
AT+QDSGREG DS version of AT+CGREG. Query the GPRS state of the two SIMs. Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 8 / 23
+CPINDS: READY // SIM2 Ready
Call Ready // SIM1‟s phonebook has been initialized
Call Ready DS // SIM2‟s phonebook has been initialized
SMS Ready // SIM1‟s SMS has been initialized
SMS Ready DS // SIM2‟s SMS has been initialized
AT+QDSREG?
+QDSREG: 1,0,1 // Query the registration status. Both are registered.
+QDSREG: 2,0,1
OK
AT+QDSGREG?
+QDSGREG: 1,0,1 // Query the GPRS status. Only SIM1 is auto attached.
+QDSGREG: 2,0,0
OK
3.2. Make a Voice Call
Call Ready
Call Ready DS
AT+QDSEL?
+QDSEL: 1,1,1
OK
AT+QDSREG?
+QDSREG: 1,0,1
+QDSREG: 2,0,2
OK
AT+QDSREG?
+QDSREG: 1,0,1
+QDSREG: 2,0,1 // Both are registered.
OK
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 9 / 23
AT+QDSQ
+QDSQ: 1,26,0
+QDSQ: 2,26,0
OK
ATD10086; // Dial with SIM1
OK
AT+CLCC
+CLCC: 1,0,0,0,0,"10086",129,""
OK
ATH
OK
AT+QDSEL=2 // Select SIM2
OK
AT+QDSEL?
+QDSEL: 2,1,1
OK
ATD10086; // Dial with SIM2
OK
AT+CLCC
+CLCC: 1,0,0,0,0,"10086",129,""
OK
ATH
OK
3.3. Accept a Voice Call
AT+QDSEL?
+QDSEL: 1,1,1 // In SIM 1 context
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 10 / 23
OK
RING DS // Incoming call from SIM2
RING DS
ATA
+CME ERROR: 3 // Will fail if accept in SIM1 context
RING DS
AT+QDSEL=2 // Select to operate on SIM2 context
OK
RING DS
ATA // Accept the call
OK
AT+CLCC
+CLCC: 1,1,0,0,0,"18955125763",129,""
OK
NO CARRIER DS // Hung up by remote
AT+QDSEL=1
OK
AT+QDSEL?
+QDSEL: 1,1,1
OK
RING // Incoming call from SIM 1
RING
ATA
OK
AT+CLCC
+CLCC: 1,1,0,0,0,"18955125763",129,""
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 11 / 23
OK
NO CARRIER // SIM1‟s call is hung up by remote
3.4. Attach GPRS
AT+QDSEL?
+QDSEL: 1,1,1
OK
AT+QDSGREG?
+QDSGREG: 1,0,1 // SIM1 is GPRS attached; SIM2 is detached.
+QDSGREG: 2,0,0
OK
AT+CGATT?
+CGATT: 1 // SIM1 context. CGATT is 1.
OK
AT+QDSEL=2 // Select SIM2
OK
AT+CGATT?
+CGATT: 0
OK
AT+CGATT=1
+CME ERROR: 100 // Failed because SIM1 is already attached. Only one is allowed to be attached.
AT+QDSEL=1 // Select SIM1 to detach first
OK
AT+CGATT=0 // Must detach first. Only one SIM can be attached.
OK
AT+CGATT?
+CGATT: 0
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 12 / 23
OK
AT+QDSGREG?
+QDSGREG: 1,0,0
+QDSGREG: 2,0,0
OK
AT+QDSEL=2 // Select SIM2 and attach
OK
AT+CGATT=1
OK
AT+CGATT?
+CGATT: 1
OK
AT+QDSGREG?
+QDSGREG: 1,0,0
+QDSGREG: 2,0,1
OK
3.5. PPP Dialup
// Take SIM1 for example. Now SIM2 is attached. First detach it; then attach SIM1; and finally dial up PPP.
AT+QDSGREG?
+QDSGREG: 1,0,0
+QDSGREG: 2,0,1
OK
AT+QDSEL=2
OK
AT+CGATT=0
OK
AT+QDSEL=1
OK
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 13 / 23
AT+CGATT=1
OK
AT+CGATT?
+CGATT: 1
OK
// Can continue the PPP dialup process …
3.6. Establish TCP Connection
AT+QDSEL?
+QDSEL: 1,1,1
OK
AT+QDSGREG?
+QDSGREG: 1,0,1 // SIM1 is GPRS attached; SIM2 is detached.
+QDSGREG: 2,0,0
OK
AT+CGATT?
+CGATT: 1 // SIM1 context. CGATT is 1.
OK
AT+QIREGAPP
OK
AT+QIACT
OK
AT+QIOPEN=”TCP”,”220.180.239.201”,8047
OK
CONNECT OK
AT+QISEND //Send data to the remote server
>0123456789 // „>‟ from the UART indicates the following input data is considered as the data to
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 14 / 23
be sent. After receiving „>‟, input data (“0123456789”)
<Ctrl+Z> //After data input, use <Ctrl+Z> to send the data
SEND OK //SEND OK means the data has been sent.
AT+QISACK
+QISACK: 11,11,0
OK
AT+QICLOSE
CLOSE OK //Close the SIM1 TCP connection, and then detach it.
AT+QIDEACT
DEACT OK
AT+CGATT=0
OK
AT+QDSEL=2 // Select SIM2 and attach
OK
AT+CGATT=1
OK
AT+CGATT?
+CGATT: 1 // SIM2 context. CGATT is 1.
OK
AT+QDSGREG?
+QDSGREG: 1,0,0
+QDSGREG: 2,0,1 // SIM1 is GPRS detached; SIM2 is attached.
OK
AT+QIREGAPP
OK
AT+QIACT
OK
AT+QIOPEN=”TCP”,”220.180.239.201”,8047
OK
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 15 / 23
CONNECT OK
AT+QISEND //Send data to the remote server
>9876543210 // „>‟ from the UART indicates the following input data is considered as the data to
be sent. After receiving „>‟, input data (“9876543210”)
<Ctrl+Z> //After data input, use <Ctrl+Z> to send the data
SEND OK //SEND OK means the data has been sent.
AT+QISACK
+QISACK: 11,11,0
OK
AT+QICLOSE
CLOSE OK //Close the SIM2 TCP connection, and then detach it.
AT+QIDEACT
DEACT OK
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 16 / 23
4 DSDS Commands Description
4.1. AT Command Syntax
4.2. Select the SIM Card
If one action is targeted to a specific SIM, the module needs switching to this SIM first. Command
AT+QDSEL can be used for SIM card selection. Details are illustrated below.
4.2.1. AT+QDSEL Select the SIM Card
AT+QDSEL is used to specify which SIM the subsequent commands will apply to.
Test Command AT+<x>=? This command returns the list of parameters and value ranges
set by the corresponding Write Command or internal processes.
Read Command AT+<x>? This command returns the currently set value of the parameter
or parameters.
Write Command AT+<x>=<…> This command sets the user-definable parameter values.
Execution
Command AT+<x>
This command reads non-variable parameters affected by
internal processes in the GSM engine.
AT+QDSEL Select the SIM Card
Test Command
AT+QDSEL=?
Response
+QDSEL: (list of supported <sim>s)
OK
Read Command
AT+QDSEL?
Response
+QDSEL: <sim>,<sim1_status>,<sim2_status>
OK
Write Command
AT+QDSEL=<sim>
Response
OK
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 17 / 23
Parameter
4.3. Set/Query the Properties of the Dual SIMs
Quectel provides some AT commands to set or query some common properties of dual SIMs easily,
without the need of switching between them.
4.3.1. AT+QDSIMEI Set the IMEI for Dual SIMs
AT+QDSIMEI is used to set the individual IMEI for each SIM. By default, both IMEIs are written into the
module from factory. It is suggested not to change the default IMEI unless it is necessary.
Reference
<sim> Which SIM card
1 SIM slot 1
2 SIM slot 2
<sim1_status> SIM1 status
0 Not inserted
1 Inserted.
<sim2_status> SIM2 status
0 Not inserted
1 Inserted.
<sim> number is identified by hardware SIM slot number.
AT+QDSIMEI Set the IMEI for Dual SIMs
Test Command
AT+QDSIMEI=?
Response
+QDSIMEI: (list of supported <sim>s),“imei”
OK
Read Command
AT+QDSIMEI?
Response
+QDSIMEI: <sim>,“imei1”
+QDSIMEI: <sim>,“imei2”
OK
NOTE
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 18 / 23
Parameter
The input IMEI must be valid. Refer to GSM 02.16 for the IMEI validation check.
4.3.2. AT+QDSQ Query the Signal Quality of Dual SIMs
AT+QDSQ is used to query the signal quality of dual SIM cards.
Parameter
Write Command
AT+QDSIMEI =<sim>,”imei”
Response
OK
Reference
<sim> SIM card number
1 SIM1
2 SIM2
“imei” IMEI string
“imei1” IMEI for SIM1 protocol stack
“imei2” IMEI for SIM2 protocol stack
AT+QDSQ Query the Signal Quality of Dual SIMs
Test Command
AT+QDSQ=?
Response
OK
Execute Command
AT+QDSQ
Response
+QDSQ: <sim>,<rssi1>,<ber1>
+QDSQ: <sim>,<rssi2>,<ber2>
OK
Reference
<sim> SIM card number
1 SIM1
NOTE
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 19 / 23
4.3.3. AT+QDSREG Query the Network Registration Status of Dual SIMs
AT+QDSREG is used to query the network registration status of dual SIM cards.
Parameter
2 SIM2
<rssi1>,<rssi2> Signal strength for both protocols
0 113 dBm or less
1 111 dBm
2...30 109... 53 dBm
31 51 dBm or greater
99 Not known or not detectable
<ber1>,<ber2> Bit error rate for both protocols (in percent):
0...7 As RXQUAL values in the table in GSM 05.08 subclause 8.2.4
99 Not known or not detectable
AT+QDSREG Query the Network Registration Status of Dual SIMs
Test Command
AT+QDSREG=?
Response
OK
Read Command
AT+QDSREG?
Response
+QDSREG: <sim>,<n>,<stat>[,<lac>,<ci>]
+QDSREG: <sim>,<n>,<stat>[,<lac>,<ci>]
OK
Reference
<sim> 1 Status of SIM1
2 Status of SIM2
<n> 0 Disable network registration unsolicited result code
1 Enable network registration unsolicited result code
2 Enable network registration unsolicited result code with location information
<stat> 0 Not registered, ME is not currently searching a new operator to register to
1 Registered, home network
2 Not registered, but ME is currently searching a new operator to register to
3 Registration denied
4 Unknown
5 Registered, roaming
<lac> String type; two byte location area code in hexadecimal format
<ci> String type; two byte cell ID in hexadecimal format
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 20 / 23
4.3.4. AT+QDSGREG Query the GPRS Status of Dual SIMs
AT+QDSGREG is used to query the GPRS status of dual SIM cards.
Parameter
AT+QDSGREG Query the GPRS Status of Dual SIMs
Test Command
AT+QDSGREG=?
Response
OK
Read Command
AT+QDSGREG?
Response
+QDSGREG: <sim>,<n>,<stat>[,<lac>,<ci>]
+QDSGREG: <sim>,<n>,<stat>[,<lac>,<ci>]
OK
Reference
<sim> SIM card number
1 Query SIM1
2 Query SIM2
<n> 0 Disable network registration unsolicited result code
1 Enable network registration unsolicited result code
2 Enable network registration and location information unsolicited result code
<stat> 0 Not registered, ME is not currently searching a new operator to register to
1 Registered, home network
2 Not registered, but ME is currently searching a new operator to register to
3 Registration denied
4 Unknown
5 Registered, roaming
<lac> String type; two byte location area code in hexadecimal format (e.g. "00C3" equals 195 in
decimal)
<ci> String type; two bytes cell ID in hexadecimal format
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 21 / 23
5 URC
“DS” is suffixed on the URC to indicate that it‟s for SIM2. The URCs are listed in the following table.
Table 2: URC List
Category SIM 1 URC SIM 2 URC Meaning
SIM
+CFUN: +CFUNDS: Phone functionality status report
Call Ready Call Ready DS PHB is ready
+CPIN: +CPINDS: SIM card pin state
SMS Ready SMS Ready DS SMS is initialized
SMS
+CDS: +CDSDS: SMS delivery status report is received and
output directly
+CMTI: +CMTIDS: New message is received, and saved to
memory
+CMT: +CMTDS: New short message is received and output
directly to TE
Network
+CREG: +CREGDS: Indicate registration status of the ME
+CGREG: +CGREGDS: Network registered
+CSQN: +CSQNDS: Signal quality change
Call
+QGURC: +QGURCDS: Unsolicited result code follows particular call
state transition
RING RING DS Indicates an incoming call
BUSY BUSY DS Busy
NO ANSWER NO ANSWER DS No answer
NO CARRIER NO CARRIER DS Call is hung up
NO DIALTONE NO DIALTONE DS No dial tone
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 22 / 23
+COLP: +COLPDS: The presentation of the COL (connected
line) at the TE for a mobile originated call
+CLIP: +CLIPDS: Mobile terminating call indication
+CRING: +CRINGDS:
An incoming call is indicated to the TE with
unsolicited result code instead of the normal
RING
+CCWA: +CCWADS: Call waiting indication
MO RING MO RING DS MO call ringing
MO
CONNECTED MO CONNECTED DS MO call connected
STK +STKPCI: +STKPCIDS: STK data notification
NITZ +QNITZ: +QNITZDS: NITZ notification
Quectel
Confidentia
l
GSM/GPRS Module Series M66-DS DSDS Application Note
M66-DS_DSDS_Application_Note Confidential / Released 23 / 23
6 Appendix A References
Table 3: Terms and Abbreviations
Abbreviation Description
DSDS Dual SIM Dual Standby
DS Dual SIM
GPRS General Packet Radio Service
ME Mobile Equipment
MO Mobile Originated
MS Mobile Station
MT Mobile Terminated
NITZ Network Identity and Time Zone
PDP Packet Data Protocol
PHB Phonebook
PPP Point to Point Protocol
SIM Subscriber Identity Module
STK SIM Tool Kit
TCP Transmission Control Protocol
TE Terminal Equipment
UART Universal Asynchronous Receiver/Transmitter
URC Unsolicited Result Code
Quectel
Confidentia
l