AT Command Manual For ZTE Corporation`s

Add to my manuals
78 Pages

advertisement

AT Command Manual For ZTE Corporation`s | Manualzz

GSM Module

AT Command Manual

For ZTE Corporation

’s MG2639 Modules

Version: V2.0

ZTE CORPORATION

GSM Module

Copyright Statement

Copyright

© 2011 by ZTE Corporation

All rights reserved.

No part of this publication may be excerpted, reproduced, translated or utilized in any form or by any means, electronic or mechanical, including photocopying and microfilm, without the prior written permission of ZTE Corporation. is the registered trademark of ZTE Corporation. All other trademarks appeared in this manual are owned by the relevant companies.

ZTE Corporation reserves the right to make modifications on print errors or update specifications in this manual without prior notice.

ZTE Corporation keeps the right to make the final explanation to this manual.

1

GSM Module

With strong technical force, ZTE Corporation can provide CDMA/GPRS module customers with the following all-around technical support:

1. Provide complete technical documentation;

2. Provide the development board used for R&D, test, production, after-sales, etc.

3. Provide evaluations and technical diagnosis for principle diagram, PCB, test scenarios;

4. Provide test environment;

ZTE Corporation provides customers with onsite supports, and also you could get supports through telephone, website, instant communication, E-mail, etc.

The module website module.ztemt.com.cn provides the relevant industry information and module technical documentation. The authorized module customers could download the latest technical documentation from our website. If you have more requirements, you could send an E-mail to [email protected]

. You can also call us at 0755-86360280 for technical support.

2

GSM Module

Preface

Target Readers

This manual is mainly applicable for the following engineers: l System designing engineers l Hardware engineers l Software engineers l Test engineers

Update History

l V1.1

Completely follow MG2636 AT command Set user manual. l V1.2

Completely follow

ME3000_V2

AT command Set user manual.

l V1.3

Modify the previous documents and make them further standardized;

Delete Relay station Command and Transparent transmission Command;

3

GSM Module

Contents

1 General Description ...................................................................................................... 8

1.1

Description of AT Commands ........................................................................................................ 8

1.1.1

Type of AT Commands ....................................................................................................... 8

1.1.2

Returned Syntax of AT Commands .................................................................................... 8

1.1.3

AT Command Syntax .......................................................................................................... 8

1.2

Abbreviations ................................................................................................................................. 9

2 AT Commands ............................................................................................................. 12

2.1

Common Commands ................................................................................................................... 12

2.1.1

A/: repeat .......................................................................................................................... 12

2.1.2

ATA: answer ...................................................................................................................... 12

2.1.3

ATD: dial ........................................................................................................................... 12

2.1.4

ATDL: dial last .................................................................................................................. 13

2.1.5

ATE: enable ...................................................................................................................... 13

2.1.6

ATH: hang up .................................................................................................................... 13

2.1.7

ATI: Information ................................................................................................................ 14

2.1.8

ATQ: set whether or not to display the returned value. .................................................... 14

2.1.9

+++: switch from data mode to command mode .............................................................. 14

2.1.10

ATO: switch from command mode to data mode ............................................................. 14

2.1.11

ATP: pulse ........................................................................................................................ 15

2.1.12

ATS0: auto answer setting ................................................................................................ 15

2.1.13

+CRC: set ringer type ....................................................................................................... 15

2.1.14

+CLVL: volume level ......................................................................................................... 16

2.1.15

+CLIP: Calling Line Identification Presentation ................................................................ 16

2.1.16

+ZSETMUTE: mute control .............................................................................................. 17

2.1.17

+CIMI: International Mobile Identification ......................................................................... 17

2.1.18

+CGMR: get product version ............................................................................................ 17

2.1.19

+ECHO: echo remove ...................................................................................................... 17

2.1.20

+(C)GSN: get current IMEI ............................................................................................... 18

2.1.21

+ZVERS: get current software version ............................................................................. 18

2.1.22

+CLCK: lock ...................................................................................................................... 18

2.1.23

+CCFC: call forwarding number and conditions............................................................... 19

2.1.24

+CCWA: call waiting ......................................................................................................... 21

2.1.25

+CHLD: call hold .............................................................................................................. 22

2.1.26

*TSIMINS: check SIM card status .................................................................................... 22

2.1.27

+CPWD: change password .............................................................................................. 23

2.1.28

+CGMI: inquire manufacturer

’s information ..................................................................... 23

2.1.29

ATZ: reset ......................................................................................................................... 23

2.1.30

+CSCS: character set selection ....................................................................................... 24

2.1.31

+CLCC: check call status ................................................................................................. 24

2.2

DTMF Command ......................................................................................................................... 26

2.2.1

+VTS: send DTMF ............................................................................................................ 26

2.3

Network Service Command ......................................................................................................... 27

4

GSM Module

2.3.1

+CREG: network registration and roaming ...................................................................... 27

2.3.2

+COPS: network selection ............................................................................................... 27

2.4

Mobile Device Control and Status Report .................................................................................... 29

2.4.1

+CPAS: check module

’s status......................................................................................... 29

2.4.2

+CFUN: set module

’s function .......................................................................................... 29

2.4.3

+CMEE: mobile equipment errors .................................................................................... 29

2.4.4

+ZPWROFF: power off ..................................................................................................... 30

2.4.5

+CPIN: input PIN .............................................................................................................. 30

2.4.6

+CSQ: check signal strength ............................................................................................ 30

2.4.7

+CCLK: clock management .............................................................................................. 31

2.5

Message Service Command ........................................................................................................ 32

2.5.1

+CSCA: SMS center number ........................................................................................... 32

2.5.2

+CNMA: message acknowledgement .............................................................................. 32

2.5.3

+CMGF: SMS mode ......................................................................................................... 32

2.5.4

+CNMI: message indication ............................................................................................. 33

2.5.5

+CMGR: message read .................................................................................................... 35

2.5.6

+CMGW: message write .................................................................................................. 36

2.5.7

+CSMS: select SMS service ............................................................................................ 36

2.5.8

+CMGS: message send ................................................................................................... 37

2.5.9

+CPMS: preferred message storage ................................................................................ 38

2.5.10

+CMGD: message delete ................................................................................................. 39

2.5.11

+CMGL: message list ....................................................................................................... 40

2.5.12

+CMSS: messages saved in SIM card ............................................................................. 42

2.5.13

+ZSMGS: message full indication .................................................................................... 42

2.6

Phonebook Command ................................................................................................................. 43

2.6.1

+CPBS: phonebook storage ............................................................................................. 43

2.6.2

+CPBR: phonebook read ................................................................................................. 43

2.6.3

+CPBW: phonebook write ................................................................................................ 44

2.6.4

+CPBF: phonebook find ................................................................................................... 45

2.6.5

+CNUM: owner

’s number ................................................................................................. 46

2.7

Data Compression Command...................................................................................................... 47

2.7.1

+IFC: flow control ............................................................................................................. 47

2.7.2

&D: set DTR mode ........................................................................................................... 47

2.7.3

&C: set DCD mode ........................................................................................................... 47

2.7.4

+IPR: set module

’s baud rate ........................................................................................... 47

2.7.5

&F: restore factory settings .............................................................................................. 48

2.7.6

&W: save settings ............................................................................................................. 48

2.8

GPRS Command ......................................................................................................................... 49

2.8.1

+CGDCONT: set PDP ...................................................................................................... 49

2.8.2

+CGACT: activate/deactivate PDP ................................................................................... 49

2.8.3

+CGATT: set GPRS .......................................................................................................... 49

2.8.4

+CGCLASS : GPRS device class .................................................................................... 50

2.9

ZTE Exclusive Commands........................................................................................................... 51

2.9.1

+ZGPIO: read/write GPIO ................................................................................................ 51

2.9.2

+ZSTR: check module

’s status ......................................................................................... 51

5

GSM Module

2.9.3

+ZGETICCID: set ICCID .................................................................................................. 51

2.9.4

+ZCSQ: set auto display CSQ .......................................................................................... 52

2.9.5

+ZEDT: set DTR inspection mode .................................................................................... 52

2.9.6

+ZDSLEEP: 32KHz Deep sleep mode ............................................................................. 53

2.9.7

+CUSD: send USSD data ................................................................................................ 53

2.9.8

+ZRINGPINMODE: set RING PIN signal mode ............................................................... 55

2.10

Network Parameter Commands .................................................................................................. 56

2.10.1

+ZPNUM: set APN, username and password .................................................................. 56

2.10.2

+ZPPPOPEN: open GPRS connection ............................................................................ 56

2.10.3

+ZPPPCLOSE: close GPRS connection .......................................................................... 56

2.10.4

+ZIPGETIP: check current IP address ............................................................................. 56

2.10.5

+ZDNSSERV: set DNS IP address .................................................................................. 57

2.10.6

+ZDNSGETIP: obtain Internet Domain name

’s IP address ............................................. 57

2.11

TCP Link Commands ................................................................................................................... 58

2.11.1

+ZIPSETUP: Set up TCP server link ................................................................................ 58

2.11.2

+ZIPSEND: send TCP data to target address .................................................................. 58

2.11.3

+ZPPPSTATUS:check GPRS connection status ........................................................... 58

2.11.4

+ZIPCLOSE: close TCP link ............................................................................................. 59

2.11.5

+ZIPSTATUS:check current TCP link status .................................................................. 59

2.11.6

+ZIPRECV: receive data from current data link ............................................................... 59

2.12

UDP Link Commands .................................................................................................................. 60

2.12.1

+ZIPSETUPU: set up UDP server link ............................................................................. 60

2.12.2

+ZIPSENDU: send data to UDP server ............................................................................ 60

2.12.3

+ZIPSTATUSU:check UDP status ................................................................................. 60

2.12.4

+ZIPCLOSEU: close UDP link .......................................................................................... 61

2.12.5

+ZIPRECVU: receive UDP data ....................................................................................... 61

2.13

Server Commands ....................................................................................................................... 62

2.13.1

+ZTCPLISTEN: set port monitoring.................................................................................. 62

2.13.2

+ZTCPSENDP: send data through passively opened link ............................................... 62

2.13.3

+ZTCPCLOSEP: close monitored connection ................................................................. 63

2.13.4

+ZTCPRECV(P): receive data report ............................................................................... 63

2.13.5

+ZTCPSTATUSP: check passively opened link ............................................................... 64

2.13.6

+ZIPTIMEOUT: set the timeout for connecting the server & sending data ...................... 64

2.13.7

+ZTCPTIMEOUT: set the timeout for receiving data ........................................................ 65

2.14

FTP Commands ........................................................................................................................... 66

2.14.1

ZFTPLOGIN: log in FTP server ........................................................................................ 66

2.14.2

ZFTPTYPE: set FTP file type ........................................................................................... 66

2.14.3

ZFTPUPLOAD: upload files ............................................................................................. 67

2.14.4

ZFTPDNLOAD: download files ......................................................................................... 67

2.14.5

ZFTPDEL: delete files ...................................................................................................... 68

2.14.6

ZFTPQUIT: quit FTP ......................................................................................................... 69

2.15

Relevant Audio Commands ......................................................................................................... 70

2.15.1

+ZCALLTONE: set pick-up tone ....................................................................................... 70

2.15.2

+ZDTMFTONE: set ZDTMF tone ..................................................................................... 70

2.15.3

+SPEAKER: audio channel switch command .................................................................. 71

6

GSM Module

2.15.4

+ZMICGB: set MIC audio parameters .............................................................................. 71

3 Application Cases and Precautions ............................................................................. 74

3.1

SMS Application Case ................................................................................................................. 74

3.2

Phonebook Application Case ....................................................................................................... 75

7

GSM Module

1

General Description

1.1 Description of AT Commands

MG2639 provides AT command interfaces, through which the module could communicate with the external devices conveniently. The AT commands set provided by MG2639 module not only covers the standard GSM voice call and SMS applications, but adds some other commands based on GSM specification and some ZTE exclusive commands for users to use conveniently.

