You are on page 1of 16

3.

7 GSM
GSM/GPRS module is used to establish communication between a computer and
a GSM-GPRS system. Global System for Mobile communication (GSM) is an architecture
used for mobile communication in most of the countries. Global Packet Radio Service
(GPRS) is an extension of GSM that enables higher data transmission rate. GSM/GPRS module
consists of a GSM/GPRS modem assembled together with power supply circuit and
communication interfaces (like RS-232, USB, etc) for computer. The MODEM is the soul of
such modules.

Fig 5.1 GSM/GPRS Module

3.8 Wireless MODEMs


Wireless MODEMs are the MODEM devices that generate, transmit or decode data from
a cellular network, for establishing communication between the cellular network and the
computer. These are manufactured for specific cellular network (GSM/UMTS/CDMA) or
specific cellular data standard (GSM/UMTS/GPRS/EDGE/HSDPA) or technology (GPS/SIM).
Wireless MODEMs like other MODEM devices use serial communication to interface with and
need Hayes compatible AT commands for communication with the computer (any
microprocessor or microcontroller system).

Fig 5.2
Wireless Modems

3.9 GSM/GPRS MODEM


GSM/GPRS MODEM is a class of wireless MODEM devices that are designed for
communication of a computer with the GSM and GPRS network. It requires a SIM (Subscriber
Identity Module) card just like mobile phones to activate communication with the network.
Also they have IMEI (International Mobile Equipment Identity) number similar to mobile
phones for their identification. A GSM/GPRS MODEM can perform the following operations:
1.
2.
3.

Receive, send or delete SMS messages in a SIM.


Read, add, search phonebook entries of the SIM.
Make, Receive, or reject a voice call.

The MODEM needs AT commands, for interacting with processor or controller, which
are communicated through serial communication. These commands are sent by the
controller/processor. The MODEM sends back a result after it receives a command. Different AT
commands supported by the MODEM can be sent by the processor/controller/computer to
interact with the GSM and GPRS cellular network.

3.10 GSM/GPRS Module


A GSM/GPRS module assembles a GSM/GPRS modem with standard communication
interfaces like RS-232 (Serial Port), USB etc., so that it can be easily interfaced with a computer
or a microprocessor / microcontroller based system. The power supply circuit is also built in the
module that can be activated by using a suitable adaptor.

Fig 5.3 GSM/GPRS Module, Modem

3.11 Mobile Station (Cell phones and SIM)


A mobile phone and Subscriber Identity Module (SIM) together form a mobile station. It
is the user equipment that communicates with the mobile network. A mobile phone comprises of
Mobile Termination, Terminal Equipment and Terminal Adapter.

Fig 5.4 How GSM/GPRS Works

Mobile Termination is interfaced with the GSM mobile network and is controlled by a
baseband processor. It handles access to SIM, speech encoding and decoding, signaling and other
network related tasks. The Terminal Equipment is an application processor that deals with
handling operations related to keypad, screen, phone memory and other hardware and software
services embedded into the handset.
The Terminal Adapter establishes communication between the Terminal Equipment and
the Mobile Termination using AT commands. The communication with the network in a
GSM/GPRS mobile is carried out by the baseband processor.
.

3.12 Applications of GSM/GPRS module


The GSM/GPRS module demonstrates the use of AT commands. They can feature all the
functionalities of a mobile phone through computer like making and receiving calls, SMS, MMS
etc. These are mainly employed for computer based SMS and MMS services.

3.13 AT Commands
AT commands are used to control MODEMs. AT is the abbreviation for Attention. These
commands come from Hayes commands that were used by the Hayes smart modems. The Hayes
commands started with AT to indicate the attention from the MODEM. The dial up and wireless
MODEMs (devices that involve machine to machine communication) need AT commands to
interact with a computer. These include the Hayes command set as a subset, along with other
extended AT commands.
AT commands with a GSM/GPRS MODEM or mobile phone can be used to access
following information and services:
1.
Information and configuration pertaining to mobile device or MODEM and SIM card.
2.
SMS services.
3.
MMS services.
4.
Fax services.
5.
Data and Voice link over mobile network.
The Hayes subset commands are called the basic commands and the commands specific to
a GSM network are called extended AT commands.

3.13.1 Command, Information response and Result Codes:


