Introduction To GSM / GPRS Wireless Modems 1.1. What Is A GSM Modem?
Introduction To GSM / GPRS Wireless Modems 1.1. What Is A GSM Modem?
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.
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.
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.
Some mobile phone models (example: Ericsson R380) cannot be used with a computer to
receive concatenated SMS messages.
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.
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.
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.
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:
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.
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:
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:
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:
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:
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.