Loading

Sending SMS using AT Commands via GSM Modem/GSM Phone (receiving SMS-updated)

Submitted by: 
Language: 
Visitors have accessed this post 150014 times.




THE FULL SEND AND RECEIVED SMS SERVER with  complete Source Codes for developers are available to purchase.

.NET version is also available 

http://www.sourcecodester.com/visual-basic-net/net-version-sending-sms-using-commands-gsm-modemgsm-phone.html

Feel free to contact me at the addresses and links below:

Demo:

This a sample how to send SMS using AT Commands like in Hyper Terminal via GSM Modem or compatible GSm phone attatched to the PC Comport or USB port..

For this sample i used Huawei E160 GSM/HSDPA/GPRS modem..

demonstrate how to use MSComm Control in VB6 in order to send data to the GSM Modem

TODO:

this code may not work with other modem so better check your modem's specs and manual

check your modem's settings (baud Rate,RtsHold,HandShake, etc .and comport number in order to run this project..

Good NEWS:

java and php version will out this month..

THE FULL SEND AND RECEIVED SMS SERVER with  complete Source Codes for developers are available to purchase.

Feel free to contact me at the addresses and links below:

feel free to use and improved my sample code, 

Goodluck

Questions and request?

http://www.emondsoft-solutions.com/

Facebook Fan Page

http://www.facebook.com/pages/emondsoft/120502167993693

Download Code: 

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

Hello Sir

I want to ask all of you some question

First I want to know about Sending SMS using AT Commands via GSM Modem/GSM Phone
We can send to mobile phone right?
If I has database(Phone Number) already Can I send it in the same time to all phone number that I have already in Database,
If it's cannot, can you help me to update this programs,

Chum Sorphorn
Student,
chumsorphorn@yahoo.com,chumsorphorn@gmail.com

emond's picture

yes, it can send SMS to all the numbers stored in your database, u can code it by adding a loop function to your code.

If you want to send a 100 SMS per 10 sec you must use some SMS server or gateways.

for more info just email or PM me.

dark_raditz0825@yahoo.com

emond sabiniano
System Developer-Software Consultant

to all model ba ng CP pwde to?.....

emond's picture

Nope, only phones that supports AT commands, but most of all GSM modem supports At commands

emond sabiniano
System Developer-Software Consultant

i want to send more sms send at a time. how to give mobile numbers
plesae give idea

hi
is there any free sms gateway provider.i want to test my code please or we need to pay for it.

admin's picture

All sms gateway provider requires you to pay before you can use their service.

Actually you can do this using kannel gateway. But kannel runs on Linux only. You can use your mobile phone with kannel.

But my experience on this sms gateway is that it is very hard to configure this software especially if you don't have enough knowledge on Linux operating system.

i am facing some difficulties. i am trying to create a website form ( visual basic 2005) and by using at commands and a gsm modem, enabling me to send SMS via the website. So am i able to use the same codes?

pinuno's picture

if the web site is intended to be uploaded in a commercial web hosting company, it is not advisable to use the said method of providing sms service not Unless you wIll be setting up your own web server...

HAROLD R. LUCERO, MIT
Software Developer, Web Developer, Graphic Artist, IT Professor

how do i pay, and price

I can configure kannel for SMSC conectivity but I want to configure it for GSM modem which modem I can use with kannel Plz guide me and smskannel.conf file needs which modifications....?

admin's picture

Read the phone supported at kannel's website.

hi,i really hope that you can help me on this....

i'm using serial to usb converter connection between my PC and my GSM modem. PC is USB, GSM is serial. I had no problem on sending SMS function , but i had a problem occurs on receive com event. which mean that the program show a error when finish sending sms. can you help me on this? i really need the solution on this part if not my project will going to turn off..

hello

i am trying to write some code that helps me in sending a free sms to the mobile phones all over india

like how the way2sms work

i am trying to do it with the help of php and mysql. so any help with this regards will be so much helpful for me

