Solved

code for sms using GSM MODEM

Posted on 2004-04-30
6
2,060 Views
Last Modified: 2013-12-09
can u provide me the code for sending sms from pc to mobile using GSM modem?
0
Comment
Question by:pritibang
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
6 Comments
 
LVL 2

Accepted Solution

by:
anupvijay earned 63 total points
ID: 10957010
pritibang,
Which programming language are you using ?

Assuming that it is VB here is link from a mailing list that might help you.

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=39c0b8fd%240%242390%40reader5&rnum=2&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3DSend%2BSMS%2Bcode

Cheers.
0
 
LVL 5

Expert Comment

by:amit1978
ID: 10985272
Hi,

What technology (Vb,C....)u r using to send and receive message and type of GSM (Nokia, Sime...)

Amit
0
 
LVL 5

Assisted Solution

by:amit1978
amit1978 earned 62 total points
ID: 10985282
Assumin ur using VB and MSComm control for send and receive SMS.

Thru this code u can send the SMS thru GSM modem. here i am posting the code check this out:

Code to send SMS:
~~~~~~~~~~~~~~

Private Sub SendMsg(strMsg As String, Number$)
    Dim DialString$, FromModem$, dummy

    ' AT is the Hayes compatible ATTENTION command and is required to send commands to the modem.
    ' DT means "Dial Tone." The Dial command uses touch tones, as opposed to pulse (DP = Dial Pulse).
    ' Numbers$ is the phone number being dialed.
    ' A semicolon tells the modem to return to command mode after dialing (important).
    ' A carriage return, vbCr, is required when sending commands to the modem.
    ' box is ctrl+z command

    DialString$ = "AT+CMGS=" & Chr(34) & Number$ & Chr(34) & ",145" & vbCr & strMsg & "" & Chr(27)
   
  'explain later
    Call fnOpenPort
   
   
    ' Flush the input buffer.
    MSComm1.InBufferCount = 0
    Command3.Enabled = False
    Command4.Enabled = True
   
   
    MSComm1.Output = "AT+CMGF=1" & Chr$(13) & Chr(10) 'ok meaage is returened
   
    WaitMs 15000
   
    ' Dial the number.
    MSComm1.Output = DialString$
   
    WaitMs 15000
   
    MSComm1.PortOpen = False
   
    ' Disconnect the modem.
    'MSComm1.Output = "ATH" + vbCr
   
    ' Close the port.
    'MSComm1.PortOpen = False
End Sub

Private Function fnOpenPort()
  MSComm1.CommPort = 2
  MSComm1.Settings = "9600,N,8,1"
  MSComm1.Handshaking = 2
 
  On Error Resume Next
 
  ' Communications port settings.
  ' Assuming mouse is attached to COM1, GSM MODAM is set to 2
  ' Open the communications port.
 
  MSComm1.PortOpen = True
  If Err Then
     MsgBox "COM2: not available. Change the CommPort property to another port."
     Exit Function
  End If
 
End Function
0
 
LVL 5

Expert Comment

by:amit1978
ID: 10985287
this code will help u to send sms with the help of VB and MSComm control.

Amit
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Connect to wifi using GPO 6 81
Cisco 3800 series and WISM2 1 50
Need to print using Bluetooth: Laser Jet Pro MFP M127fw 3 65
Dlink-DIR 816 router 4 62
MAC Filtering: MAC filtering is like handing a list of names to a doorman. If someone comes to the door and mentions a name, this name is checked by the doorman on his list and granted or denied access by this. This means that if someone menti…
This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question