You are on page 1of 2

AT Commands: .

Sending SMS using AT commands


We suggest try sending a few SMS using the Control Tool above to make sure your GSM modem can send SMS before proceeding. Let's look at the AT commands involved ..

AT+CMGF=1 To format SMS as a TEXT message


AT+CSCA="+xxxxx" Set your SMS center's number. Check with your provider. To send a SMS, the AT command to use is AT+CMGS

..

AT+CMGS="+yyyyy" <Enter> > Your SMS text message here <Ctrl-Z>


The "+yyyyy" is your receipent's mobile number. Next, we will look at receiving SMS via AT commands. > A simple demo of SMS text messaging. (When finished, press Ctrl+z of the keyboard.) +CMGW: 1 (note this number) OK

AT+CMSS=1 (the number is from returned value of CMGW) +CMSS: 20


OK

5. Receiving SMS using AT commands


The GSM modem can be configured to response in different ways when it receives a SMS. a) Immediate - when a SMS is received, the SMS's details are immediately sent to the host computer (DTE) via the +CMT command

AT+CMGF=1 To format SMS as a TEXT message AT+CNMI=1,2,0,0,0 Set how the modem will response when a SMS is received When a new SMS is received by the GSM modem, the DTE will receive the following .. +CMT : "+61xxxxxxxx" , , "04/08/30,23:20:00+40" This the text SMS message sent to the modem Your computer (DTE) will have to continuously monitor the COM serial port, read and parse the message. b) Notification - when a SMS is recieved, the host computer ( DTE ) will be notified of the new message. The computer will then have to read the message from the indicated memory location and clear the memory location. AT+CMGF=1 To format SMS as a TEXT message AT+CNMI=1,1,0,0,0 Set how the modem will response when a SMS is received When a new SMS is received by the GSM modem, the DTE will receive the following .. +CMTI: "SM",3 Notification sent to the computer. Location 3 in SIM memory AT+CMGR=3 <Enter> AT command to send read the received SMS from modem The modem will then send to the computer details of the received SMS from the specified memory location ( eg. 3 ) .. +CMGR: "REC READ","+61xxxxxx",,"04/08/28,22:26:29+40" This is the new SMS received by the GSM modem

After reading and parsing the new SMS message, the computer (DTE) should send a AT command to clear the memory location in the GSM modem .. AT+CMGD=3 <Enter> To clear the SMS receive memory location in the GSM modem If the computer tries to read a empty/cleared memory location, a +CMS ERROR : 321 will be sent to the computer. USSD Sendin:
at+cusd=1,"*140*11#" IMEI: IMSI: AT+CGSN AT+CIMI

Network: AT+COPS? AT+COPS=?


+COPS=mode, format, operator Mode 0 Automatic 1 Manual 4 If manual fails, try automatic Format 1 Long alpha 2 Short alpha 3 Numeric Operator Either the long alpha name, the short operator alpha code or the numeric code Status 0 unknown 1 available 2 current 3 forbidden

CHEK CHV AT+CPIN?

Change PIN +CPWD=SC,old pin, new pin Enable PIN +CLCK=SC,mode,pin Mode: 0=unlock, 1=lock, 2=query state On some modems it may be necessary to quote both SC and PIN.

You might also like