with regards
Swathi.

admin's picture

way2sms don't have an API so I think you can't use their free service with your own apps.

salamat po... astig ng program nyo ^__^

emond's picture

welcome...Gudluck in your project..

All the best!!!

emond sabiniano
System Developer-Software Consultant

ang galing m kuya...

emond's picture

thanks just sharing..Please please support this site..Support our Filipino programmers..

emond sabiniano
System Developer-Software Consultant

Emond,
i had a problem during sending sms, i'm successfully to send sms by using your program but the problem is the msg box appear as message is not sent, But actually i receive the msg.

i using serial to usb converter, Is that the 1 make the problem?

Emond, i'm doing a final year project which is related to GSM/GPRS modem to send sms as well as mms. But mms i will leave it 1st.

I'm using PIC 16f and GSM wavecom Q2403. i'm wondering is the program u provide in this forum can be work with my modem?

If i using PIC 16f how should i write to the VB to control the when to send a SMS to the owner by using GSM modem. Can you help me on this?

I'm using 2 serial port connection, 1 is for GSM and the other 1 is for my PIC.

it is compatible with any GSM modem, just be sure that you will change the sample codes,like Baud rate, comport number, port settings, etc.in order to be compatible with your modem.

regrds
all the best!!!

it is compatible with your modem, just be sure to change the sample codes, like mscomm setting, comport number etc..

tnx for reading my article .

all the best!!!

emond's picture

with MSComm1

.CommPort = 3 ' Com4 Port 'change this
.Settings = "115200,n,8,1" 'Change this according to your modem
.InputLen = 0
.PortOpen = True
.Output = "AT" & Chr$(13) & Chr(10)
.Output = "AT+CMGF=1" & Chr$(13) & Chr(10)

.Output = "AT+CMGS=" & Chr$(34) & "+639212279363" & Chr$(34) & Chr(13) & Chr(10)
.Output = "Hello Emond " & Chr(26)
.PortOpen = False

End with

emond sabiniano
System Developer-Software Consultant

Thx for reply,

If i using PIC 16f how should i write to the VB to control the when to send a SMS to the owner by using GSM modem. Can you help me on this?

I'm using 2 serial port connection, 1 is for GSM and the other 1 is for my PIC

emond's picture

Sorry for late reply..

you can use another MSCOMM control in your project in order to talk to your PIC16f interface..The default MScomm is for Sending SMS and the other is for controlling your circuit..

For sample Serial programming interface please email me..

dark_raditz0825@yahoo.com
www.emondsoft.qapacity.com

thank You

emond sabiniano
System Developer-Software Consultant

I really thank to one who wrote this article. I have always been reading and writing texts like this in blogs. Also, I, as a daily writer, present my respects to everyone. I just watched videos like this in youtube. I research in all areas.

I think people must first research before writing...

emond's picture

Thank you,,Please support this website and Filipino programmer..

emond sabiniano
System Developer-Software Consultant

Dear Sir

A lot of thanks. This module solve my problem.

Thanks and Regards

Deepak
link_dks@yahoo.co.in

emond's picture

Welcome...
Please support this website..

emond sabiniano
System Developer-Software Consultant

just kidding!! means Want to have Fun coding with guys shaing knowledge to fellowmen.. nice ang good

sending can be done , emond if wanna do receiving msg espially msg for incoming msg show in the text box how should i write i had no idea on the Msccom receiving event.
can u help me on this?

emond's picture

I have the full project in Sending and Receiving SMS in Vb6 using a GSM/GPRS HSPDA Modem..

Let see if the codes is compatible with your modem

Please email me..
tnx for your interest..

dark_raditz0825@yahoo.com
www.emondsoft.qapacity.com

emond sabiniano
System Developer-Software Consultant

we need the code for sending and receiving picture msg through C# code.

emond's picture

using System;
using System.Collections.Generic;
using System.Text;
using System.IO.Ports;
using System.Threading;