1.1.1 Type of AT Commands

As a standard interface, the returned values and syntax of AT commands are both fixed. As a whole, the AT commands could be divided into four types: l Without parameter: a type of simple commands; Syntax: AT[+|&]<command>,e.g.: AT+CSQ,

AT&W l Query: used to inquire the current setting value; Syntax: AT[+|&]<command>?, e.g.: AT+CNMI? l Help: used to list the possible parameters of the command; Syntax: AT[+|&]<command>=?, e.g.:

AT+CMGL=? l Parameter: a kind of mostly common syntax, which provides strong flexibility to the command,

Syntax: AT[+|&]<command>=<par1>,<par2>,<par3>

The returned values of this type of commands are all the same. This will be clarified in details later.

The basic frame of the returned value is:

<CR><LF><Response string><CR><LF>

<CR><LF><OK/ERROR>[ERROR INFO]<CR><LF>

1.1.2 Returned Syntax of AT Commands

The following describes the AT commands and returned descriptions supported by MG2639 module: l AT command returned syntax:

--<CR><LF><corresponding strings ><CR><LF>

--An exceptional case: e.g.: AT+ZPOWEROFF, directly return with

“OK” l AT command status report (OK, ERROR):

--If there is error in AT command syntax, return with

“ERROR”;

--If AT command executes successfully, return with

“OK”;

1.1.3 AT Command Syntax

l AT command starts with “AT” and ends with <CR>; l After the module runs, the serial port default setting will be: 8-digit data bit, 1-digit stop bit, no parity check, no CTS/RTS, data rate 115200bps.

8

GSM Module

D

DAI

DAC

DCE

DSP

DTE

DTMF

DTR

E

EFR

EGSM

EMC

EMI

ESD

ETS

B

BER

BTS

C

CDMA

CDG

CS

CSD

CPU

1.2 Abbreviations

A

ADC

AFC

AGC

ARFCN

ARP

ASIC

Analog-Digital Converter

Automatic Frequency Control

Automatic Gain Control

Absolute Radio Frequency Channel

Number

Antenna Reference Point

Application Specific Integrated

Circuit

F

FDMA

Bit Error Rate

Base Transceiver Station

Code Division Multiple Access

CDMA Development Group

Coding Scheme

Circuit Switched Data

Central Processing Unit

Digital Audio interface

Digital-to-Analog Converter

Data Communication Equipment

Digital Signal Processor

Data Terminal Equipment

Dual Tone Multi-Frequency

Data Terminal Ready

Enhanced Full Rate

Enhanced GSM

Electromagnetic Compatibility

Electro Magnetic Interference

Electronic Static Discharge

European Telecommunication

Standard

Frequency Division Multiple Access

9

ISO

ITU

PDU

PLL

PPP

R

RAM

RF

ROM

RMS

RTC

S

MMI

MS

P

PCB

PCL

PCS

L

LCD

LED

M

MCU

FR

G

GPRS

GSM

I

H

HR

IC

IMEI

GSM Module

Full Rate

General Packet Radio Service

Global Standard for Mobile

Communications

Half Rate

Integrated Circuit

International Mobile Equipment

Identity

International Standards Organization

International Telecommunications

Union

Liquid Crystal Display

Light Emitting Diode

Machine Control Unit

Man Machine Interface

Mobile Station

Printed Circuit Board

Power Control Level

Personal Communication System

Protocol Data Unit

Phase Locked Loop

Point-to-point protocol

Random Access Memory

Radio Frequency

Read-only Memory

Root Mean Square

Real Time Clock

10

SIM

SMS

SRAM

T

TA

TDMA

TE

U

UART

UIM

USB

V

VSWR

Z

ZTE

GSM Module

Subscriber Identification Module

Short Message Service

Static Random Access Memory

Terminal adapter

Time Division Multiple Access

Terminal Equipment also referred it as DTE

Universal asynchronous receiver-transmitter

User Identifier Management

Universal Serial Bus

Voltage Standing Wave Ratio

ZTE Corporation

11

GSM Module

2 AT Commands

2.1 Common Commands

2.1.1 A/: repeat

Description

Syntax

Example

This command is used to repeat the previous command.

A/

AT+CSQ

A/

AT+CMGS=

”13714393404”

>123

A/

>123

Inquire current signal strength

Repeat AT+CSQ command

Send a text message

Repeat AT+CMGS command

2.1.2 ATA: answer

Description This command is used to answer a call.

Syntax

Example

ATA

RING

ATA

An incoming call rings.

Answer the incoming call.

2.1.3 ATD: dial

Description

Syntax

Example

This command is used to originate a voice call, data and fax call.

ATD<string>;

ATD><mem><n>;

ATD><n>;

ATD>

”name”;

AT+CPBS="SM"

ATD13024540756;

AT+CPBS="SM"

ATD>2;

OK

ATD>SM1;

ATD13714393404;

Select SIM card phonebook as the current phonebook

Search the number from SIM card phonebook and dial

Select SIM card phonebook as the current phonebook

Search the second phone number in current phonebook

Dial the first number in SIM card phonebook

Directly dial the phone number

12

GSM Module

Parameters

ATD>

”name”;

Search the phone number with

“name” in

SIM card and nvram

<mem>: phonebook

“SM”: SIM card phonebook.

“ME”: local phonebook.

“LD”: last dialled calls in phonebook.

“MC”: missed calls

“RC”: received calls

<n>: the n-th option in phonebook.

<string>: the number of called party, e.g., *99#.

2.1.4 ATDL: dial last

Description

Syntax

Example

This command is used to dial the last outgoing number.

ATDL

ATD34394036;

OK

ATH

OK

ATDL

Dial 34394036

Hang up the call

Dial 34394036 again

2.1.5 ATE: enable

Description

Syntax

Example

Parameters

This command is used to enable echo display.

ATE<n>

ATE0 ATE0, don

’t display input command on the terminal OK

OK

ATE1, displays input command on the terminal

ATE1

OK

ATE1

OK

<n>=0 Disable echo display.

<n>=1 Enable echo display.

2.1.6 ATH: hang up

Description This command is used to hang up the call.

Syntax

Example

ATH

ATA

OK

Answer the call

13

GSM Module

ATH Hang up the call

2.1.7 ATI: Information

Description

Syntax

Example

This command is used to display the module manufacturer

’s information.

ATI

ATI Display the module manufacturer

’s information. ZTE Mobile LTD

GSM/GPRS Mobile Station

Revision: 1.0

OK

2.1.8 ATQ: set whether or not to display the returned value.

Description

Syntax

Example

This command is used to set whether or not to display the returned value.

ATQ<n>

Set the terminal displays the returned value ATQ0

OK

ATQ0

OK

ATQ1

OK

ATQ1ATQ1

Set the terminal doesn

’t display the returned value.

2.1.9 +++: switch from data mode to command mode

Description

Syntax

Example

This command is used to switch from data mode to command mode.

+++

ATD*99#

CONNECT

+++

……

AT

OK

Dial to enter data mode

Switch from data mode to command mode

2.1.10 ATO: switch from command mode to data mode

Description

Syntax

This command is used to switch from command mode to data mode.

ATO

14

GSM Module

Example ATD*99#

CONNECT

+++

……

ATO

……

Dial to enter GPRS data connection

Switch from data mode to command mode

Switch from command mode to data mode

2.1.11 ATP: pulse

Description

Syntax

Example

This command is used for pulse dialling.

ATP

ATP

OK

Set pulse dialling method

2.1.12 ATS0: auto answer setting

Description

Syntax

Example

Parameter

This command is used to control the module

’s auto answer mode.

ATS0=<value>

ATS0=2

OK

Auto answer after ringing twice

Check current settings ATS0?

2

OK

ATS0=0

OK

<value>: ringing times

Cancel auto answer

2.1.13 +CRC: set ringer type

Description This command is used to display the type of ringer.

Syntax

Example

AT+CRC=<num>

AT+CRC=1

OK

+CRING:VOICE

Parameters <num>:

0: Do not display the type of ringer

1: display the type of ringer

Descriptions of ringer type:

VOICE: Voice

Set RING as ringer type

Set CRC as ringer type

15

GSM Module

GPRS: GPRS service

FAX: Fax

2.1.14 +CLVL: volume level

Description

Syntax

Example

Parameters

This command is used to set the volume level of the speaker.

AT+CLVL=<level>

AT+CLVL=100

OK

Set current receiver volume as 100

AT+CLVL?

+CLVL:100

Check the current receiver volume

<level> ranging 0~100, the lower the level is, the smaller the volume is.

2.1.15 +CLIP: Calling Line Identification Presentation

Description

Syntax

Example

Parameters

This command is used to set CLIP. The default settings are to disable CLIP.

AT+CLIP=<mode>

+CLIP:<mode> return from AT+CLIP?

+CLIP:<number>,<type>,<name>,<subaddr>,<cli_validity>

AT+CLIP?

+CLIP:<mode>,<status>

AT+CLIP=1

OK

RING:+CLIP:

“130********”,129,

“name”,“”,0

AT+CLIP=0

OK

RING

Enable CLIP

There is an incoming call, incoming number is 130********

Disable CLIP

No CLIP

Inquire CLIP At+CLIP?

+CLIP: 0,1

OK

<mode>:

0: disable CLIP

1: enable CLIP;

<number>: incoming number (need apply for relevant service)

<type>: 129.

<name>: contact

’s name

<subaddr>:syntax of sub address specified by satype. Default as null by MTK.

<status>: CLIP status

0: Do not provide CLIP service

1: Provide CLIP service

2: Unknown unavailable network

16

GSM Module

2.1.16 +ZSETMUTE: mute control

Description

Syntax

Example

Parameters

This command is used for mute control and it can be used only during the call.

AT+ZSETMUTE=<Mode>

AT+ZSETMUTE=?

+ZSETMUT:(0-1)

OK check the setting parameters

AT+ZSETMUTE=1

OK

Mute on

AT+ZSETMUTE=0

OK

<Mode>:

0: Turn off mute

1: Turn on mute.

Mute off

2.1.17 +CIMI: International Mobile Identification

Description

Syntax

Example

This command is used to read the International Mobile Identification of SIM card and check current PIN.

AT+CIMI

AT+CIMI

460030916875923

OK

Check CIMI

Return CIMI

2.1.18 +CGMR: get product version

Description

Syntax

Example

This command is used to obtain the module

’s current product version.

AT+CGMR

AT+CGMR=?

OK

No meaning

AT+CGMR

+CGMR: Revision: 1.0

OK

Return current module

’s version

2.1.19 +ECHO: echo remove

Description

Syntax

Example

This command is used to remove the echo.

AT+ECHO=num

Check current echo settings AT+ECHO?

+ECHO:1

OK

AT+ECHO=0

OK

Cancel echo remove

17

GSM Module

Syntax Num: default value 1.

1: set echo remove function

0: cancel echo remove function

2.1.20 +(C)GSN: get current IMEI

Description

Syntax

Example

This command is used to get the current device

’s IMEI.

AT+GSN

Return current IMEI AT+GSN

N

OK

2.1.21 +ZVERS: get current software version

Description

Syntax

Example

This command is used to get the current software version.

AT+ZVERS get the current software version. AT+ZVERS

+ZVERS: ***.bin

OK

2.1.22 +CLCK: lock

Description This command is used to lock the terminal or network function.

Syntax

Example

AT+CLCK=<fac>,<mode>[,<passwd>[,<class>]]

+CLCK:<status>

AT+CLCK=?

+CLCK:("PF","SC","AO","OI","OX","AI","IR","AB","AG","AC","FD","PN","PU","PP","PC")

OK

18

GSM Module

Parameters <fac>:

"SC" SIM card; "AO" all outgoing calls barring; "OI" Outgoing international calls barring;

"OX" Outgoing international calls barring except for local; "AI" all incoming calls barring;

"IR" Incoming roaming barring; "AB" all services barring; "AG" barring of all outgoing calls;

