Friday, June 24, 2011

Using AT commands to send SMS and receive SMS from a GSM modem using a computer - Philippines or anywhere else. PART 1


I have recently thought of enabling my application to send SMS to local mobile phones. Have you ever wonder how its being done? In this article I might be showing you how to make your own application capable of sending and receiving SMS. 

The idea was from my instructor in college who developed a software capable of voice messaging and SMS. my instructors design was quite similar to that of OzekiSMS. It is an SMS gateway software widely used for applications with SMS capabilities. The illustration below, from  http://www.ozekisms.com  show you how it is done. 


If you have the money to buy this software, then it will provide everything you need to enable your application to send SMS. It provides API for different programming languages such as ASPPHPC#JAVAVB.NET and more. Sample codes are also provides in the documentation. Okey, so drop off and buy it now. 

Some of you might think of buying the SMS gateway software. But for those of you who don't have much of the money to buy the software, then make your own. Sounds great! And yes you can!

GSM Modem for SMS

I stumbled upon the available resources that I have and found myself looking for a perfect GSM Modem. Here it is! An imitated product of BlackBerry which is commonly called a China Mobile/Phone and a Nokia C3 (now an authentic one) owned by my mother. The mobile phone will serve as our GSM Modem connected to  a work station through a USB connector or Bluetooth. In my case I used Bluetooth to connect my China Phone to the computer.

Serial port connection

The phone connected to the computer will map itself to the COM serial port of the computer. Shown in the screenshot you can see this in the properties of your device. Notice COM6 which is labeled with Standard Parallel Port (SPP). This is the interface that we are going to use to connect to the device.

The next step is using the Hyper Terminal.
Windows XP: Go to START\Programs\Accessories\Communications\HyperTerminal
Vista or 7: Copy the HyperTerminal files from XP.

Connecting to Hyper Terminal

Create a new connection and connect using COM6. Once you have configured your Hyper Terminal you are now ready to work with "AT Commands".


Okey, well said. Lets discuss two basic functions. (Sending and Receiving SMS)

1. Sending SMS
AT
-this command should return "OK" which means that you are connected to your GSM Modem
AT+CMGF=1
-format SMS message as text
AT+CMGS="+63xxxxxxxxxx" <enter>
> Your Message <ctrl+z>
-this is the command to send text message where "+63xxxxxxxxx" is the mobile number of the recipient.
- the " >" indicates the area where you type your message and <ctrl+z> is the key to execute the command.
-this command will return "OK" which means that the message is sent.

Using AT commands in Hyper Terminal


That was quick and easy right? The next part of my post is about receiving the text message with AT commands. Keep in touch for more of these topic which is to make an application to send SMS. I will be using VB.NET in the next post to execute this AT commands and maybe integrate it to ASP.NET. Lets see how thing are done and of course you could also make your own. 

2 comments:

  1. I GOT: +CMS ERROR: 500 on hyperterminal.. ano po kaya ang problema? hindi ako makapag seng ng message.

    ReplyDelete
  2. sir posible ba na ung nsa database kong contacts ay mahugot nya ng sabay sabay at makapag send ng bulk.using vb.net i need help kc pra sa thesis namin reply at 19Datu68 at my fb account... thanks in advanced..

    ReplyDelete

You might also like:

Related Posts Plugin for WordPress, Blogger...