0% found this document useful (0 votes)
12 views10 pages

Introduction To GSM / GPRS Wireless Modems 1.1. What Is A GSM Modem?

Uploaded by

Geo Babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views10 pages

Introduction To GSM / GPRS Wireless Modems 1.1. What Is A GSM Modem?

Uploaded by

Geo Babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

1.

Introduction to GSM / GPRS Wireless Modems


1.1. What is a GSM Modem?
A GSM modem is a wireless modem that works with a GSM wireless network. A wireless
modem behaves like a dial-up modem. The main difference between them is that a dial-up
modem sends and receives data through a fixed telephone line while a wireless modem sends and
receives data through radio waves.

A GSM modem can be an external device or a PC Card / PCMCIA Card. Typically, an external
GSM modem is connected to a computer through a serial cable or a USB cable. A GSM modem
in the form of a PC Card / PCMCIA Card is designed for use with a laptop computer. It should
be inserted into one of the PC Card / PCMCIA Card slots of a laptop computer.

Like a GSM mobile phone, a GSM modem requires a SIM card from a wireless carrier in order
to operate. As mentioned in earlier sections of this SMS tutorial, computers use AT commands to
control modems. Both GSM modems and dial-up modems support a common set of standard AT
commands. You can use a GSM modem just like a dial-up modem.

In addition to the standard AT commands, GSM modems support an extended set of AT


commands. These extended AT commands are defined in the GSM standards. With the extended
AT commands, you can do things like:

 Reading, writing and deleting SMS messages.


 Sending SMS messages.
 Monitoring the signal strength.
 Monitoring the charging status and charge level of the battery.
 Reading, writing and searching phone book entries.

The number of SMS messages that can be processed by a GSM modem per minute is very low --
only about six to ten SMS messages per minute.

1.2. What is a GPRS Modem?


A GPRS modem is a GSM modem that additionally supports the GPRS technology for data
transmission. GPRS stands for General Packet Radio Service. It is a packet-switched technology
that is an extension of GSM. (GSM is a circuit-switched technology.) A key advantage of GPRS
over GSM is that GPRS has a higher data transmission speed.

GPRS can be used as the bearer of SMS. If SMS over GPRS is used, an SMS transmission speed
of about 30 SMS messages per minute may be achieved. This is much faster than using the
ordinary SMS over GSM, whose SMS transmission speed is about 6 to 10 SMS messages per
minute. A GPRS modem is needed to send and receive SMS over GPRS. Note that some
wireless carriers do not support the sending and receiving of SMS over GPRS.
If you need to send or receive MMS messages, a GPRS modem is typically needed.

1.3. Which is Better: Mobile Phone or GSM / GPRS


Modem?
In general, a GSM/GPRS modem is recommended for use with a computer to send and receive
messages. This is because some mobile phones have certain limitations comparing to
GSM/GPRS modems. Some of the limitations are described below:

 Some mobile phone models (example: Ericsson R380) cannot be used with a computer to
receive concatenated SMS messages.

What is a concatenated SMS message?


A concatenated SMS message is a message that contains more than 140 bytes. (A normal
SMS message can only contain at most 140 bytes.) Concatenated SMS works like this:
the sender's mobile device breaks a message longer than 140 bytes into smaller parts.
Each of these parts are then fitted in a single SMS message and sent to the recipient.
When these SMS messages reach the destination, the recipient's mobile device will
combine them back to one message.

What is the cause of the problem?


When the mobile phone receives the SMS messages that are parts of a concatenated SMS
message, it combines them to one message automatically. The correct behavior should
be: when the mobile phone receives the SMS messages that are parts of a concatenated
SMS message, it forwards them to the computer without combining them.
 Many mobile phone models cannot be used with a computer to receive MMS messages.
Because when they receive a MMS notification, they handle it automatically instead of
forwarding it to the computer.
 A mobile phone may not support some AT commands, command parameters and