"AC" barring of all incoming calls; "FD" Fixed dial; "PN" Personalized network; "PU"

Personalized sub network; "PP" Personalized provider; "PC" Personalized corporate.

<mode>:

0 unlock

1 lock

2 check the status

<passwd>: password or operation code, character string type

“***”.

<class>:

1 voice call

2 data

4 fax

7 All

<status>:

0: Disable

1: Enable

2.1.23 +CCFC: call forwarding number and conditions

Description

Syntax

Example

This command is used to set call forwarding number and conditions.

AT+CCFC=<reason>,<mode>[,<number>

[,<type>[,<class>[,<subaddr>[,<saytype>[,time]]]]]]

If mode!=2, setting successfully return: OK;

If mode=2, setting successfully return:

+CCFC:<status>,<class>

AT+CCFC=?

+CCFC: (0,1,2,3,4,5)

OK

Check call forwarding control setting

Return reason range.

19

Parameters

GSM Module

<reason>:

0:unconditional

1: mobile device busy

2: No answer

3: Can

’t be connected

4: All calls

5: all conditions

<mode>:

0: disabled

1: enabled

2: check status

3: register

4: delete

<number>: phone number

<type>:

145: international number

129: other number

<subaddr>: address of character string type

<saytype>: 128

<class>:

1: voice

2: data

4: fax

7: all

Time: 1..20..30 multiplies 5 seconds

<status>:

0: deactivate

1: activate

Need apply for relevant services. Remarks

20

GSM Module

2.1.24 +CCWA: call waiting

Description

Syntax

Example

Parameters

This command is used for call waiting.

AT+CCWA=[<n>] [,<mode> [,<class>]]

AT+CCWA=? List all supported <n>

+CCWA: (list of supported <n>s)

OK

AT+CCWA? Read current <n>

+CCWA: <n>

OK

Call waiting setting AT+CCWA=[<n>]

[,<mode>

[,<class>]]

As mode!=2, if successful:

OK

As mode!=2, return:

+CCWA:<status>,<class1>[<CR><LF>

+CCWA:<status>,<class2>[...]] OK

If there is an error in operation:

+CME ERROR: <err>

If <n>=1, send the result code of call waiting:

+CCWA: <number>,<type>,<class>

[,<alpha>][,<CLI validity>]

Under the premise of call waiting activated, during the call connection process;

As the call terminates in the system, send the result code of call waiting.

<n>

0:do not send the result code of call waiting;

1:send the result code of call waiting.

<mode>

0:Deactivate call waiting;

1:Actiavte call waiting;

2:Check current state;

<class> 1: voice call

<status> 0: deactivate;1: activate.

<number> call waiting number, and its syntax designated by <type>;

<type> <number> syntax

<alpha>,<CLI validity> see AT+CLIP

21

GSM Module

2.1.25 +CHLD: call hold

Description

Syntax

Example

Parameters

This command is used to set call held and conference call.

AT+CHLD=[<n>]

AT+CHLD=? Check supported <n>

+CHLD: (list of supported <n>s )

OK

AT+CHLD=[<n>] Set call held and conference call;

If the setting is successful:

OK

If there is an error in operation:

+CME ERROR: <err>

<n>

0: release all held calls or set a waiting call as UDUB

1: Release all activated calls and receive a held or waiting call.

Remarks

1X: Release call X

2: Hold all activated calls and receive another held or waiting call.

2X: hold all calls except for call X

3: Add the held call into the conference call

4: Connect two calls or end two calls.

5: Activate call request from busy subscriber

1. This command is used for telecom service;

2. The range of X value:1~7

3. When there is both held call and waiting call, the process above should be applied for the waiting call.

4. When releasing call, please firstly use AT+CHLD=1 to release the current call, and use ATH to hang up the call.

5. Please refer to the method of conference call provided by the operator when using AT+CHLD=3.

2.1.26 *TSIMINS: check SIM card status

Description

Syntax

Example

This command is used to check SIM card status.

AT*TSIMINS=num, status

AT*TSIMINS?

*TSIMINS:0,0

OK

Check SIM card status.

No SIM card.

22

GSM Module

Parameters Num: take 0 or 1, no meaning.

Status:

0:There is no SIM card;

1:There is SIM card.

2.1.27 +CPWD: change password

Description

Syntax

Example

Parameters

This command is used to change the password.

AT+CPWD=<fac>,<passwd>,<newpasswd>

+CPWD:<fac,length>s

AT+CPWD=?

+CPWD:

("SC",8),("P2",8),("AO",4),("OI",4),("OX",4),

("AI",4),("IR",4),("AB",4),("AG",4),("AC",4)

Check the setting range.

Return the list of parameters;

OK

AT+CPWD ="SC","1234","2345"

OK Change password of SIM card

Fac: "SC" SIM card; "AO" all outgoing calls barring; "OI" Outgoing international calls barring; "OX" Outgoing international calls barring except for local; "AI" all incoming calls barring; "IR" Incoming roaming barring; "AB" all services barring;

"AG" barring of all outgoing calls; "AC" barring of all incoming calls; "FD" Fixed dial;

Passwd: password or operation code, character string type "***". newpasswd: new password or operation code, character string type "***".

Length: password length supported by fac.

2.1.28 +CGMI: inquire manufacturer’s information

Description

Syntax

Example

This command is used to inquire manufacturer

’s information.

AT+CGMI

AT+CGMI

+CGMI: ZTE Mobile LTD

Inquire manufacturer

’s information

OK

2.1.29 ATZ: reset

Description

Syntax

Example

This command is used to read the parameter in NVRAM and set it as the current parameter.

ATZ<n>

ATZ0

OK

Reset the parameter correctly.

23

GSM Module

2.1.30 +CSCS: character set selection

Description

Syntax

Example

Parameters

This command is used to select the type of languages;

AT+CSCS=<string>

AT+CSCS=?

+CSCS: "IRA", "GSM", "HEX",

"PCCP437", "8859-1", "UCS2",

"UCS2_0X81"

OK

AT+CSCS=

”IRA”

OK

AT+CSCS?

+CSCS:

”IRA”

OK

String: a type of string, selecting IRA, GSM, etc.

“IRA” International Reference Alphabet(refer to ITU-T T.50[13]), excluding some special alphabets.

"GSM" GSM default symbols(refer to section 6.2.1 in GSM 03.38).

"UCS2" 16bit(ISO/IEC10646[32]);UCS2 string converts to hexadecimal number ranging from 0000 to FFFF;

2.1.31 +CLCC: check call status

Description

Syntax

Example

This command is used to check the status of current calls or each call;

AT+CLCC

+CLCC:<id1>,<dir>,<stat>,<mode>,<mpty>,[,<number>,<type>

[,<alpha>[,<priority>]]]

+CLCC:<id2>,<dir>,<stat>,<mode>,<mpty>,[,<number>,<type>

[,<alpha>[,<priority>]]]

……

OK

AT+CLCC

OK

ATD10086 ;

OK

AT+CLCC

+CLCC: 1,0,2,0,0,"10086",129

OK

24

Parameters

GSM Module

<idx>: caller ID

<dir>: call direction, taking the following value:

0: MO

1: MT

<stat> call status, taking the following value:

0: activated

1: call held status

2: call originated, dialing

3: call originated, ringing

4: Incoming call ring status

5: call waiting

<mode>: call type, taking the following value:

0: voice call

1: data call

2: fax

<mpty>:multi-party call, taking the following value:

0: Non multi-party call

1: Multi-party call

<number>: call number, ASCII code

<type>: call number type;

<alpha>: the text information corresponding to the call number in the phonebook (don

’t support temporarily, reserve the string)

<priority>: do not support string temporarily

25

GSM Module

2.2 DTMF Command

2.2.1 +VTS: send DTMF

Description

Syntax

Example

Parameters

This command is used to send DTMF.

AT+VTS=<string>

AT+VTS=?