The AT commands are sent by the computer to the MODEM/ mobile phone. The
MODEM sends back an Information Response i.e. the information requested by or pertaining to
the action initiated by the AT command. This is followed by a Result Code. The result code tells
about the successful execution of that command.

Fig 5.5 Execution of AT Commands

There are also unsolicited Result Codes that are returned automatically by the MODEM to
notify the occurrence of an event. For example the reception of a SMS will force MODEM to
return an unsolicited result code.

3.13.2 AT commands' syntax


i.

Case Sensitivity The AT commands are generally used in uppercase letters. However some MODEMs and
mobile phones allow both uppercase and small case letters.
ii.

Single Command The AT commands include a prefix AT which indicates the beginning of the command to
MODEM; and a carriage return which indicates the end of the command.

Fig 5.6 Using a Single AT Command


However string AT itself is not the part of the command. For example in ATD, D is the
command name not ATD.
The extended AT commands have a + in the command name.
For example: AT+CGMI<Carriage return>
iii.

Command Line Multiple AT commands can be sent to MODEM in a single command line. The
commands in a line are separated by a semi-colon (;).

Fig 5.7 Command line

For example: AT+CGMI; +CBS<Carriage return>

iv.

String in Command Line Strings in a command line are enclosed in double quotes.
For example: AT+CGML=ALL<Carriage return>

Information Response and Result Code


The Information Response and Result Codes, returned by the MODEM, have a carriage
return and line feed in the beginning as well as at the end.
v.

Fig 5.7 Information Response and Result Code


For example:
<Carriage return><Line feed>OK<Carriage return><Line feed>
<Carriage return><Line feed>ERROR<Carriage return><Line feed>
<Carriage return><Line feed>+CBC: 0, 60<Carriage return><Line feed> etc.

vi.

Sequence of Execution -

In the command line, the command appearing first is executed first. The execution then
follows for second appeared command and so on. The execution of commands in a command
line takes place in sequential manner.
If an error occurs in the execution of a command, an error result code is returned by the
MODEM and the execution of the command line is terminated irrespective of presence of other
commands next in the command line.

Types of commands:
There are four types of AT commands:

1) Test commands
2) Read commands
3) Set commands
4) Execution commands
For more details, see AT Commands.

Different Result Codes:


RESULT CODE
OK
ERROR
+CMS ERROR

DESCRIPTION
Successful Execution of a command
Execution of a command failed
Message service failure, is returned with an error code

Unsolicited Result Codes


Notify receipt of SMS status report of a new message to
+CDS
computer
Notify receipt of SMS status report of a new message and its
+CDSI
location in memory to computer
Notify forwarding of a new SMS to computer
+CMT
Notify receipt of SMS status report of a new message and its
+CMTI
location in memory to computer
Table 5.1 Different Result Codes

3.13.3 Types of AT Commands:


There are four types of AT commands:

Fig 5.8 AT Commands Classification


1) Test commands - used to check whether a command is supported or not by the MODEM.
SYNTAX:
AT<command name>=?
For example:
ATD=?

2)

Read command - used to get mobile phone or MODEM settings for an operation.

SYNTAX:
For example:

AT<command name>?
AT+CBC?

3) Set commands - used to modify mobile phone or MODEM settings for an operation.
SYNTAX:
AT<command name>=value1, value2, ,value N
Some values in set commands can be optional.
For example:
AT+CSCA=+9876543210, 120
4)

Execution commands - used to carry out an operation.

SYNTAX:
AT<command name>=parameter1, parameter2, ,parameter N
The read commands are not available to get value of last parameter assigned in execution
commands because parameters of execution commands are not stored.
For example:
AT+CMSS=1,+ 9876543210, 120

Explanation of commonly used AT commands:


1) AT - This command is used to check communication between the module and the computer.
For example,
AT
OK
The command returns a result code OK if the computer (serial port) and module are connected
properly. If any of module or SIM is not working, it would return a result code ERROR.

2) +CMGF - This command is used to set the SMS mode. Either text or PDU mode can be
selected by assigning 1 or 0 in the command.
SYNTAX:
AT+CMGF=<mode>
0: for PDU mode
1: for text mode
The text mode of SMS is easier to operate but it allows limited features of SMS. The
PDU
(protocol data unit) allows more access to SMS services but the operator requires bit
level knowledge of TPDUs. The headers and body of SMS are accessed in hex format in PDU
mode so it allows availing more features.
For example,