parameter values. For example, some mobile phones do not support the sending and
receiving of SMS messages in text mode. So, the AT command "AT+CMGF=1" (it
instructs the mobile phone to use text mode) will cause an error message to be returned.
Usually GSM/GPRS modems support a more complete set of AT commands than mobile
phones.
 Most SMS messaging applications have to be available 24 hours a day. (For example, an
SMS messaging application that provides ringtone downloading service should be
running all the time so that a user can download ringtones any time he/she wants.) If such
SMS messaging applications use mobile phones to send and receive SMS messages, the
mobile phones have to be switched on all the time. However, some mobile phone models
cannot operate with the battery removed even when an AC adaptor is connected, which
means the battery will be charged 24 hours a day.

Besides the above issues, mobile phones and GSM/GPRS modems are more or less the same for
sending and receiving SMS messages from a computer. Actually, you can consider an AT-
command-enabled mobile phone as "GSM/GPRS modem + keypad + display + ...".
There is not much difference between mobile phones and GSM/GPRS modems in terms of SMS
transmission rate, since the determining factor for the SMS transmission rate is the wireless
network.

1.4 Introduction to AT Commands


AT commands are instructions used to control a modem. AT is the abbreviation of ATtention.
Every command line starts with "AT" or "at". That's why modem commands are called AT
commands. Many of the commands that are used to control wired dial-up modems, such as ATD
(Dial), ATA (Answer), ATH (Hook control) and ATO (Return to online data state), are also
supported by GSM/GPRS modems and mobile phones. Besides this common AT command set,
GSM/GPRS modems and mobile phones support an AT command set that is specific to the GSM
technology, which includes SMS-related commands like AT+CMGS (Send SMS message),
AT+CMSS (Send SMS message from storage), AT+CMGL (List SMS messages) and
AT+CMGR (Read SMS messages).

Note that the starting "AT" is the prefix that informs the modem about the start of a command
line. It is not part of the AT command name. For example, D is the actual AT command name in
ATD and +CMGS is the actual AT command name in AT+CMGS. However, some books and
web sites use them interchangeably as the name of an AT command.

Here are some of the tasks that can be done using AT commands with a GSM/GPRS modem or
mobile phone:

 Get basic information about the mobile phone or GSM/GPRS modem. For example,
name of manufacturer (AT+CGMI), model number (AT+CGMM), IMEI number
(International Mobile Equipment Identity) (AT+CGSN) and software version
(AT+CGMR).
 Get basic information about the subscriber. For example, MSISDN (AT+CNUM) and
IMSI number (International Mobile Subscriber Identity) (AT+CIMI).
 Get the current status of the mobile phone or GSM/GPRS modem. For example, mobile
phone activity status (AT+CPAS), mobile network registration status (AT+CREG), radio
signal strength (AT+CSQ), battery charge level and battery charging status (AT+CBC).
 Establish a data connection or voice connection to a remote modem (ATD, ATA, etc).
 Send and receive fax (ATD, ATA, AT+F*).
 Send (AT+CMGS, AT+CMSS), read (AT+CMGR, AT+CMGL), write (AT+CMGW) or
delete (AT+CMGD) SMS messages and obtain notifications of newly received SMS
messages (AT+CNMI).
 Read (AT+CPBR), write (AT+CPBW) or search (AT+CPBF) phonebook entries.
 Perform security-related tasks, such as opening or closing facility locks (AT+CLCK),
checking whether a facility is locked (AT+CLCK) and changing passwords
(AT+CPWD).
(Facility lock examples: SIM lock [a password must be given to the SIM card every time
the mobile phone is switched on] and PH-SIM lock [a certain SIM card is associated with
the mobile phone. To use other SIM cards with the mobile phone, a password must be
entered.])
 Control the presentation of result codes / error messages of AT commands. For example,
