How to use AT commands to communicate with Phones

, , No Comments
Have you ever sent an SMS on your phone via Hyperterminal or called someone on phone straight from Hyperterminal? You might ask: why the fuss?

Well like me, you might need to do a project that requires automation of some phone actions (like calling or sending feedback SMS) or you just want to do everything from the Terminal.

So here we go...

1. Make sure you get a phone that can understand AT commands, not all phones can.
2. Get the data cable for the phone, be it serial or USB cable.
3. Make sure you have a serial/com terminal communication tool like the popular Hyperterminal that comes with windows XP or the free to download ones like putty, kermit and tterm.
4. Got to device manager on the windows OS ( for Linux users, please request me to give you the procedure as it is quite cryptic) and check under ports for the com port allocated to your data cable.
5. Run the terminal communication software, indicate the communication port, choose '8' data bits, parity 'None', 1 and handshake 'none', baudrate '9600' and stop bits '1'.
6. When the terminal indicates connected, enter 'at' (without the quotes), you must get an OK reply.
7.You will need to enter 'at+cmgf=1', to put the phone in data mode and not the default pdu (protocol data unit, an hexadecimal mode) mode, this is important if you want to send or read SMS using AT commands.
8. The following are the basic at commands you will need to read messages, send messages, place a phone call,end a call and get firmware information.
at+cbc (to detect battery level, between 1 and 100)
at+cgmr (get phone software version)
at+cpms="sm"."sm","mt" (this actually the default, but if you have changed it, this will reset the selected message memory back to sim memory)
at+cpms="me","me","mt" (to set selected message memory to phone memory)
at+cmgl="all" (display all messages in selected memory)
at+cmgl="rec unread" (display only unread messages in the selected memory)
at+cmgl="rec read" (display all read messages in selected memory)
at+cmgl="sto sent" (display all sent messages in selected memory)
at+cmgl="sto unsent" (display all unsent messages in selected memory)
at+cmgr=18 (read message in memory location 18, you indicate another location other tahn 18)
at+cmgd=18 (delete message in memory location 18)
at+cmgs="1234" (request to send message to phone number 1234, you will see symbol '>', enter your text message here and end it with ctrl+z, do not press backspace or enter)
atdt08001234 (dial phone number 08001234)

These commands with work on most phones that allow AT commands. If you desire to do additional stuffs not implementable with the commands above, you can use the Google search to search for the list of AT commands supported by your phone.

Thanks for checking out my blog. Look around on the top right for posts you may benefit from, and click to subscribe and receive useful tips via e-mail.


Post a Comment

You can be sure of a response, a very relevant one too!

Click on Subscribe by Email just down below the comment box so you'll be notified of my response.