By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,066 Members | 1,841 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,066 IT Pros & Developers. It's quick & easy.

AT Commands For Vb.Net To Send SMS Using GSM MODEM

P: 62
Hi I am Developing web application in 4.0 (vb.NET)
I am using Sim900A GSM Modem to Send SMS using AT Command from VB.NET Below is my code but it does not work
whats wrong with the code

Expand|Select|Wrap|Line Numbers
  1. Dim ph_no As String
  2. ph_no = Char.ConvertFromUtf32(34) + txtadphonenorec.Text + Char.ConvertFromUtf32(34)
  4. SP.Write("AT")
  5. SP.Write("AT+CMGF=1" & vbCrLf)
  6. SP.Write("AT+CMGS=" & ph_no & "" & vbCrLf)
  7. SP.Write(txtmsg.Text + Char.ConvertFromUtf32(26))
  8. Response.Write("Send")
Please Help
Nov 30 '15 #1
Share this Question
Share on Google+
5 Replies

P: 299
What error are you getting? I would start by changing line 4 to this
Expand|Select|Wrap|Line Numbers
  1. SP.Write("AT" & vbCrLf)
Nov 30 '15 #2

P: 62
i tried your way but still it doesn't work
I am not getting any error but message is not getting sent.
When i try AT commands from hyper terminal it works
Plz help
Nov 30 '15 #3

P: 299
If no errors, then I'm going to assume that the phone number syntax is wrong. I would suggest trying something like this on line 6:
Expand|Select|Wrap|Line Numbers
  1. SP.Write("AT+CMGS=15554443333"& vbCrLf)
Where 1555444333 represents a 10 digit phone number (1-555-444-3333) and you should replace what I've written with the phone number you are trying to send a text message to.
Nov 30 '15 #4

P: 62
I tried Your way but still it doesn't work Luk3r
From hyper terminal mobile number in double quotes works.
But not from the code
Dec 1 '15 #5

P: 62
Does code changes if GSM modem is connected to USB Port
Dec 1 '15 #6

Post your reply

Sign in to post your reply or Sign up for a free account.