473,224 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

Send Message from PC to Mobile using GSM modem

3
Hi,

I am doing the coding for send SMS from PC to Mobile Using GSM Modem in ASP.Net Framework 3.
I am having SAMBA GSM modem and i am using the following code that is working fine.
This coding is working fine in first time only. If i click the same button again that will through the following error "A device attached to the system is not functioning" If i restart the system that working fine for first time. I think some objects are referred inside please any body help to solve this problem.



*****Coding Starting****************************************** *********

Protected Sub BtnSend_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnSend.Click
Dim atcCommand As String
Dim sphnPhoneNo As String
Dim cescQuote As Char
Dim s As String
Dim objGsmModem As New System.IO.Ports.SerialPort("COM3")
With objGsmModem
.PortName = "COM3"
.BaudRate = "9600"
.StopBits = IO.Ports.StopBits.One
.DataBits = 8
.Parity = IO.Ports.Parity.None
'.ReadBufferSize = 10000
.ReadTimeout = 1000
'.WriteBufferSize = 10000
.WriteTimeout = 1000
.Handshake = Handshake.RequestToSend
.RtsEnable = True
.DtrEnable = True
.Open()
'for reading sms
'atcCommand = "AT+CMGR=8" 'to read from inbox
'.Write(atcCommand + vbCrLf) 'execute command on buffer
'TextBox1.Text = .ReadExisting()

'for writing sms

s = .ReadExisting()
.Write("AT+CMGF=1" + vbCrLf)
s = .ReadExisting()

cescQuote = Char.ConvertFromUtf32(34)
sphnPhoneNo = "+919840496050"
atcCommand = "AT+CMGS=" + cescQuote + sphnPhoneNo + cescQuote + vbCrLf + "WORLD" + Char.ConvertFromUtf32(26)
' .Write(atcCommand + vbCrLf)
.WriteLine(atcCommand + vbCrLf)
s = .ReadExisting()
.WriteLine("Thank God From App SRN" + Chr(26))
TextBox1.Text = .ReadExisting()

.DiscardOutBuffer()
.DiscardInBuffer()
.Close()
.Dispose()
End With

End Sub

*********Coding End ************************************************** ******
Jun 18 '07 #1
1 3303
nmsreddi
366 256MB
Hello
You are using ASP.net it sense you can access your application anywhere (if internet is provided ) ,my dout is where you are connecting your GSM Modem at server or at client who ever access your application should connect the modem ? ,


i have developed a windows application using c#2005 post code too in this forum if required just search for that ,

Please reply where you are connecting Your GSM Modem exactly ,Why you are using ASp.net (if you connect the only at server) if so how can you access the hardware from client side,

Hope you will back with some details

Regards
Jun 19 '07 #2

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

Similar topics

1
by: Ashish | last post by:
Hi, I was trying to make a out going call through the voice modem, play a audio file and disconnect. With the XTAPI implementation of the JTAPI I am able to do it with an analog phone line. The...
3
by: Sara | last post by:
HI, I want to code a program to detect GSM mobile (any kind) which connected through serial port to computer and then be able to send SMS through this mobile phone to other mobile phones, could...
2
by: shedrool | last post by:
I need to write an application (in any language, but preferrably C#) that runs on a server or laptop, connects to a mobile phone through a data cable, and sends an SMS message using the attached...
4
by: Twister | last post by:
Hi all, I'm supposed to send sms from our intranet to mobile phone. I'm not relevant to this; its extremely new to me. I need ASP code to build connectivity from our server to the mobile numbers...
5
by: tommaso.gastaldi | last post by:
Hi. I have been implementing a simple email notification system using the handy class SmtpClient: With SmtpClient .Host =MailServer .Send(MailMessage) '... now my client is asking also for...
2
by: abhay | last post by:
hi,i m interfacing gsm modem to my microcontroller.i need to send sms through it. i am using AT commands for that.the command to send sms (AT+ CMGS) terminates with ctrl-Z.now in my program i hav...
3
by: nil | last post by:
Hello everyone, I just wanted to develop one web application which allows users to send an SMS to any mobile free of charge or i can say that i want to develop web application like...
0
by: nil | last post by:
Hello everyone, I just wanted to develop one web application which allows users to send an SMS to any mobile free of charge or i can say that i want to develop web application like...
0
by: amar elzaman | last post by:
peace be upon u friends i'm working on a project to send sms through pc and gsm modem(mobile) and every thing is ok, i succeded to send but english sms only, when i tried to send arabic the...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.