+VTS:(0-9,*#,A,B,C,D),,(1-255)

OK

Check +VTS parameter

ATD********;

AT+VTS=

“3,6,9”

AT+VTS=3

AT+VTS=6

AT+VTS=9

Dial

Send 369 DTMF

String is a combination of characters, separated by comma. The character ranges from 0 to 9,*, #, A-D.

26

GSM Module

2.3 Network Service Command

2.3.1 +CREG: network registration and roaming

Description

Syntax

Example

Parameter

This command is used to check the module

’s network registration and roaming status.

Note: Need AT&W to save the result when setting 0 or 1.

AT+CREG=<mode>

+CREG :<mode>,<stat> return code

AT+CREG=0

OK

Disabled network registration and provide

AT+CREG?

+CREG: 0,1 result code

Display the module

’s registration status

AT+CREG=?

+CREG: (0-2)

OK

Check status range

<mode>:

0 Disabled network registration and provide result code (default)

1 Enabled network registration and provide result code: +CREG: <stat>

2 Enabled network registration and provide the location information.

<stat>:

0: Not logged on the network yet, currently not searching for new operator

1: Already logged on the local network.

2: Not logged on the network, currently searching for the BS

4: unknown code

5: Already logged on the network, under roaming status

2.3.2 +COPS: network selection

Description

Syntax

Example

This command is used for network selection.

AT+COPS=[<mode>[,<syntax>[,<oper>]]]

AT+COPS?

+COPS=<mode>[,<syntax>,<oper>]

OK

Return current network

’s registration mode and network

AT+COPS=[<mode>[,<syntax>[,<oper>]]]

OK

Select and register network

27

Parameter

GSM Module

<mode>

0 auto select, omit <syntax> <oper>

1 manual select, need <syntax><oper>

3 not involve network registration, this command is used to set syntax only; at this point, need <syntax>

4 manual/auto; If manual registration fails, auto register

<syntax>

0 syntax of long character <oper>

1 ormat of short character <oper>

2 number syntax <oper>

<syntax>:

0 long syntax alpha <oper>,up to 16 character

1 short <oper>, up to 8 character

2 numeric <oper> (MCC+MNC), default

<stat>

0 unknown

2 current registered network

3 forbidden registered network

28

GSM Module

2.4 Mobile Device Control and Status Report

2.4.1 +CPAS: check module’s status

Description

Syntax

Example

Parameter

This command is used to check the module

’s work status.

AT+CPAS

AT+CPAS Check the module

’s current work status.

+CPAS:2

OK

<pas>

0: Ready to receive AT command

2: Unknown status (default)

3: Incoming call (ring)

4: In a call

<pas>:

<pas>:

0: ready to receive AT command;

1: Not ready to receive AT command;

2: Unrecognized status;

3: Incoming call (Ring);

4: can receive AT command, but in a call;

5: In low power consumption mode, can

’t normally receive AT command.

2.4.2 +CFUN: set module’s function

Description

Syntax

Example

Parameter

This command is used to enable/disable some functions of the module.

AT+CFUN=<func>,<rst>

AT+CFUN=?

+CFUN(1,4),(0-1)

OK

Check the setting range

AT+CFUN=1,0

AT+CFUN=1,1

<fun>

1 Full function (default)

4 Disable RF Tx. and Rx. Function

<rst>

0 valid after settings

1 valid after restart

Settings validate, invalid after reset

Settings valid after reset

2.4.3 +CMEE: mobile equipment errors

Description This command is used for mobile equipment

’s error report.

Syntax AT+CMEE=<n>

29

GSM Module

Example AT+CMEE?

AT+CMEE=<n>

+CMEE:<n>

OK

Check current error report method

OK

Select error report method

Parameter <n>

0 Only ERROR

1 Provide error

’s specific number

2 Provide error

’s specific number and detailed prompt

2.4.4 +ZPWROFF: power off

Description

Syntax

Example

This command is used to power off the module.

AT+ZPWROFF

AT+ZPWROFF

OK

Power off the module

2.4.5 +CPIN: input PIN

Description

Syntax

Example

Parameter

This command is used to check PIN status and input PIN. The functions can be used only after the correct PIN is entered.

AT+CPIN=

AT+CPIN?

+CPIN:READY

OK check PIN status

No need to input new PIN

AT+CPIN?

+CPIN:SIM PIN

AT+CPIN="****"

OK check PIN status

Need input PIN

Enter correct PIN

AT+CPIN?: check if what passwords need to be entered.

+CPIN: READY: don

’t need to enter any password.

+CPIN: SIM PIN: need enter PIN.

+CPIN: SIM PUK:PIN unlock password

+CPIN: PH-SIM PIN: SIM card bundle password

+CPIN: SIM PIN2: PIN2 password

+CPIN: SIM PUK2: PIN2 unlock password

+CPIN: PH-NET PIN: network password

Pin: string value.

2.4.6 +CSQ: check signal strength

Description This command is used to check received signal strength indicator(rssi) and bit error rate (ber)

30

GSM Module

Syntax

Example parameters

AT+CSQ

AT+CSQ

+CSQ:<rssi>,<ber>

<rssi>:

0

–113dbm

1-111dbm

2..30

–109..-53dbm

31-51dbm

99:network unavailable

<ber>:

0~7:normal

99:network unavailable

2.4.7 +CCLK: clock management

Description

Syntax

Example parameters

This command is used to set and check the date/time of real-time clock.

AT+CCLK=<time>

AT+CCLK?

+CCLK: "04/02/09,17:34:23"

Check current time and date

Current network time and date

AT+CCLK="04/02/09,18:34:23" Set current date and time

Time string syntax: "yy/mm/dd,hh: mm: ss "

31

GSM Module

2.5 Message Service Command

2.5.1 +CSCA: SMS center number

Description

Syntax

Example

Parameters

This command is used to set SMS center number.

AT+CSCA=<sca>[,<tosca>]

AT+CSCA="+861380****500"

OK

AT+CSCA?

+CSCA: "8613800755500", 145

OK

Set SMS center number

Check SMS center number

<sca>:SMS center address

<tosca>: SMS center syntax

2.5.2 +CNMA: message acknowledgement

Description

Syntax

Example

Parameters

This command is used for message acknowledgement.

AT+CNMA at+cnmi=2,2,0,0,0

OK at+csms=1

Set message indication syntax

Set message service syntax

+CSMS: 1,1,1

OK

+CMT:,60

…………

AT+CNMA Message acknowledgement

OK

Valid when setting+CNMI=2,2,0,0,0 and +CSMS=1,1,1,1

2.5.3 +CMGF: SMS mode

Description

Syntax

Example

Parameters

This command is used to set SMS input method.

AT+CMGF=<num>

AT+CMGF=1

OK

AT+CMGF?

+CMGF:1

AT+CMGF=?

+CMGF=(0-1)

Set the text mode

Check current input method

Current settings as text mode

Check current setting range

OK

0:PDU mode

1:Text mode

32

GSM Module

2.5.4 +CNMI: message indication

Description

Syntax

Example

Returned results

This command is used to set new message indication.

AT+CNMI=<mode>,<mt>,<bm>,<ds>,<bfr>

AT+CNMI=?

+CNMI:

(0-3),(0-3),(0,2,3),(0,1),(0,1)

OK

AT+CNMI=3,1,0,0,0

Check current setting range

OK

+CMTI: "SM",19

AT+CNMI=3,2,0,0,0

Set message receiving mode as +CMTI: men, index

Receive new messages

Set message receiving mode

OK

AT+CMGF=1

OK

+CMT:

"+86130********","","07/02/14,

Set as TEXT mode

Received a message TEXT from

130********

10:29:04+32" text

+CMTI:<mem>,<index> : receive new message

+CMT:,<length><CR><LF><pdu> : directly output message (PDU mode)

+CBM:<length><CR><LF><pdu> : directly output cell broadcast message

(PDU mode)

33

Parameters

GSM Module

<mode>: control the processing of message alert code.

0: message alert code cached in TA; if TA is full, the alert code may be saved in other place or the oldest code might be abandoned and replaced by the latest code.

1: when the connection of TA-TE is held, abandon the saved message alert code and reject the new alert code; in other cases, directly display the alert code on the terminal;

2: when the connection of TA-TE is held, the message alert code is cached in

TA, as the connection is released, directly display the alert code on the terminal;; in other cases, directly display the alert code on the terminal;

3: directly display the alert code on the terminal;

<mt>: set the syntax of new message alert code.

0: save received messages to default memory (including class 3), do not notify

TE.

1: The syntax of new message alert code is +CMTI: "MT",<index>, message contents saved but not directly displayed;

2: The syntax of New message alert code is:

(Text mode)

+CMT :<oa>,[<alpha>],<scts>[,<tooa>,<fo>,<pid>,<dcs>

<sca>,<tosca>,<length><CR><LF><data>, message contents directly displayed but not saved;

(PDU mode)

+CMT:[<alpha>],<length><CR><LF><pdu>

3: For class 3 messages, directly send to TE just as <mt>=2. For other class, the same goes to <mt>=1.

<bm>: Indication method upon the receipt of broadcast message.

0: No CBM alert sent to TE.

2: Send new CBM directly to TE.

(text mode)

+CBM :<sn>,<mid>,<dcs>,<page>,<pages>

<CR><LF><data>(text mode), cell broadcast contents directly displayed but not saved;

(PDU mode)

+CBM:<length><CR><LF><pdu>

3: Class 3 CBM uses the result code (defined in <mt>=2)and directly sends to

TE.

<ds>: message status report

0: no message status report sent to TE.

1: send message status report to TE:

+CDS: <length><CR><LF><pdu> (PDU mode)

+CDS: <fo>,<mr>,[<ra>],[<tora>],<scts>,<dt>,<st> (TEXT mode)

<bfr>:

0: as <mode> is set as 1..3, the code saved in TA will be sent to TE (return OK prior to transmitting the code).

GSM Module

2.5.5 +CMGR: message read

Description

Syntax

Example

Returned results

This command is used to read the received message.

AT+CMGR=?

AT+CMGF=1

AT+CMGR=1

+CMGR:"REC UNREAD","133********",,

"04/02/25,12 :58 :04+04"

ABCD

OK

AT+CMGF=0

AT+CMGR=1

+CMGR: 1,,127

0891683108705505F00408A1705581

060008701091905564236E5C0A656C

76845BA26237FF0C60A85DF27ECF62

10529F5F00901A4E86003100300030

51430047005000520053595799104F

1860E04E1A52A1FF0C4ECE00320030

003000375E74003000326708003000

3165E55F0059CB751F654830028C22

8C22FF016DF1573379FB52A8

516C53F8

AT+CMGR=<index>

+CMTI:

“MT”:1

Receive the message, saved at index 1

Set TEXT syntax

Read the first TEXT message

Set PDU mode

Read first PDU message

Return syntax:

The terminal adaptor would return the message of index saved in mem1

-if select text mode (+CMGF=1):

+CMGR :<stat>,<oa>,[<alpha>],<scts>[,<tooa>,<fo>,<pid>,<dcs>,

<sca>,<tosca>,<length>]

<CR><LF> <data> (used to read received message)

+CMGR :<stat>,<da>,[<alpha>][,<toda>,<fo>,<pid>,<dcs>,[<vp>],<sca>,

<tosca>,<length>]

<CR><LF> <data> (used to read transmitted message)

--if select PDU mode (+CMGF=0):

+CMGR: <stat>,[<alpha>],<lenth>,<CR>,<LF>,<pdu>

OK

-if error occurs, prompt:

+CMS ERROR:<err>

Note: after reading message, the status will change from

“REC UNREAD” to “REC

READ

”.

35

GSM Module

Parameter <alpha>:the name of corresponding <da> or <oa> on the terminal.

<stat>:the message status in memory.

<oa>:message original number string

<da>:message target string

<scts>:message service center time string

<lenth>: length of message body <data>

<pdu>:ME/TA hex value

<stat>:

0:

“REC UNREAD” received unread message.

1:

“REC READ” received read message.

2:

“STO UNSENT” saved unread message.

3:

“STO SENT” saved read message

4:

“All” all messages

2.5.6 +CMGW: message write

Description This command is used to save the messages into <mem2>.

Syntax

TEXT mode: (AT+CMGF=1)

AT+CMGW=<phone number>

Example

>string<ctrl-Z>

PDU mode:(AT+CMGF=0)

AT+CMGW=<string len>

>pdu string<ctrl-Z>

AT+CMGF=1

Write messages under Text

OK

AT+CMGW="13714393404"

> AT+CMGW="13714393404"<ctrl-Z>

+CMGW: 41

OK

AT+CMGF=0

OK mode

AT+CMGW=17

>0891683108705505f011000b813120

882624f700f1ff0361f118<ctrl-Z>

+CMGW: 42

OK

Parameters phone number: string len: length of PDU string

Write messages under PDU mode

2.5.7 +CSMS: select SMS service

Description

Syntax

The command is used to select SMS <service>. Send(SMS-MO), receive

(SMS-MT), cell broadcast SMS-CB.

AT+CSMS = <service>

36

GSM Module

Example

Parameter

AT+CSMS?

+CSMS:0,1,1,1

OK

AT+CSMS=0

+CSMS: 1,1,1

OK

AT+CSMS?

Check the current SMS service

Support receive/transmit message and cell broadcast

Set current SMS service as GSM Phase 2

Support receive/transmit message and cell broadcast

Check the settings

Succeed +CSMS:0,1,1,1

OK

<service>

0:compatible with GSM07.05 Phase 2 version 4.7.0

1:compatible with GSM07.05 Phase 2+ version

<mo>

1:support send message

<mt>

1:support receive message

<bm>

1:support cell broadcast

2.5.8 +CMGS: message send

Description

Syntax

Example

This command is used to send the message from the terminal to the network.

Return the parameter to the terminal after the message is sent.

Note: there is error prompt as the message is sent to illegal number.

Text mode (AT+CMGF=1)

AT+CMGS=<de><CR>

<data><Ctrl-Z/ESC>

PDU mode(AT+CMGF=0)

AT+CMGS=<length><CR>

<pdu><Ctrl-Z/ESC>

AT+CMGF=1

OK

Set as text mode

AT+CMGS="13316538879"<CR>

ABC<ctrl/Z>

OK

AT+CMGF=0

OK

AT+CMGS=17<CR>

Send a

“ABC” message to 13316538879

Set as PDU mode

Send a

“ABC” message to 13028862427

0891683108705505f011000b81312

0882624f700f1ff0361f118<Ctrl-Z>

+CMGS:2

OK

37

GSM Module

Parameter <de>:message sending number under text mode

<length>:length of bytes in TPDU under PDU mode

<data>: message under text mode

2.5.9 +CPMS: preferred message storage

Description

Syntax

Example

This command is used for preferred message storage.

AT+CPMS=<mem1>[,<mem2>[<mem3>]]

+CPMS=<used1>,<total>

AT+CPMS="SM","SM","SM"

+CPMS:4,50,4,50,4,50

OK at+cpms=?

+CPMS: ("SM", "ME", "SM_P",

Check message storage in SIM card mem1 total capacity 50 entries, 4 used mem2 total capacity 50 entries, 4 used mem3 total capacity 50 entries, 4 used

"ME_P", "MT"), ("SM", "ME",

"SM_P", "ME_P", "MT"), ("SM",

"ME", "SM_P", "ME_P", "MT")

OK at+cpms?

+CPMS: "SM", 4, 50, "SM", 4, 50,

"SM", 4, 50

OK at+cpms="me","me","me"

+CPMS: 0, 450, 0, 450, 0, 450

OK at+cpms?

+CPMS: "ME", 0, 450, "ME", 0,

450, "ME", 0, 450

OK

38

GSM Module

Parameters <mem1>:used to read, delete message in SIM card

<mem2>:used to write and send message in SIM card

<mem3>:used for messages not saved to PC in SIM card

<used>:used entries

<total>:total number of memory

SM: SIM card

ME: NVRAM

2.5.10 +CMGD: message delete

Description

Syntax

Example

This command is used to delete a message from selected memory.

AT+CMGD=<Index>

AT+CMGF=1

AT+CMGL="all"

+CMGL:1,"REC

READ","130********","",

Set as text mode

List all messages abcdefg

+CMGL:2,"REC

READ","131********","", abcdef

+CMGL:3,"STO

SENT","1331********","" opqrxt

OK

AT+CMGD=2

OK

Delete the second message

39

GSM Module

Parameters

AT+CMGF=0

AT+CMGL=4

+CMGL: 1,3,,21

0891683108705505F0010F0B813

120882624F700

0808738B54084F1F5927

+CMGL: 2,3,,21

0891683108705505F001100B813

120882624F700

0808738B54084F1F5927

+CMGL: 3,3,,21

0891683108705505F001110B8131

20882624F700

0808738B54084F1F5927

OK

AT+CMGD=1

OK at+cmgd=1,1

OK

Set as PDU mode

List all messages

Delete the first message

Delete all read messages at+cmgd=1,2

OK at+cmgd=1,3

OK at+cmgd=1,4

OK

Delete all read and sent messages

Delete all read, sent and unsent messages

Delete all messages

<start_Index>: index of saved messages

<mode>: delete marks

0: delete the message at the designated index

1: delete all read messages

2: Delete all read and sent messages

3: Delete all read, sent and unsent messages

4: Delete all messages: delete the message at the designated index

2.5.11 +CMGL: message list

Description The command is used to read a kind of messages saved in the selected memory via

+CPMS command.

Syntax AT+CMGL=<stat>

40

GSM Module

Example

Returned syntax

AT+CMGF=1

OK

AT+CMGL="ALL"

+CMGL:1,"REC READ","130********","", abcdefg

+CMGL:2,"REC READ","131********","", abcdef

+CMGL:3,"STO

Set as text mode

Use text mode

Check all messages

SENT","1331********","", opqrxt

OK

1) text mode as below:

+CMGL :<index>,<stat>,<da/oa>,[<alpha>],[<scts>][,<tooa/toda>,<length>]

<CR><LF><data><CR><LF>

+CMGL :<index>,<stat>,<da/oa>,[<alpha>],[<scts>][,<tooa/toda>,<length>]

<CR><LF><data> [

…] (Received/transmitted message list)

OK

2)PDU mode as below:

+CMGL:<index>,<stat>,[<alpha>],<length><CR><LF><pdu>

Parameters 1. text mode(+CMGF=1)

<stat>

REC UNREAD: receive unread message

REC READ: receive read message

STO UNSENT: store unsent message

STO SENT: store sent message

ALL: all messages

2.PDU Mode (+CMGF=0)

<stat>

<stat>:

0: received unread message

1: received read message

2: saved unsent message

3: saved unsent message

4: All messages

<index>:message index

<length>:TPDU length in PDU mode

<pdu>:binary system in PDU mode

<data>:message text in text mode

41

GSM Module

2.5.12 +CMSS: messages saved in SIM card

Description

Syntax

Example

This command is used to send the messages saved in SIM card.

AT+CMSS=<index>[,<da> [,<toda>]]

Return syntax: +CMSS : <mr> 或+CMS ERROR: <err>

If the new target number is designated, the new number will replace the number saved in the message.

AT+CMGF=1

AT+CMGW="1331653****"<CR>

ABC<ctrl-Z>

+CMGW:2

OK

AT+CMSS=2

+CMSS:0

OK

Set as text mode

Write a message and send it to

1331653****

The message will be saved in index 2

Send the messages saved in index 2

Message sent

CMSS return initial value 0

AT+CMSS=2

+CMSS:1

OK

AT+CMSS=2,"1302755****"

+CMSS:2

OK

As the message is saved

Do not designate the number to send the message

Message sent,(send to the address used to save the message

CMSS return value 1

Use number 1302755**** to replace the original number 1331653****, and send a message to new number

2.5.13 +ZSMGS: message full indication

Description

Syntax

Example

This command is used to indicate the message full status.

+ZSMGS:<status>

+ZSMGS:FULL

OK

+ZSMGS:FULL

OK

<status>:messages status full

Parameters

42

GSM Module

2.6 Phonebook Command

2.6.1 +CPBS: phonebook storage

Description

Syntax

Example

Parameters

This command is used to select phonebook memory.

AT+CPBS=<type>

AT+CPBS?

+CPBS: "SM",1,250

OK

AT+CPBR=1

Check current phonebook settings

Select SIM card as current phonebook

Check phonebook storage memory

+CPBR=1,"130********",129,""

OK

AT+CPBS=? Select the phonebook saved in SIM card

+CPBS: ("ME", "SM", "LD", "MC",

"RC","FD","DC","ON")

OK

Type:

“SM” SIM card

“FD” Fixed dial

“LD” Last dial

“MC” Missed calls

“ME” Module memory

“DC” Dialed calls

“RC” Received calls

"ON": number list in SIM card (or ME)

2.6.2 +CPBR: phonebook read

Description

Syntax

Example

This command is used to read the phonebook information.

AT+CPBR=<index1>,[<index2>]

+CPBR:<index>,<number>,<type>,<text>

Check current phonebook information AT+CPBR=?

+CPBR: (1-10),40,13

OK

AT+CPBR=1

+CPBR=1,"130********",129,""

OK

Read the first number of currently selected phonebook

43

GSM Module

Parameters

AT+CPBS="SM"

OK

AT+CPBR=?

+CPBR: (1-10),40,13

Select SIM card phonebook

Check SIM card phonebook information

Read the contacts information from 1 to 3

AT+CPBR=1,3

+CPBR: 1,"8151****",129,""

+CPBR: 2,"8636****",129,""

+CPBR: 3,"8604****",129,"" index1: read phonebook index index2: read the contacts information from index1 to index2 index: index number: phone number type: phone type

129: domestic

145: international text: number

’s corresponding name

2.6.3 +CPBW: phonebook write

Description

Syntax

Example

This command is used to write information into the phonebook.

AT+CPBW= <index>,<number>,<type>,<name>

+CPBW:(<index>),<length>,(<type>),<tlength>

AT+CPBW=?

+CPBW: (1-250),40,(129,145),14

AT+CPBW=?

+CPBW: (1-250),40,(129,145),14

OK

AT+CPBS="SM"

OK

AT+CPBW=1,"130********",129,

"john"

OK

AT+CPBR=1

+CPBR:1,"130********",129,

"john"

OK

AT+CPBW=1

OK

OK

Select SIM card memory

Write the number and number at Index 1 in the phonebook

Read the first name and number in phonebook

Delete the first entry in phonebook

44

GSM Module

Parameters

Remarks

Index: index length: number length type: phone type

129: domestic

145: international tlength: length of contact

’s name

Number: phone number

Name: name corresponding to the number

For Chinese name, the limit length of Chinese name is not 14 because the

Chinese string is ended with

“\0\0”.

2.6.4 +CPBF: phonebook find

Description

Syntax

Example

Parameter

Remarks

This command is used to find the information in phonebook.

AT+CPBF= <name>

+CPBF: <index>,<number>,<type>,<name>

+CPBF:<nlength>,<tlength>

AT+CPBF=? Check current phonebook information

+CPBF:40,14

OK

Phone number length 40

Name length 14

AT+CPBS="SM"

OK

AT+CPBW=1,"130********",129,

"john"

OK

AT+CPBR=1

+CPBR:1,"130********",129,

"john"

Select phonebook

Write phone information in the first field of current phonebook

Read relevant information

Search the contacts with the name John

OK

AT+CPBF="john"

+CPBF: 1,"130********",129,"john"

OK index: index nlength: number length type: phone type

129: domestic

145: international tlength: length of contact

’s name

Number: phone number

Name: name corresponding to the number

Only find in

“SM”,”ME”, can’t find in "LD", "MC", "RC","FD","DC","ON".

45

GSM Module

2.6.5 +CNUM: owner’s number

Description

Syntax

Example

Parameter

This command is used to read the owner

’s number.

AT+CNUM

AT+CNUM Read the owner

’s number

+CNUM: "","130********",129,7,4

OK

The owner

’s number can be written into SIM card through

AT+CPBS="ON" ;AT+CPBW command and read through AT+CNUM command.

46

GSM Module

2.7 Data Compression Command

2.7.1 +IFC: flow control

Description

Syntax

Example

Parameter

This command is used to set the flow control between TE-TA.

AT+IFC=[<mode1 >[,<mode2>]]

AT+IFC=2,2

OK

Set mode1 of TE-TA flow control as RTS, mode2 as CTS mode1:

0: no flow control.

1:XON/XOFF, don

’t transmit data;

2:RTS;

3: XON/XOFF, transmit data. mode2:

0: no flow control.

1: XON/XOFF;

2: CTS;

2.7.2 &D: set DTR mode

Description

Syntax

Example

Parameter

This command is used to set DTR mode;

AT&D[<value>]

AT&D0

OK

Omit DTR signal value:

0:Omit DTR signal;

1: DTR from OFF to ON;

2: DTR from ON to OFF;

2.7.3 &C: set DCD mode

Description

Syntax

Example

Parameter

This command is used to set DCD mode;

AT&C[<value>]

AT&C0

OK

DCD signal is always valid value:

0: DCD signal is always valid;

1: DCD signal is valid if there is data;

2.7.4 +IPR: set module’s baud rate

Description

Syntax

This command is used to set the module

’s baud rate and automatically save the current baud rate.

AT+IPR=<baud rate>

47

GSM Module

Example

AT+IPR?

+IPR: 115200

OK

AT+IPR=?

Check current module

’s baud rate

Check supported baud rate

AT+IPR=115200

OK

Set the baud rate as 115200

The default is the saved setting of baud rate. Remarks

2.7.5 &F: restore factory settings

Description

Syntax

Example

Remarks

This command is used to restore factory settings.

AT&F

AT&F Restore factory settings

AT&F command

’s parameters include ATS, ATQ & ATE. AT&F basic parameters can

’t be validated from the echo of AT commands.

Reference validation method: after turning on the module, firstly input AT&V, obtain basic parameters; use the set parameters such as ATS, CREG; after setting, use AT&F to obtain the basic parameters. Compare these parameters and check if they are identical.

2.7.6 &W: save settings

Description

Syntax

Example

Remarks

This command is used to save the current parameter settings.

AT&W

AT&W Save the current parameter settings.

AT&W command

’s parameters used to save include ATE, ATQ and ATS. The user parameters saved by AT&W can

’t be validated from the echo of AT commands.

Reference validation method: firstly use the set parameters such as ATE, ATQ &

ATS, use AT&V to read the user information, and then input ZT&W; after restarting the module, use ATZ1 to read NV and use AT&V to read the user information. Compare to the parameters before restarting and check if they are identical.

48

GSM Module

2.8 GPRS Command

2.8.1 +CGDCONT: set PDP

Description

Syntax

Example

Parameters

This command is used to set GPRS PDP syntax;

AT + CGDCONT=cid, type, APN[,PDP_ADDR]

At + CGDCONT=1, "IP","CMNET"

ATD*99#

……

Connect cid: used to mark the number of PDP, minimum 1; type: a type of PDP package;

IP: use TCP/IP package;

APN: access point network

PDP_ADDR: user designated IP address (optional)

2.8.2 +CGACT: activate/deactivate PDP

Description

Syntax

Example

Parameters

This command is used to activate/deactivate PDP settings.

AT+CGACT= [<state> [, <cid> [, <cid> [,..]]]]

At + CGDCONT=1,"IP","CMNET"

OK

AT+CGACT=1,1

OK cid: used to mark PDP parameter; state: used to indicate PDP status;

0: deactivate;

1: activate;

2.8.3 +CGATT: set GPRS

Description

Syntax

Example

Parameter

This command is used to set GPRS service.

AT+CGATT=[<state>]

AT+CGATT?

+CGATT:0

OK

Check GPRS service status

Set GPRS service status AT+CGATT=1

OK state:

0: detach

1: attach

49

GSM Module

2.8.4 +CGCLASS : GPRS device class

Description

Syntax

Example

Parameter

This command is used to check GPRS device levels.

AT+CGCLASS=[<class>]

Check GPRS device levels. AT+CGCLASS?

+CGCLASS:"B"

OK class:

B: support Class B

CG :support GPRS only

CC: support circuit exchange only

50

GSM Module

2.9 ZTE Exclusive Commands

2.9.1 +ZGPIO: read/write GPIO

Description

Syntax

Example

Parameter

Remarks

This command is used to set input/output interface and read/write GPIO value.

AT+ZGPIO=<flag>,<index>,<value>

AT+ZGPIO=0,5(read)

+ZGPIO: 0

OK

AT+ZGPIO=1,22,1(write)

OK

<flag>:

0:read

1:write

<index>:Index for GPIO to read/write;

<value>:

0:I/O set as 0;

1:I/O set as 1;

Only GPIO5, GPIO22 provided to users for operation.

2.9.2 +ZSTR: check module’s status

Description

Syntax

Example

Parameters

This command is used to check the module

’s operation status;

AT+ZSTR=<status>

+ZSTR: <status>,<value>

AT+ZSTR=1

AT+ZSTR=2

AT+ZSTR=?

Check initialization status

Check network status

Check the list of parameters

<status>

1:No meaning, input AT+ZSTR=1, and display ZSTR: 1,2。

2: network status.

<value>

0:network unavailable;

1:network available;

2: no meaning.

2.9.3 +ZGETICCID: set ICCID

Description

Syntax

Read ICCID in SIM card

AT+ZGETICCID

Example

Descriptions of returned values

No parameter

+ZGETICCID:89860042190733578148

OK

Description: ICCID value as

89860042190733578148

51

GSM Module

2.9.4 +ZCSQ: set auto display CSQ

Description This command can be used to set a threshold value <NUM>. As the RSSI is larger than the threshold value, the module will send +CSQ at the COM port.

Note:

Syntax

Example

Note: the threshold value <NUM> does not refer to the RSSI. The threshold value is identical to the <rssi> displayed by the command AT+CSQ. Besides, the command would affect RI status. Please pay attention and avoid mixing with incoming call indication.

AT+ZCSQ=<NUM>

AT+ZCSQ=5 +CSQ:24,0

OK

AT+ZCSQ? 5

OK

AT+ZCSQ=? +ZCSQ: (0-32)

OK

Parameter <NUM> range: 0~32

Remarks As the RSSI is larger than the threshold value <NUM>, the module would pull RI pin (ME3000 Pin15) down 50ms and display the current RSSI value in the syntax of

“+CSQ: <rssi>,<ber>” while restoring RI pin’s high level.

If the threshold value <NUM> is equal to 0, stop reporting the signal quality.

If the threshold value <NUM> default value is 0, the module will auto restore to the default settings after restart.

When checking RSSI, if return

“+CSQ:99,99”; 99 doesn’t represent the actual

<rssi> value, but the valid <rssi> value which is not yet obtained.

2.9.5 +ZEDT: set DTR inspection mode

Description This command is used to set the inspection mode for DTR pin.

There are two inspection modes: A)the module reads DTR pin