you can control whether to enable certain error messages (AT+CMEE) and whether error
messages should be displayed in numeric format or verbose format (AT+CMEE=1 or
AT+CMEE=2).
 Get or change the configurations of the mobile phone or GSM/GPRS modem. For
example, change the GSM network (AT+COPS), bearer service type (AT+CBST), radio
link protocol parameters (AT+CRLP), SMS center address (AT+CSCA) and storage of
SMS messages (AT+CPMS).
 Save and restore configurations of the mobile phone or GSM/GPRS modem. For
example, save (AT+CSAS) and restore (AT+CRES) settings related to SMS messaging
such as the SMS center address.

Note that mobile phone manufacturers usually do not implement all AT commands, command
parameters and parameter values in their mobile phones. Also, the behavior of the implemented
AT commands may be different from that defined in the standard. In general, GSM/GPRS
modems designed for wireless applications have better support of AT commands than ordinary
mobile phones.

In addition, some AT commands require the support of mobile network operators. For example,
SMS over GPRS can be enabled on some GPRS mobile phones and GPRS modems with the
+CGSMS command (command name in text: Select Service for MO SMS Messages). But if the
mobile network operator does not support the transmission of SMS over GPRS, you cannot use
this feature.

1.5 Basic Commands and Extended Commands


There are two types of AT commands: basic commands and extended commands.

Basic commands are AT commands that do not start with "+". For example, D (Dial), A
(Answer), H (Hook control) and O (Return to online data state) are basic commands.

Extended commands are AT commands that start with "+". All GSM AT commands are
extended commands. For example, +CMGS (Send SMS message), +CMSS (Send SMS message
from storage), +CMGL (List SMS messages) and +CMGR (Read SMS messages) are extended
commands.

1.6. Sending SMS Messages Using AT Commands


(AT+CMGS, AT+CMSS)
Either of the AT commands +CMGS (command name in text: Send Message) and +CMSS
(command name in text: Send Message from Storage) can be used to send SMS messages from a
computer / PC. The key difference between them is that the +CMGS AT command takes the
SMS message to be sent as a parameter, while the +CMSS AT command takes the index number
that specifies the location of the SMS message in the message storage area as a parameter.
Following is an example for illustrating the difference. Suppose you want to send the text
message "Sending text messages is easy." from a computer / PC to the mobile phone number
91234567 using the +CMGS AT command in SMS text mode. Here is the command line to be
used:

AT+CMGS="91234567"<CR>Sending text messages is easy.<Ctrl+z>

To send the same text message using the +CMSS AT command, first you have to use the AT
command +CMGW (command name in text: Write Message to Memory) to write the text
message to the message storage area. In SMS text mode, the command line should be:

AT+CMGW="91234567"<CR>Sending text messages is easy.<Ctrl+z>

Let's say the SMS text message is now located at index 3 of the message storage area. You can
use the +CMSS AT command to send the text message to the message center by the following
command line:

AT+CMSS=3

As storage space is limited, if every SMS text message sent is left in the message storage area,
there will come a time when no more SMS text messages can be written. To free some storage
space, you can use the AT command +CMGD (command name in text: Delete Message) to
delete the SMS text message from the message storage area, like this:

AT+CMGD=3

As you can see above, sending an SMS message by the +CMSS AT command is a bit
cumbersome, since it involves more steps and AT commands. However, a copy of the sent SMS
message can be saved in the message storage area. This is not achievable with the +CMGS AT
command.

In some situations, it is more convenient to send SMS messages by the +CMSS AT command
than the +CMGS AT command. For example, if you have to send the same SMS message to
multiple recipients, using the +CMSS AT command is more convenient:

AT+CMSS=3,"91234567"

AT+CMSS=3,"97777777"

AT+CMSS=3,"96666666"

