Professional Documents
Culture Documents
Page 1 of 3
Steps using AT commands to send and receive SMS using a GSM modem from a
computer
After succesfully sending and receiving SMS using AT commands via the
HyperTerminal, developers can 'port' the ASCII instructions over to their programming
environment, eg. Visual Basic, C/C++ or Java and also programmically parse ASCII
messages from modem.
Most GSM modems comes with a simple manual and necessary drivers. To setup your
T-ModemUSB, download the USB GSM Modem Quick Start ( Windows ) guide
(460kB PDF). You would be able to send SMS from the Windows application and also
setup GPRS connectivity. The GSM modem will map itself as a COM serial port on
your computer.
Windows based control panel to setup GSM modem, GPRS and send SMS
You are now ready to start working with AT commands. Type in "AT" and you should
get a "OK", else you have not setup your HyperTerminal correctly. Check your port
http://www.control.com.sg/at_commands_sms.aspx 26/09/2010
Using AT commands to send SMS and receive SMS from a GSM modem using a com... Page 2 of 3
settings and also make sure your GSM modem is properly connected and the drivers
installed.
We are ready now to start working with AT commands to setup and check the status of
the GSM modem.
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+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.
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
When a new SMS is received by the GSM modem, the DTE will receive the following ..
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.
When a new SMS is received by the GSM modem, the DTE will receive the following ..
http://www.control.com.sg/at_commands_sms.aspx 26/09/2010
Using AT commands to send SMS and receive SMS from a GSM modem using a com... Page 3 of 3
The modem will then send to the computer details of the received SMS from the
specified memory location ( eg. 3 ) ..
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.
Once we are able to work the modem using AT commands, we can use high-level
programming ( eg. VB, C, Java ) to send the AT ASCII commands to and read messages
from the COM serial port that the GSM modem is attached to.
http://www.control.com.sg/at_commands_sms.aspx 26/09/2010