namespace ReadSMSConsole
{
class Program
{
static SerialPort gsmSerialPort;

static void Main(string[] args)
{
gsmSerialPort=new SerialPort("COM15");
gsmSerialPort.ReadTimeout=1800;
gsmSerialPort.Open();

SendATCommand("AT+CMGF=1");
DisplayReceivedData();

SendATCommand("AT+CMGL=\"ALL\"");
DisplayReceivedData();
Console.ReadKey();
}

static void SendATCommand(string strAT)
{
gsmSerialPort.DiscardInBuffer();
Console.WriteLine(strAT);
gsmSerialPort.WriteLine(strAT+"\r\n");
}

static void DisplayReceivedData()
{
do
{
Console.WriteLine(gsmSerialPort.ReadLine());
}while(gsmSerialPort.BytesToRead!=0);
}

}
}

emond sabiniano
System Developer-Software Consultant

edmond if i wanna send MMS , just to send only, how should i write in the vb code to send mms using GPRS modem.
can you help me on this? Plzzz

emond's picture

Please email me.. i will create a sample in sending MMS in both vb6 and 2008.. tnx for your interest.. www.emondsoft.qapacity.com

emond sabiniano
System Developer-Software Consultant

I want to send a Multipel sms to my clients by attaching my mobile with the computer within a my application.

if anyone have code for it in php than help me.

purav_topi@yahoo.com

emond's picture

please visit :

www.emondsoft.qapacity.com

emond sabiniano
System Developer-Software Consultant

hai
I want a gsm modem communication asp.net web application code.Can you help me.Urgent Pls reply.
Regards
Aneesh A S
07aneesh@gmail.com

emond's picture

it more easy to use GSM gateway or GSM server in ASP, php or any web development..

based from my projects ,i recommend ActivExperts Server or Ozeki .

regards,

emond sabiniano
System Developer-Software Consultant

Hiii i am using teltonika GSM modem when i am trying to open port through c# code the application is hanging at

port.Open();--->command

please tell the solution how to change my PC settings to support the modem. It is also hanging when i am using hyperterminal.

Can u help me full turtorial / sample code with vb6. Example like this :

when we receive new message then auto save message in log.text and then automatic forward that message to sender.

1. receive message then show the message on table form
2. receive message then automaticly save log.txt
3. receive messafe then auto answer or forward that message again to sender.

Thanks for your help.

Regard
Shadowfax(indonesian)

emond's picture

I recommend that you use MS Access for your data storage.
It is more easy to show in table form unlike using .txt file as file system.

you can create a Table name RECEVED SMS with the fields Phonenum, date, time, etc.

you may add timer as a trigger to your program that will repeatedly check the recordcount of your RECEIVED SMS , if the recconunt changed the recordset will move to the last record (the unread received sms) then it will execute a Auto_Send function
that will send an SMS to the sender(phonenum field).

regards,

emond sabiniano
System Developer-Software Consultant

can u upload vb.net source code tnx in advance

emond's picture

i have source code using C#, ill upload it very soon...

emond sabiniano
System Developer-Software Consultant

i'm doing a final year project which is related to GSM/GPRS modem to send mms.If i using PIC 18f how should i write the program? Can you help me on this?

ahmmm.. i was just wondering sir if sending SMS from PC to Mobile is free? i mean kailangan pa po ba nito ng contract with certain SMS Networks like SMART and GLOBE etc... ?

as well, i would like to ask if the computer also receives SMS from mobile phones...(?)

ok, i'll try to draw it for better illustration...

SMS:
from - to possible?
-----------------------------------------------------
mobile > PC =
PC > mobile = ?

emond's picture

yes it is possible, so many modem have the feature of receiving and sending SMS,
but some models don't have receiving SMS feat..

so better check the compatibility of your modem or phones

emond sabiniano
System Developer-Software Consultant

Pages

Add new comment

Filtered HTML

  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.