’s level; as DTR pin is at low level, the module think DTR signal is valid, namely the module is effectively connected with DTE device; otherwise, the module is disconnected with

DTE device; B)the module doesn

’t read DTR pin’s level; and the DTR signal would be always valid, namely the module will be always connected with DTE device

Syntax

Example effectively.

AT+ZEDT=<NUM>

AT+ZEDT=1 OK

AT+ZEDT? +ZEDT: 1

OK

52

GSM Module

AT+ZEDT =? +ZEDT: (0,1)

OK

Parameter <NUM> range: 0~1

Remarks

The command

“+ZEDT” is mainly used to set the module at low power consumption mode; under low power consumption mode; the module could intermittently turn off the RF components, besides, the MCU、DSP、PLL , external clock at digital baseband part can enter dormant mode, and 26MHz main crystal oscillator would enable/disable regularly to reduce the module

’s power consumption.

Whether or not the module can enter low power consumption mode depends on the following factors: 1) Key (including ON/OFF key) event and exception/external interruption; 2) whether or not receive valid DTR signal; 3) OTA event (e.g., receive text message, incoming call, etc.)

In order to make the module enter low power consumption mode, please use the command

“AT+ZEDT?” to check the module’s current settings after start-up; if returning with

“+ZEDT: 0”, please use the command “AT+ZEDT=1” to change the settings; If you ever use the ON/OFF jumper cap, remove it. Disconnect the COM port---including AT port and debugging port. The module would enter the low power consumption mode after a while (1~3 minutes).

The default value of the setting value <NUM> is 0.

Besides, the command

“+ZEDT” would effect the status LED. After setting

AT+ZEDT=1, the status LED would not flash. The status LED will restore normally after changing the settings through the command AT+ZEDT=0 and restarting the module.

2.9.6 +ZDSLEEP: 32KHz Deep sleep mode

Description

Syntax

Example

Parameter

Remarks

This command is used to enable/disable 32KHz sleep mode.

AT+ZDSLEEP=<mode>

AT+ZDSLEEP=1

AT+ZDSLEEP=0

<mode>

0: disable sleep mode

Enable sleep mode

Disable sleep mode

1: enable sleep mode

After entering sleep mode, awaken through DTR. Valid at high level.

2.9.7 +CUSD: send USSD data

Description Send USSD data(ASCII code)

Syntax AT+CUSD=n,0,

”str”,dcs

Parameter 1. <n> :

53

GSM Module

Descriptions of returned value

Example

Note

Ø 0 disable result code presentation in the TA

Ø 1 enable result code presentation in the TA

Ø 2 cancel session

2. <str>

string type: USSD string (see 3GPP 27.007 for use)。

Please use ASCII code.

3. <dcs>

integer type: 3GPP 23.038 Cell Broadcast Data Coding Scheme。

Recommended to use 15.

+CUSD: <m>[,<str>,<dcs>]

OK

Among:

<m> 0 no further user action required

1 further user action required

2 USSD terminated by network

3 other local client has responded

4 operation not supported

5 network time out

AT + CUSD=1,0,"*100#",15

+CUSD:

1,"6b228fce4f7f75285e7f4e1c79fb52a85feb4fe1003

100300030ff01000a003165b095fb59296c14000a00

3280a17968884c60c5000a00334f1195f29a7f7ad90

00a00346c11751f67e58b e2000a00357ecf51786d4b8bd5000a003662117684

5feb4fe1000a00374f7f75285e2e52a9000a",72

OK

The second parameter must be 0.

Connect *100#, and returned information is within

””, and the encoding method is UCS2.

Description Send USSD data(binary)

Syntax AT+CUSD==n, len, dcs

Parameter 1. <n> :

Ø 0 disable result code presentation in the TA

Ø 1 enable result code presentation in the TA

Ø 2 cancel session

2. <len>

The length of binary data required, unit: byte

3. <dcs>

integer type: 3GPP 23.038 Cell Broadcast Data Coding Scheme;

Recommended to use 15.

Descriptions of returned value

+CUSD: <m>[,<str>,<dcs>]

OK

54

GSM Module

Example

Note

Among:

<m> 0 no further user action required

1 further user action required

2 USSD terminated by network

3 other local client has responded

4 operation not supported

5 network time out at+cusd=1,5,15

>

OK

+CUSD:

1,"6b228fce4f7f75285e7f4e1c79fb52a85feb4fe1003

100300030ff01000a003165b095fb59296c14000a00

3280a17968884c60c5000a00334f1195f29a7f7ad00 a00346c11751f67e58be2000a00357ecf51786d4b8b d5000a0036621176845feb4fe1000a00374f7f75285 e2e52a9000a",72

1. The second parameter must be larger than 0.

2. There is no data display.

1. Connect *100#, and returned information is within

””, and the encoding method is UCS2.

2. After > appears, you can input any data stream in binary mode, but there is no display.

2.9.8 +ZRINGPINMODE: set RING PIN signal mode

Description

Syntax

This command is used to set RING PIN signal mode.

AT+ZRINGPINMODE=<N>

Parameters

Example

Descriptions of returned values

<N>

Ø 0:RING PIN is at original signal mode; the pin is at low level upon incoming call; and is at high level during other time. No change (remaining to be at high level) upon the receipt of text message.

Ø 1:RING Pin is at new signal mode; The PIN generates 1s low level and 4s high level upon an incoming call, until the call is ended or terminated; and is at high level during other time. Generate 1s low level pulse upon the receipt of new messages; maintain high level during other time.

AT+ZRINGPINMODE = 0 Set RING pin as original mode

AT+ZRINGPINMODE = 1

No returned value

Set RING pin as new signal mode

55

GSM Module

2.10 Network Parameter Commands

2.10.1 +ZPNUM: set APN, username and password

Description This command is used to set the operator

’s APN, username and password.

Syntax AT+ZPNUM=<APN>,<USER>,<PWD>

Example AT+ZPNUM="cmnet", "user", "pwd"

OK

Parameter

AT+ZPNUM? Check current APN,USER,PWD settings

APN:GPRS APN provided by operator;

USER: username

PWD: password

APN: USER, PWD is a kind of character "string".

2.10.2 +ZPPPOPEN: open GPRS connection

Description This command is used to open GPRS connection.

Syntax

Example

AT+ZPPPOPEN

AT+ZPNUM="cmnet", "user", "pwd"

OK

AT+ZPPPOPEN

+ZPPPOPEN:CONNECTED

OK

….

AT+ZPPPOPEN

+ZPPPOPEN: ESTABLISHED

OK

2.10.3 +ZPPPCLOSE: close GPRS connection

Description This command is used to close GPRS connection.

Syntax AT+ZPPPCLOSE

Example AT+ZPPPCLOSE

OK

AT+ZPPPCLOSE

+ZPPPCLOSE: DISCONNECTED

OK

2.10.4 +ZIPGETIP: check current IP address

Description This command is used to obtain the IP address.

Syntax AT+ZIPGETIP

56

GSM Module

Example

Parameter

AT+ZIPGETIP

+ZIPGETIP: *.*.*.*

OK

* is a value from 0~255;

Obtain the module

’s IP address

2.10.5 +ZDNSSERV: set DNS IP address

Description This command is used to set the IP address of the DNS.

Syntax

AT+ZDNSSERV=<IP1>,<IP2>

Parameter <IP1>: the IP address of main DNS;

Example

<IP2>: the IP address of sub DNS;

AT+ZDNSSERV=

”211.136.20.203”,”211.136.18.171”

OK

AT+ZDNSSERV=

”211.136.20.203”,””

OK

AT+ZDNSSERV?

211.136.20.203

211.136.18.171

Remarks

Set DNS IP address

Check DNS IP address

OK

When setting the server, you must mandatorily set the main DNS server and selectively set the secondary DNS server. For IP settings, the parameter can

’t exceed

255.

2.10.6 +ZDNSGETIP: obtain Internet Domain name’s IP address

Description

Syntax

Parameter

Example

This command is used to obtain Internet Domain name

’s IP address.

AT+ZDNSGETIP=<domain name>

<domain name>:Internet domain name;

AT+ZDNSGETIP=

”WWW.163.COM”

Obtain IP address

202.108.09.32

202.108.09.33

OK

57

GSM Module

2.11 TCP Link Commands

2.11.1 +ZIPSETUP: Set up TCP server link

Description

Syntax

Example

Parameter

Remarks

This command is used to send data to a bundled TCP server.

AT+ZIPSETUP=<N>,<IP>,<M>

AT+ZIPSETUP=1,61.144.216.219,2332

+ZIPSETUP:CONNECTED

OK

Connect to TCP server.

N: the channel No. of TCP links, ranging from 0 to 4; support 5 TCP links with 5 different IP addresses and ports;

IP:IP value of one target address, *.*.*.*. * range: 0~255.

M: port number;