AT+CMGF=1
OK
3) +CMGW - This command is used to store message in the SIM.
SYNTAX:
AT+CMGW= Phone number> Message to be stored Ctrl+z
As one types AT+CMGW and phone number, > sign appears on next line where one can type
the message. Multiple line messages can be typed in this case. This is why the message is
terminated by providing a Ctrl+z combination. As Ctrl+zis pressed, the following information
response is displayed on the screen.
+CMGW: Number on which message has been stored

4) +CMGS - This command is used to send a SMS message to a phone number.


SYNTAX:
AT+CMGS= serial number of message to be send.
As the command AT+CMGS and serial number of message are entered, SMS is sent to the
particular SIM.
For example,
AT+CMGS=1
OK
5) ATD - This command is used to dial or call a number.
SYNTAX:
ATD<Phone number>(Enter)
For example,
ATD123456789
6) ATA - This command is used to answer a call. An incoming call is indicated by a message
RING which is repeated for every ring of the call. When the call ends NO CARRIER is
displayed on the screen.
SYNTAX:

ATA(Enter)

As ATA followed by enter key is pressed, incoming call is answered.


For example,
RING
RING
ATA

7) ATH - This command is used to disconnect remote user link with the GSM module.
SYNTAX:
ATH (Enter)

List of AT commands:
The AT commands for both, GSM module and the mobile phone, are listed below. Some of these
commands may not be supported by all the GSM modules available. Also there might be some
commands which wont be supported by some mobile handsets.

Testing :
Command
AT

Description
Checking communication between the
module and computer.
Table 5.2 Testing

Call control :
Command
ATA
ATD
ATH
ATL
ATM
ATO
ATP
ATT
AT+CSTA
AT+CRC

Description
Answer command
Dial command
Hang up call
Monitor speaker loudness
Monitor speaker mode
Go on-line
Set pulse dial as default
Set tone dial as default
Select type of address
Cellular result codes
Table 5.3 Call Control

Data card Control :


Command
ATI
ATS
ATZ
AT&F
AT&V

Description
Identification
Select an S-register
Recall stored profile
Restore factory settings
View active configuration

AT&W
AT&Y
AT+CLCK
AT+COLP

Store parameters in given profile


Select Set as power up option
Facility lock command
Connected
line
identification
presentation
Request complete capabilities list
Request manufacturer identification
Request model identification
Request revision identification
Request
product
serial
number
identification (IMEI)

AT+GCAP
AT+GMI
AT+GMM
AT+GMR
AT+GSN

Table 5.4 Data card Control

Phone control :
Command
AT+CBC
AT+CGMI
AT+CGMM
AT+CGMR
AT+CGSN

Description
Battery charge
Request manufacturer identification
Request model identification
Request revision identification
Request
product
serial
number
identification
Report mobile equipment error
Phone activity status
Find phone book entries
Read phone book entry
Select phone book memory storage
Write phone book entry
Select TE character set
Signal quality

AT+CMEE
AT+CPAS
AT+CPBF
AT+CPBR
AT+CPBS
AT+CPBW
AT+CSCS
AT+CSQ

Table 5.5 Phone Control

Computer data interface :


Command
ATE
ATQ
ATV

Description
Command Echo
Result code suppression
Define response format

ATX
AT&C
AT&D
AT&K
AT&Q
AT&S
AT+ICF
AT+IFC
AT+IPR

Response range selection


Define DCD usage
Define DTR usage
Select flow control
Define communications mode option
Define DSR option
DTE-DCE character framing
DTE-DCE Local flow control
Fixed DTE rate
Table 5.6 Computer data interface

Service :
Command
AT+CLIP
AT+CR
AT+DR
AT+ILRR

Description
Calling line identification presentation
Service reporting control
Data compression reporting
DTE-DCE local rate reporting
Table 5.7 Service

Network Communication parameter:


Command
ATB
AT+CBST
AT+CEER
AT+CRLP
AT+DS

Description
Communications standard option
Select bearer service type
Extended error report
Radio link protocol
Data compression

Table 5.8 Network Communication parameter

Miscellaneous:
Command
A/
AT?
AT*C
AT*T
AT*V
AT*NOKIATEST
AT+CESP

Description
Re-execute command line
Command help
Start SMS interpreter
Enter SMS block mode protocol
Activate V.25bis mode
Test command
Enter SMS block mode protocol

Table 5.9 Miscellaneous

You might also like