Note: To keep things simple in the above examples, we assume that the same message storage
area is used by the AT commands +CMSS, +CMGW, +CMGD and for receiving SMS messages.
But this may not be true in real situations.
1.7 Comparison Table of the AT Commands +CMGS and
+CMSS
The comparison table below summarizes the differences between the AT commands +CMGS
and +CMSS that are discussed in the previous section.

+CMGS AT command +CMSS AT command


Parameters +CMGS takes the SMS +CMSS takes the index
message to be sent as a number that specifies the
parameter. location of the SMS message
in the message storage area as
a parameter.
Sending new SMS messages Using +CMGS is more +CMSS has to be used
convenient. +CMGS can be together with +CMGW and
used to send new SMS +CMGD for sending new
messages without the help of SMS messages. As a result,
other AT commands. the process involves more
steps and is a bit cumbersome.
However, no copy of the SMS
message sent is saved in the However, a copy of the SMS
message storage area. message sent can be saved in
the message storage area.
Sending the same SMS Using +CMGS is less Using +CMSS is more
message to multiple recipients convenient. convenient.

1.7. Reading SMS Messages from a Message Storage Area


Using AT Commands (AT+CMGR, AT+CMGL)
To enable a computer / PC to read SMS messages from a message storage area, the GSM/GPRS
modem or mobile phone has to support either of the AT commands +CMGR (command name in
text: Read Messages) and +CMGL (command name in text: List Messages). The +CMGR AT
command is used to read an SMS message at a certain location of the message storage area,
while the +CMGL AT command is used to read SMS messages that have a certain status from
the message storage area. The status can be "received unread", "received read", "stored unsent",
"stored sent", etc. The +CMGL AT command also allows you to retrieve all SMS messages
stored in the message storage area.

Following is an example for illustrating the difference between +CMGR and +CMGL. Suppose
you want to use your computer / PC to read a text message from the message storage area and
you know the index at which the SMS text message is located. In this case, you should use the
+CMGR AT command. Here is the command line to be typed (assume the SMS text message is
stored at index 3):
AT+CMGR=3

The GSM/GPRS modem or mobile phone should return something like this:

+CMGR: "REC READ"," +85291234567",,"07/02/18,00:12:05+32"


Hello, welcome to our SMS tutorial.

OK

Suppose you are now in another situation. You want to use your computer / PC to retrieve all
inbound SMS messages that have not been read before. In this case, you should use the +CMGL
AT command. In SMS text mode, the command line to be used should be:

AT+CMGL="REC UNREAD"

The GSM/GPRS modem or mobile phone should return something like this:

+CMGL: 1,"REC UNREAD"," +85291234567",,"07/02/18,00:05:10+32"


Reading text messages is easy.

+CMGL: 2,"REC UNREAD"," +85291234567",,"07/02/18,00:07:22+32"


A simple demo of SMS text messaging.

OK

The +CMGL AT command can also be used to read all SMS messages stored in the message
storage area. To do so in SMS text mode, the command line should be:

AT+CMGL="ALL"

This time the response of the GSM/GPRS modem or mobile phone should be something like
this:

+CMGL: 1,"REC READ"," +85291234567",,"07/02/18,00:05:10+32"


Reading text messages is easy.

+CMGL: 2,"REC READ"," +85291234567",,"07/02/18,00:07:22+32"


A simple demo of SMS text messaging.

+CMGL: 3,"REC READ"," +85291234567",,"07/02/18,00:12:05+32"


Hello, welcome to our SMS tutorial.

OK

