Monday, July 6, 2009

AT Commands (For GSP/GPRS Modems,Phones)

AT (ATtention ) Commands is the set of instructions for controlling Modems. "AT" as the prefix 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.This means every command line must begin with the letters AT, (except the commands A/ and +++).
To execute the command line, press the or key on your keyboard.
AT Commands are case insensitive ie ATD and atd are treated similarly .
Commands can be categorized into different types as :
Basic(commands that do not start with "+". For example, ATD,ATA etc)
Extended(Commands that start with "+". All GSM AT commands are extended commands. For example, +CMGS ,+CMGR etc )
Proprietary(Commands that start with "*".These commands are manufacturer specific)

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 addition, some AT commands require the support of mobile network operators. For example, SMS over GPRS can be enabled on some GPRS mobile phones with the +CGSMS command , But if the mobile network operator does not support the transmission of SMS over GPRS, you cannot use this feature.

Here are some terms and concepts on AT Commands:
The Command Line
A Command line provides an way to issue a number of commands at a time rather than issuing and waiting for the modem to react to each command separately. Macro Commands is Command line that contains several AT commands.
Repeating a Command Line
A/ is the command to repeat the last command line entered. In this case you do not need to type AT first, nor do you press at the end of the command line. This command comes is usefull in cases when you need to redial a number that got a busy signal.

Single Channel mode
In single channel mode, AT commands are sent and executed sequentially over the communication link. Only one medium is connected to the TA, no parallel execution of AT commands is possible.

Multi Channel mode
In multiple channel mode, several connections can be established at the same time either with 07.10 protocol activated on top of the serial link (multiplexed mode) or with several mediums connected. Each connection can be seen as an instance of the AT interface; hence commands can be executed in parallel on each connection.
Multiplexed Mode (07.10 Protocol )
This mode runs on top of the serial link and according to 07.10 protocol (MUX mode), several connections (virtual channels) can be established in parallel over a SINGLE serial link.
07.10 protocol is supported only over UART (DSL).

Switching From Data to Voice
To switch from a data mode to a voice mode issue the Escape sequence command (+++)

Resuming the Data Connection
When you are in the Command State and want to resume the data connection, type the following command:
ATO

Communication Channel Profiles
Normally the GSM/GPRS modems stores three different profiles in Non Volatile Memory i.e DEFAULT ,Profile 0,Profile 1.
And usually all the connection channels are created with its profile initialized to default profile.

AT&F
With this command the profile is returned back to default profile .
AT&W
With this command the current profile can be stored to Profile 0 or 1 based on AT&W0 or AT&W1
AT&V
This command can be used to view the Stored and Active Profile(s)

Some of the tasks that can be done using AT commands with a GSM/GPRS modem or mobile phone:
• Establish a data connection or voice connection to a remote modem (ATD, ATA, etc).
• 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.
• 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 network registration status (AT+CREG), radio signal strength (AT+CSQ), battery charge level and battery charging status (AT+CBC).

List of important AT Commands
PRODUCT SUPPORT

Command Description
ATS3 Command line termination character
ATS4 Response formatting character
ATS5 Command line editing character
ATE Command echo
ATQ Result code suppression
ATV Data Circuit Terminating Equipment (DCE) response format
ATX Result code selection and call progress monitoring control
AT&C Circuit 109 (received line signal detector) behaviour
AT&D Circuit 108 (data terminal ready) behaviour
AT+IFC Data Terminal Equipment (DTE)-DCE local flow control
AT+IPR Fixed DTE rate
AT+ILRR DTE-DCE local port rate reporting
AT+ICF DTE-DCE character framing

GENERIC COMMANDS

Command Description
ATZ Reset to default configuration
AT&F Set to factory-defined configuration
ATI Request identification information
AT+GMI Request terminal adapter (TA) manufacturer identification
AT+GMM Request TA model identification
AT+GMR Request TA revision identification
AT+GSN Request TA serial number identification
AT+GCAP Request complete capabilities list

AT&V View configuration
AT&W Store configuration
AT&Y Select power-up configuration

AT+CGMI Request mobile equipment (ME) manufacturer identification
AT+CGMM Request ME model identification
AT+CGMR Request ME revision identification
AT+CGSN Request ME serial number identification
AT+CSCS Select terminal equipment (TE) character set
AT+WS46 Select wireless network (GSM phones’ response is always 12, and it cannot be changed)
CALL CONTROL COMMANDS

Command Description
ATD Dial
ATA Answer response
ATH Hook control
ATO Return to online data state
ATS0 Automatic answer
ATS6 Pause before blind dialling
ATS7 Connection completion timeout
ATS8 Comma dial modifier time
ATS10 Automatic disconnect delay
ATL Monitor speaker loudness
ATM Monitor speaker mode
AT+DS Data compression
AT+DR Data compression reporting

NETWORK SERVICE COMMANDS (GSM 07.07)

Command Description
AT+CREG Network registration
AT+COPS Operator selection
AT+CLCK Facility lock
AT+CLIP Calling line identification presentation
AT+CLIR Calling line identification restriction
AT+COLP Connected line identification presentation
AT+CCFC Call forwarding number and conditions
AT+CCWA Call waiting
AT+CHLD Call related to supplementary services
AT+CUSD Unstructured supplementary services
AT+CSSN Supplementary service notifications
AT+CLCC List current calls
AT+CPWD Change passwords for the SIM/ME/network features

MOBILE EQUIPMENT CONTROL AND STATUS COMMANDS (GSM 07.07)

Command Description
AT+CPIN Enter Personal Identification Number (PIN)
AT+CSQ Signal quality
AT+CPBS Select phonebook memory storage
AT+CPBR Read phonebook entries
AT+CPBF Find phonebook entries
AT+CPBW Write phonebook entry
AT+CPAS Phone activity status
AT+CIMI Request International Mobile Subscriber Identity (IMSI)

SMS COMMANDS (GSM 07.05)

Command Description
AT+CSMS Select message service
AT+CPMS Preferred message storage
AT+CMGF Message format
AT+CSCA Service centre address
AT+CSMP Set text mode parameters
AT+CSDH Show text mode parameters
AT+CSCB Select cell broadcast message types
AT+CSAS Save settings
AT+CRES Restore settings
AT+CNMI New message indications to TE
AT+CMGL List messages
AT+CMGR Read message
AT+CNMA New message acknowledgement to ME/TA
AT+CMGS Send message
AT+CMSS Send message from storage
AT+CMGW Write message to memory
AT+CMGD Delete message
AT+CMGC Send command
AT+CMMS More messages to send
AT+CGSMS Select service for mobile-originated (MO) short messages

GPRS COMMANDS (GSM 07.07)

Command Description
AT+CGDCONT Define Packet Data Protocol (PDP) context
AT+CGATT GPRS attach or detach
AT+CGACT PDP context activate or deactivate
AT+CGDATA Enter data state
AT+CGREG GPRS network registration status
AT+CGEQREQ 3G quality of service (QoS) profile (requested)
AT+CGEQMIN 3G quality of service profile (minimum acceptable)
AT+CGEQNEG 3G quality of service profile (negotiated)