MTK only supports 6 sockets online at the same time. The total number of TCP and UDP links can

’t exceed 6 when establishing the links.

2.11.2 +ZIPSEND: send TCP data to target address

Description This command is used to connect the target server.

Syntax AT+ZIPSEND= port, length<CR>

Example

Send data after prompt with '>'

AT+ZIPSEND=1,10

>abcdefghij

Send data to TCP server after successfully connecting the server. Send

Parameter

+ZIPSNED:OK

OK

10 bytes: abcdefghij port: the channel number of TCP links; length: data length ( support up to 1000 bytes, and support 0x00~0xff transmitting).

2.11.3 +ZPPPSTATUS:check GPRS connection status

Description

Syntax

Example

This command is used to check GPRS link status.

AT+ZPPPSTATUS

Check GPRS link status AT+ZPPPSTATUS

+ZPPPSTATUS: ESTABLISHED

OK

AT+ZPPPSTATUS Check GPRS link status

+ZPPPSTATUS: DISCONNECTED

OK

58

GSM Module

2.11.4 +ZIPCLOSE: close TCP link

Description This command is used to close TCP link.

Syntax AT+ZIPCLOSE=<N>

Example

Parameter

AT+ZIPCLOSE=1

+ZIPCLOSE:OK

OK

Close TCP link.

N: the number of TCP links and the value is 1;

2.11.5 +ZIPSTATUS:check current TCP link status

Description

Syntax

Example

Parameter

This command is used to check the status of current TCP link.

AT+ZIPSTATUS=<N>

AT+ZIPSTATUS=1

+ZIPSTATUS: ESTABLISHED

OK

Check the current TCP link status

ESTABLISHED: TCP link established.

DISCONNECTED: TCP link disconnected.

2.11.6 +ZIPRECV: receive data from current data link

Description This command is used to receive data asynchronously.

Syntax

Example

+ZIPRECV:N,LEN,<DATA>

…… ……

Parameter

+ZIPRECV:1,5,abcde

……

Received 5 data abcde from No.1 TCP data link

N: the number of TCP links and the value is 1;

LEN: length of received data;

DATA: received data

59

GSM Module

2.12 UDP Link Commands

2.12.1 +ZIPSETUPU: set up UDP server link

Description This command is used to bundle with the UDP server link.

Syntax AT+ZIPSETUPU=<N>,<IP>,<M>

Example AT+ZIPSETUPU=1,61.144.216.219,2332

OK

The UDP server

’s bundled address is

61.144.216.219, with the port no.

Parameter

2332.

Return with bundling succeeded.

N: the channel No. of UDP links, ranging from 0 to 4; support 5 UDP links with 5 different IP addresses and ports;

IP: IP address of target server; *.*.*.*. * ranges from 0~255.

M: port number.

Remarks MTK only supports 6 sockets online at the same time. The total number of TCP and UDP links can

’t exceed 6 when establishing the links.

2.12.2 +ZIPSENDU: send data to UDP server

Description This command is used to send data to the bundled UDP server.

Syntax AT+ZIPSENDU= port, length<CR>

Example

Send data after prompt with '>'.

AT+ZIPSENDU=1,10

>abcdefghij

Send data to UDP server after successfully connecting the server. Send

Parameter

+ZIPSNEDU:OK

OK port: the channel number of UDP links;

10 bytes: abcdefghij length: data length (support up to 1000 bytes, and support 0x00~0xff transmitting).

2.12.3 +ZIPSTATUSU:check UDP status

Description This command is used to check current UDP link status.

Syntax AT+ZIPSTATUSU=<N>

Example AT+ZIPSTATUSU=1

+ZIPSTATUSU: ESTABLISHED

OK

Check the No. 1 UDP status

The No. 1 UDP is in use

Parameter ESTABLISHED: UDP already ESTABLISHED.

DISCONNECTED:UDP already disconnected

60

GSM Module

2.12.4 +ZIPCLOSEU: close UDP link

Description This command is used to close the designated UDP link.

Syntax AT+ZIPCLOSEU=<N>

Example AT+ZIPCLOSEU=1

+ZIPCLOSE:OK

OK

Successfully close the No. 1 UDP link

Prompt that the No.1 UDP link closed.

Parameter N: the channel number of UDP links; representing the channels to be closed, ranging from 0 to 4.

2.12.5 +ZIPRECVU: receive UDP data

Description

Syntax

Example

Parameter

This command is used to receive UDP data from UDP server.

+ZIPRECVU:N,LEN,<DATA>

…… ……

+ZIPRECVU:1,5,abcde

……

Received 5 data abcde from the No.1

UDP data link

N: the channel number of UDP links, ranging from 0 to 4;

LEN: received data length;

DATA: received data;

(The size of each UDP package shall not exceed 1500 bytes, otherwise, error occurs)

61

GSM Module

2.13 Server Commands

2.13.1 +ZTCPLISTEN: set port monitoring

Description This command is used to enable/disable port monitoring function.

Syntax AT+ZTCPLISTEN=<on/off>,<portNum>

AT+ZTCPLISTEN?

Parameter On/off

1:start listening

2:stop listening

Example portNum the listening port num

If <on/off> is 2, please set this parameter as 0.

AT+ZTCPLISTEN=1,1174

OK

Monitoring port 1174

Note at+ztcplisten?

+ZTCPLISTEN:1,1174

OK

AT+ZTCPLISTEN=2,0

OK

Check monitoring status

Stop monitoring

+ZTCP(P):

ACCEPTED

INCOMING CONNECT Indicating one monitoring to one external connection, and the connection is accepted.

1. One port can be monitored currently, and only two connections are allowed on each port;

2. Prior to the monitoring, please firstly use AT+ZPPPOPEN to open the PPP link;

2.13.2 +ZTCPSENDP: send data through passively opened link

Description

Syntax

Parameter

Descriptions returned value

Example

Note

This command is used to send data through (monitored) passively opened link.

AT+ZTCPSENDP=<channel>,<n> of

<channel>: the sign of connected client ends;

<n>: the length of data to send

Input AT command according to the above syntax, press carriage return to display

“>”. In this case, you can input the data to transmit. When inputting

(size+1) data (it can be any data, 0x0d recommended), it will trigger the transmitting process.

AT+ZTCPSENDP=10

>1234567890

+ZTCPSEND(P):OK

Send 10 characters through the monitored link.

OK

Prior to the use of this command, the monitored connection must be established.

62

GSM Module

2.13.3 +ZTCPCLOSEP: close monitored connection

Description

Syntax

Descriptions returned value

Example

Note

This command is used to close the monitored connection.

AT+ZTCPCLOSEP=<channel> of OK: connection closed

ERROR: link not existed or other error at+ztcpclosep

+ZTCPCLOSEP:OK

OK

Close the No.1 connection monitored

Prior to the use of this command, the monitored connection must be established.

2.13.4 +ZTCPRECV(P): receive data report

Description This command is used to receive data report

Syntax

+ZTCPRECV(P):<channel>,<dataLength>,data

Parameter Channel: upon multiple connections, mark the connection through which transmits the data. dataLength: the length of received data

Data: received data

Example +ZTCPRECV(P):1050, 1050 characters received

78901234567890123456789012345678901234

56789012345678012345678901234567890123

45678901234567890123456789012345678901

23456789012345678012345678901234567890

12345678901234567890123456789012345678

90123456789012345678012345678901234567

89012345678901234567890123456789012345

67890123456789012345678012345678901234

56789012345678901234567890123456789012

34567890123456789012345678012345678901

23456789012345678901234567890123456789

01234567890123456789012345678012345678

90123456789012345678901234567890123456

78901234567890123456789012345678012345

67890123456789012345678901234567890123

45678901234567890123456789012345678012

34567890123456789012345678901234567890

12345678901234567890123456789012345678

01234567890123456789012345678901234567

89012345678901234567890123456789012345

67801234567890123456789012345678901234

56789012345678901234567890123456789012

63

GSM Module

34567801234567890123456789012345678901

23456789012345678901234567890123456789

01234567801234567890123456789012345678

90123456789012345678901234567890123456

78901234567801234567890123456789012345

67890123456789012345678

2.13.5 +ZTCPSTATUSP: check passively opened link

Description

Syntax

Descriptions returned value

Example

This command is used to check if there is any passively opened link.

AT+ZTCPSTATUSP=<channel> of +ZTCPSTATUS(P):DISCONNECT One passively link not existed

+ZTCPSTATUS(P):CONNECT One passively link existed at+ztcpstatusp=0

+ZTCPSTATUS(P):DISCONNECT

OK at+ztcpstatusp

+ZTCPSTATUS(P):DISCONNECT

OK

No passively opened link

The current monitoring port does not start working.

2.13.6 +ZIPTIMEOUT: set the timeout for connecting the server & sending data

Description

Syntax

Description parameters

Descriptions returned value

Example

This command is used to set the timeout for connecting the server and sending data as the module works as the client end.

AT+ZIPTIOMEOUT=<connect_timeout>,<send_data_timeout> of of connect_timeout: connection timeout; send_data_timeout: sending data timeout. If the module does not send out the data within the specified time, it might think that there is something wrong with the server or network and close the connection. (The module works as the server and client end)

OK setting succeeded

ERROR setting failed

AT+ZIPTIMEOUT=? Check the range of timeout value +ZIPTIMEOUT:(5-120),(5-18000)

OK

AT+ZIPTIMEOUT=30,60

OK at+ziptimeout?

+ZIPTIMEOUT:30,60

OK

Set the timeout

Check the range of current timeout

64

GSM Module

2.13.7 +ZTCPTIMEOUT: set the timeout for receiving data

Description

Syntax

Description parameters

Descriptions returned value

Example

This command is used to set the timeout for receiving data.

AT+ZTCPTIMEOUT=<recv_data_timeout> of of

If the module does not receive the data within the specified time, it will close the connection, otherwise, the number of connections exceeds the limit, other client-ends can

’t be connected.

The default value is 0 and it means the timeout is no needed.

OK Succeeded

ERROR Failed at+ztcptimeout=?

+ZTCPTIMEOUT:(0-18000)

OK at+ztcptimeout=30

OK at+ztcptimeout?

+ZTCPTIMEOUT:30

OK

Check the range of timeout value

Set the timeout

Check the range of current timeout

65

GSM Module

2.14 FTP Commands

2.14.1 ZFTPLOGIN: log in FTP server

Description This command is used to log in the FPT server.

Syntax AT+ZFTPLOGIN=<IP>,<PORT>,<Username>,<Password>

Description of parameters

IP: server

’s IP address;

PORT: server

’s FTP port number, 21 by default

(Note: according to RFC959, it ’s advised to set the port no. as 21)

Username: username used to log in FTP server

Password: password used to log in FTP server

Example at+zftplogin=183.37.36.5,21,test,test Logged in FTP server successfully

OK

+ZFTPLOGIN:OK at+zftplogin=183.37.36.5,21,test,test

OK

Log in FTP server, connection timeout

+ZFTPLOGIN: CONNECT FAIL

Remarks 1. As long as the syntax of command is correct, return OK. However, this doesn

’t mean logged-in successfully. The log-in is successful only after

+ZFTPLOGIN: OK is returned.

2. Prior to logging in FTP server, you must open PPP.

2.14.2 ZFTPTYPE: set FTP file type

Description This command is used to set the type of FTP file.

Syntax AT+ZFTPTYPE=<TYPE>

Description of parameters

TYPE: file type

1: ASCII

2: Binary

Example at+zftptype=1

OK

+ZFTPTYPE:OK

Set the file type as text mode at+zftptype?

+ZFTPTYPE:1

Check the settings of file type

66

GSM Module

Remarks If you upload or download the files for the first time, you have to set the file type and perform relevant operation. If you need not change the file type, you can ignore the settings.

2.14.3 ZFTPUPLOAD: upload files

Description This command is used to upload files to FTP server.

Syntax AT+ZFTPUPLOAD=<dir&filename>,<put_mode>,<size>