As you can see above, the +CMGR AT command can only be used to read one SMS message at
a time, while the +CMGL AT command can be used to read multiple SMS messages at a time.
Another difference between the AT commands +CMGR and +CMGL is that +CMGR can be
used to retrieve more message details than +CMGL when the GSM/GPRS modem or mobile
phone is operating in SMS text mode. Here are the message details that can be retrieved by the
+CMGR AT command in SMS text mode:

 Status of the SMS message ("received unread", "received read", "stored unsent", "stored
sent", etc).
 Originator/recipient phone number stored in the SMS message header and the type of the
phone number.
 Text associated to the originator/recipient phone number in the phonebook.
 Time and date at which the SMS message arrived at the SMSC (available to incoming
SMS messages only).
 The first octet (1 octet = 8 bits) of the TPDU (Transport Protocol Data Unit) of the SMS
message.
 The protocol identifier value in the TPDU of the SMS message.
 The data coding scheme value in the TPDU of the SMS message.
 SMSC number stored with the SMS message and the type of the SMSC number.
 Validity period of the SMS message (available to outgoing SMS messages only).
 Body of the SMS message and its length.

Here are the message details that can be retrieved by the +CMGL AT command in SMS text
mode:

 The index specifying the location of the SMS message in the message storage area.
 Status of the SMS message ("received unread", "received read", "stored unsent", "stored
sent", etc).
 Originator/recipient phone number stored in the SMS message header and the type of the
phone number.
 Text associated to the originator/recipient phone number in the phonebook.
 Time and date at which the SMS message arrived at the SMSC (available to incoming
SMS messages only).
 Body of the SMS message and its length.

If you compare the above two lists, you will find that the following message details can only be
retrieved by the +CMGR AT command but not the +CMGL AT command:

 The first octet of the TPDU of the SMS message.


 The protocol identifier value in the TPDU of the SMS message.
 The data coding scheme value in the TPDU of the SMS message.
 SMSC number stored with the SMS message and the type of the SMSC number.
 Validity period of the SMS message (available to outgoing SMS messages only).

Note: If the GSM/GPRS modem or mobile phone is operating in SMS PDU mode, the message
details that can be retrieved by +CMGR and +CMGL are the same.
1.8. Comparison Table of the AT Commands +CMGR and
+CMGL
The comparison table below summarizes the differences between the AT commands +CMGR
and +CMGL that are discussed in the previous section.

+CMGR AT command +CMGL AT command


Usage +CMGR is used to read an +CMGL is used to read SMS
SMS message at a certain messages that have a certain
location of the message status (examples: "received
storage area. unread", "received read",
"stored unsent" and "stored
sent") from the message
storage area. It also allows you
to retrieve all SMS messages
stored in the message storage
area.
Number of SMS messages +CMGR returns one SMS +CMGL returns one or more
returned message. SMS messages.
Message details returned 1. 1. The index specifying
(SMS text mode) the location of the SMS
(Note: +CMGR does message in the message
not provide the index storage area.
of the SMS message in 2. Status of the SMS
the response because it message ("received
is the parameter value unread", "received
you passed to read", "stored unsent",
+CMGR.) "stored sent", etc).
2. Status of the SMS 3. Originator/recipient
message ("received phone number stored in
unread", "received the SMS message
read", "stored unsent", header and the type of
"stored sent", etc). the phone number.
3. Originator/recipient 4. Text associated to the
phone number stored originator/recipient
in the SMS message phone number in the
header and the type of phonebook.
the phone number. 5. Time and date at which
4. Text associated to the the SMS message
originator/recipient arrived at the SMSC
phone number in the (available to incoming
phonebook. SMS messages only).
5. Time and date at 6.
+CMGR AT command +CMGL AT command
which the SMS 7.
message arrived at the 8.
SMSC (available to 9.
incoming SMS 10.
messages only). 11. Body of the SMS
6. The first octet (1 octet message and its length.
= 8 bits) of the TPDU
(Transport Protocol
Data Unit) of the SMS
message.
7. The protocol identifier
value in the TPDU of
the SMS message.
8. The data coding
scheme value in the
TPDU of the SMS
message.
9. SMSC number stored
with the SMS message
and the type of the
SMSC number.
10. Validity period of the
SMS message
(available to outgoing
SMS messages only).
11. Body of the SMS
message and its length.

Message details returned Same


(SMS PDU mode)

You might also like