You are on page 1of 3

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. Since we are using GSM mobile phone in our project and it
contains the modem for sure , so we need AT commands to control the mobile and take
the required work from the mobile i.e. sending message to user contain the information of
car’s position or to stop the car engine. These commands control the mobile phone’s
modem and perform the desired function of messaging.

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.

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

SENDING SMS MESSAGES PC OR MICROCONTROLLER 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 PC or Microcontroller.

The key difference between them is that the AT+CMGS command takes the SMS text
input in real time while the AT+CMSS command takes the index number that specifies
the location of the SMS message in the mobile phone memory and then send the selected
message. Let's say the SMS text message is now located at index 3 of the message
storage area. You can use the AT+CMSS command to send the text message to other
mobile phone by the following command line:

AT+CMSS=3

The other command which send SMS by taking input is AT+CMGS.

The following 3 steps are involved in sending message.

1- Write AT command AT+CMGS = “Mobile Number” and press enter.


2- Write the desired text and press enter.
3- 3- Press ctrl+z to send the message.
USING THE +CMGR AT COMMAND TO READ AN SMS MESSAGE FROM A
MESSAGE STORAGE AREA

The +CMGR AT command is used to read an SMS message at a certain location of the
message storage area.

Following is an example of how AT+CMGR works.

AT+CMGR=3

This command will read the message from the location number 3. The GSM/GPRS
modem or mobile phone should return something like this:

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


Hello!!

USING THE +CPBR COMMAND TO READ PHONE BOOK ENTERY

The +CPBR AT command is used to read phone book entry at a certain location of
phone book memory.

Following is an example of how AT+CPBR works.

AT+CPBR=3

USING THE +CPBW COMMAND TO WRITE PHONE BOOK ENTERY

The +CPBW AT command is used to write phone book entry at a certain location of
phone book memory.

Following is an example of how AT+CPBW works.

AT+CPBW

USING THE +CPBF COMMAND TO WRITE PHONE BOOK ENTERY

The +CPBF AT command is used to find the name or phone number stored in phone
book at any location of phone book memory.

Following is an example of how AT+CPBF works.

AT+CPBF=3
USING THE +CMGD COMMAND TO DELETE SMS FROM MEMORY
STORAGE

The +CMGD AT command is used to delete SMS from any location of mobile phone
memory.

Following is an example of how AT+CMGD works.

+CMGD=index[,flag]

In the above line, index is an integer specifying the location of the SMS message to be
deleted from the message storage area by the +CMGD AT command, and flag is an
integer specifying whether to delete SMS messages according to their message status.
The SMS specification has defined these flag values: 0, 1, 2, 3 and 4.

• 0. Meaning: Delete only the SMS message stored at the location index from the
message storage area. This is the default value.
• 1. Meaning: Ignore the value of index and delete all SMS messages whose status
is "received read" from the message storage area.
• 2. Meaning: Ignore the value of index and delete all SMS messages whose status
is "received read" or "stored sent" from the message storage area.
• 3. Meaning: Ignore the value of index and delete all SMS messages whose status
is "received read", "stored unsent" or "stored sent" from the message storage area.
• 4. Meaning: Ignore the value of index and delete all SMS messages from the
message storage area.

http://www.developershome.com/

You might also like