Description of parameters dir&filename: file directory or file name put_mode: Upload operation mode:

1: STOR mode: create the file on the server and write the data. If the file exists already, cover the original file.

2: APPE mode: if the file doesn

’t exist on the server, create it. If it exists, attach the data at the end of the file.

Size: size of file;

Example at+zftpupload=test1.txt,2,511

>

OK

+ZFTPUPLOAD:OK

Upload a txt file to the server with the file

’s name test1.txt and size of

511 bytes.

Remarks The data length sent each time does not exceed 4K byte. If you want to write a large file, use STOR mode and then APPE mode; Prior to the uploading, you

’d better set the file type.

2.14.4 ZFTPDNLOAD: download files

Description This command is used to download files from FTP server.

Syntax AT+ZFTPDNLOAD=<dir&filename>,<Content or Info>,<output_interval>

Description of parameters dir&filename: file directory or file name

Content or Info: specify what you want to obtain is Content or Info:

1: obtain file contents

2: obtain file or designated directory information output_interval: interval (1500 byte each time) as the module outputs through COM port. Take the value from 0~10, with the unit of second. 0 represents the default value 20ms.

Example at+zftpdnload=test1.txt,1,4

OK

+ZFTPDNLOAD:Recv Start

12345678901234567890123456789012345678901234

56789012345678901234567890123456789012345678

Download a txt file from the server with the file

’s name test1.txt and size of 511 bytes.

67

GSM Module

90123456789012345678901234567890123456789012

34567890123456789012345678901234567890123456

78901234567890123456789012345678901234567890

12345678901234567890123456789012345678901234

56789012345678901234567890123456789012345678

90123456789012345678901234567890123456789012

34567890123456789012345678901234567890123456

78901234567890123456789012345678901234567890

12345678901234567890123456789012345678901234

567890123456789012345678901

+ZFTPDNLOAD:Recv End at+zftpdnload=test1.txt,2,4

OK

Obtain the relevant information of test1; output at the interval of

4s.

+ZFTPDNLOAD:Recv Start

-rw-r--r-- 1 ftp ftp 511 Jun 08 16:28 test1.txt

+ZFTPDNLOAD:Recv End

Remarks 1. This command is only used to read the file not larger than 10K; if the file is larger than 10K, the data might be lost.

2. Pay attention to the setting of output_interval. As you download larger files, the data might be lost if you set a smaller value of output_interval.

Generally select a value from 5 to 10. For large files, select 10.

3. As you download larger files, data echo might be displayed in sections;

The file information would generally not be packaged;

4. Prior to the downloading, you

’d better set the file type.

5. If there is no command operation or data transmitting within a certain period of time, the FTP server may initiatively close. Therefore, during the process of data echo, the timeout prompt might appear.

2.14.5 ZFTPDEL: delete files

Description This command is used to delete the files on the FTP server.

Syntax AT+ZFTPDEL=<dir&filename>

Description of parameters dir&filename: file directory or file name

Example at+zftpdel=test1.txt

OK

+ZFTPDEL:OK

Delete the file test1.txt on the FTP server.

Remarks None

68

GSM Module

2.14.6 ZFTPQUIT: quit FTP

Description This command is used to quit the FTP server.

Syntax AT+ZFTPQUIT

Description of parameters

Example

None at+zftpquit

OK

+ZFTPQUIT:OK

Quit the FTP server at+zftpquit

FTP IS NOT LOGIN

Quitted FTP server already, execute the delay command

Remarks None

69

GSM Module

2.15 Relevant Audio Commands

2.15.1 +ZCALLTONE: set pick-up tone

Description

Syntax

Parameter

Descriptions returned value

Example of

Play/pause the pick-up tone.

AT+ZCALLTONE=<n>

AT+ZCALLTONE=?

AT+ZCALLTONE?

<n>

0:pause the pick-up tone

1:play 400Hz pick-up tone

2:play 400Hz/25Hz pick-up tone

3:play 400Hz/50Hz pick-up tone

OK

+ZCALLTONE:<n>

OK

AT+ZCALLTONE=2

OK at+zcalltone?

+ZCALLTONE:2

OK

AT+ZCALLTONE=0

OK at+zcalltone?

+ZCALLTONE:0

OK

2.15.2 +ZDTMFTONE: set ZDTMF tone

Description

Syntax

Parameter

Play/pause the pick-up tone.

AT+ZDTMFTONE=<n>,<Duration>

AT+ZDTMFTONE =?

AT+ZDTMFTONE?

<n>

0~9

:play DTMF tone from

0 to 9;

10~13

:play DTMF tone from

A to D;

14

: play * DTMF tone;

15

: play # DTMF tone;

16

:stop playing DTMF tone ;

<Duration>

DTMF playing duration, unit: 20ms.

Value range: 0-1000。Set as 0, continue to play

Play pickup tone

Stop pickup tone

70

GSM Module

Descriptions returned value

Example of OK

+ZDTMFTONE:<n>,<Duration>

OK

AT+ZDTMFTONE=1,0

OK

AT+ZDTMFTONE?

+ZDTMFTONE:1,0

OK

AT+ZDTMFTONE=16,0

OK

AT+ZDTMFTONE?

+ZDTMFTONE:16,0

OK

AT+ZDTMFTONE=2,100

OK

Continue to play DTMF tone of number key 1;

Stop playing DTMF tone

Play DTMF tone of number key 2 for 2s;

2.15.3 +SPEAKER: audio channel switch command

Description

Syntax

Example

Parameters

This command is used to switch between the microphone and headset.

AT+SPEAKER=<mode>

Switch to microphone AT+SPEAKER=0

OK

AT+SPEAKER=1

OK

Switch to headset

AT+SPEAKER=?

+SPEAKER:(0-1)

OK

<mode>

0:microphone(default)

1:headset

Check status

2.15.4 +ZMICGB: set MIC audio parameters

Description This command is used to change MIC input channel

’s audio parameters.

Syntax AT+ZMICGB=<Gain>,<Bias>,<PGA> //set parameters

AT+ZMICGB=? //check parameter setting syntax

AT+ZMICGB? //check current parameters

Parameter Refer to the definitions of three parameters in MIC output circuit in figure 1.

1. Gain:0~7. refer to the corresponding relationship between the parameter and the gain;

71

GSM Module typedef enum L1BbcMicGainTag

{

MIC_GAIN_0 = 0,

MIC_GAIN_1,

MIC_GAIN_2,

MIC_GAIN_3,

MIC_GAIN_4,

MIC_GAIN_5,

MIC_GAIN_6,

MIC_GAIN_7

}

L1BbcMicGain;

2. Bias:0~7. refer to the corresponding relationship between the parameter and the current; typedef enum L1BbcMicBiasTag

{

MIC_BIAS_CURRENT_500_UA = 0,

MIC_BIAS_CURRENT_303_UA,

MIC_BIAS_CURRENT_183_6_UA,

MIC_BIAS_CURRENT_111_25_UA,

MIC_BIAS_CURRENT_67_41_UA,

MIC_BIAS_CURRENT_40_85_UA,

MIC_BIAS_CURRENT_24_75_UA,

MIC_BIAS_CURRENT_15_UA

}

L1BbcMicBias;

3. PGA:0~15。 refer to the corresponding relationship between the parameter and the db value; typedef enum L1BbcInputPgaGainTag

{

MIC_PGA_0db0 = 0

, MIC_PGA_1db5

, MIC_PGA_3db0

, MIC_PGA_4db5

, MIC_PGA_6db0

, MIC_PGA_7db5

, MIC_PGA_9db0

, MIC_PGA_10db5

, MIC_PGA_12db0

, MIC_PGA_13db5

, MIC_PGA_15db0

, MIC_PGA_16db5

72

GSM Module

Descriptions of returned value

Example

, MIC_PGA_18db0

, MIC_PGA_19db5

, MIC_PGA_21db0

, MIC_PGA_22db5

}

L1BbcInputPgaGain;

OK:parameter settings succeed;

ERROR:incorrect parameter syntax

AT+ZMICGB=0,3,12 Note: Gain: 0; Bias: 3; PGA: 12

Figure 1

73

GSM Module

3

Application Cases and Precautions

3.1 SMS Application Case

Note: The following text marked in red should be entered;

at+cmgf=1

OK

——Set the message’s input mode as text mode. at+cmgs="13360504647" <CR> hallo <ctrl/Z>

+CMGS: 1

OK

——Send one message. "13360504647" is the number of message recipient, and hallo is the message text. at+cmgw="13360504647" <CR> goodbye <ctrl/Z>

+CMGW: 1

OK

——write a message in "SM"."13360504647" is the number of message recipient, and goodbye is the message text. From the returned information +CMGW, we could see that the message is saved to the index 1. at+cpms?

+CPMS: "SM",1,50,"SM",1,50,"SM",1,50

OK

——Check the current memory. From +CPMS, we know there is a message in “SM”, which is the newly composed message. at+cmgr=1

+CMGR: "STO UNSENT","13360504647", goodbye

OK

——Read this message with the index No. From the returned information +CMGR, we know that the message is not sent.(" STO UNSENT "). at+cmss=1

+CMSS: 1

OK

——Send the saved message. at+cmgr=1

74

GSM Module

+CMGR: "STO SENT","13360504647", goodbye

OK

——Read this message with the index No. From the returned information +CMGR, we know that the message has been sent.(" STO SENT ") at+cnmi=3,2,0,0,0

OK

——Set the status of newly received message as “Directly display but not save”

+CMT: "+8615986672056","OK","07/08/27,13:23:56+32"

WESDDR

——Receive a new message, which is directly displayed but not saved. "+8615986672056" is the number of message recipient, "07/08/27,13:23:56+32" is the sending time and WESDDR is the message text. at+cnmi=3,1,0,0,0

OK

——” Set the status of newly received message as “Save but not display”

+CMTI: "SM", 28

——Receive a new message, which is saved but not displayed. From +CMTI, we know that the message is saved in the index 28 in

“SM”. at+cmgr=28

+CMGR: "REC UNREAD","15986672056","07/08/27,13:36:48+32"

CDFF

OK

——Read this message with the index No. "REC UNREAD" is the status of the message.

"15986672056" is the number of message recipient, "07/08/27, 13:36:48+32" is the sending time and

CDFF is the message text.

3.2 Phonebook Application Case

Note: The following text marked in red should be entered;

at+cpbs?

+CPBS:"SM",0,200

OK

——Check the current memory. The default phonebook memory is" SM ". From +CPMS, we know that the current phone memory

“SM” is empty.

75

GSM Module at+cpbw= 1,"13086672098",129,"john"

OK

——Write a phone entry into current phonebook memory “SM”. “1” represents save by auto searching space. "13086672098" is the telephone number, 120 is the type of phone number, and john is the name. at+cpbs?

+CPBS:"SM",1,200

OK

——Check the current memory. From +CPMS, we know that the entry has been stored at the index 1 in the current phone memory

“SM”. at+cpbr=1

+CPBR: 1,"13086672098",129,"john"

OK

——Read the phonebook entry. atd>1;

OK

——Dial the index number in the current phonebook. atd>"john";

OK

——Dial the name from the current phonebook. ath

OK

——Use ATH to hang up the call. at+cpbs=" ME "

OK

——Select "ME" phonebook memory. at+cpbs?

+CPBS: "ME",0,18

OK

——Check the current memory. From +CPMS, we know that the current phone memory “ME” is empty. at+cpbw= 1,"13086672098",129,"john"

OK

——Write a phone entry into the current phonebook memory “ME”. “1” represents save by auto searching space. "13086672098" is the telephone number, 129 is the type of phone number, and john is the name. at+cpbs?

76

GSM Module

+CPBS:"ME ",1,18

OK

——Check the current memory. From +CPMS, we know that the entry has been stored at the index 1 in the current phone memory

“ME” at+cpbr=1

+CPBR: 1,"13086672098",129,"john"

OK

——Read this phonebook entry.

77

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Related manuals

Download PDF

advertisement

Table of contents