Results 1 to 10 of 10

Thread: Wait for a SMS with Visual Basic

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    7

    Wait for a SMS with Visual Basic

    I need to wait for an SMS message. I read something about AT+CNMI command, but I don't know how can I use it. I need the phone wait for recive a SMS, and when it recive the SMS it detect and the computer show a notice. How can implement that?

  2. #2
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    282

    Re: Wait for a SMS with Visual Basic

    What phone U have?

    B.R
    VB Client/Server

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    7

    Re: Wait for a SMS with Visual Basic

    I have diferent phones:

    Motorola V220
    Siemens S55
    Sharp GX17
    Nokia 6230

    Can you help me with any?

  4. #4
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    282

    Re: Wait for a SMS with Visual Basic

    Quote Originally Posted by Ainara
    I have diferent phones:

    Motorola V220
    Siemens S55
    Sharp GX17
    Nokia 6230

    Can you help me with any?

    1. Search AT-commands for this phone

    I will try to send U AT commands for Siemens mobile, I know I have it somewhere...

    D U have data cable for Siemens?

    B.R
    VB Client/Server

    U could analyze this sw http://www.softpedia.com/get/Mobile-...-Control.shtml

    Download HHD Serial Port Monitor, and see what this sw send's to phone and
    what phone returns.
    U will see also mscomm settings for communication etc...
    Last edited by VB Client/Server; May 22nd, 2006 at 04:26 AM.

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    7

    Re: Wait for a SMS with Visual Basic

    Quote Originally Posted by VB Client/Server
    Can you help me with any?

    1. Search AT-commands for this phone

    I will try to send U AT commands for Siemens mobile, I know I have it somewhere...

    D U have data cable for Siemens?

    B.R
    VB Client/Server

    U could analyze this sw http://www.softpedia.com/get/Mobile-...-Control.shtml

    Download HHD Serial Port Monitor, and see what this sw send's to phone and
    what phone returns.
    U will see also mscomm settings for communication etc...
    I conect the phones by infrared or by bluetooth. Only Motorola V220 is conected by cable because it doesn't have anymore conectivity.

    I have used AT commands to sent SMS commands and dial. But I don't know how can I wait for SMS and when one arrive open a message in the PC.

    Do you know what AT command is used for this?

    Thank you very much.

  6. #6
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    282

    Re: Wait for a SMS with Visual Basic

    I have never use infrared or bluetooth protocol, so I dont know how
    code would look like...

    This is sample for Siemens mobile, and for that U need Data cable.


    Dim out1, out2, out3 As String

    Private Sub Command2_Click()

    Timer1.Enabled = True
    Timer2.Enabled = True
    End Sub

    Private Sub Form_Load()

    On Error GoTo OpenError
    MSComm1.CommPort = 1
    MSComm1.Settings = "19200,N,8,1"
    MSComm1.InputLen = 0
    MSComm1.PortOpen = True
    Timer1.Interval = 300
    Timer2.Interval = 2000

    Exit Sub

    OpenError:
    MsgBox "Error " & Format$(Err.Number) & _
    ": " & vbCrLf & _
    Err.Description
    Exit Sub

    End Sub

    Private Sub Form_Unload(Cancel As Integer)
    MSComm1.PortOpen = False
    End Sub


    Private Sub Timer1_Timer()
    Dim inp1, out1 As String
    Dim Ascnum As Integer

    On Error GoTo OpenError
    hulp = ""

    MSComm1.Output = "AT+GSN" ' edit AT commands here
    MSComm1.Output = Chr(13)

    Do While Len(inp1) = 0
    DoEvents
    inp1 = inp1 & MSComm1.Input
    Loop

    For s = 1 To Len(inp1)
    Ascnum = Asc(Mid(inp1, s, 1))
    If Ascnum > 47 And Ascnum < 58 Then
    out1 = out1 + Mid(inp1, s, 1)

    End If
    Next s

    Text1.Text = out1

    If Not (Text1.Text = "") Then
    Timer1.Enabled = False
    End If
    Exit Sub

    OpenError:
    MsgBox "Error " & Format$(Err.Number) & _
    ": " & vbCrLf & _
    Err.Description
    Exit Sub
    End Sub

    Private Sub Timer2_Timer()
    If Text1.Text = "" Or Text1.Text = "turn on phone !" Then
    Timer1.Enabled = False
    Timer2.Enabled = False

    MSComm1.Break = True
    Duration! = Timer + 0.1
    Do Until Timer > Duration!
    Dummy = DoEvents()
    Loop
    MSComm1.Break = False
    flag = 1
    MSComm1.PortOpen = False
    MsgBox "Check connection and restart program"
    End
    End If
    End Sub


    Sorry, I cant find AT-commands, but maybe U can...

    B.R
    VB Client/Server

  7. #7
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    282

    Re: Wait for a SMS with Visual Basic

    http://www.serasidis.gr/circuits/sms...controller.htm


    Check this link, maybe will help U.

    B.R
    VB Client/Server

  8. #8
    New Member
    Join Date
    May 2001
    Location
    india
    Posts
    8

    Re: Wait for a SMS with Visual Basic

    Hello,
    I m doing the same and it is working. I m using GSM Modem which is connected to PC using USB cable (To findout the port to which it is connected goto Device Manager and see the properties).
    You can send SMS using simple Text as well as In PDU Format ( For PDU Format you have to define Message Headers and many other information)
    For PDU Format, Download the software PDUSpy

  9. #9

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    7

    Re: Wait for a SMS with Visual Basic

    I proved what you said but "AT+GSN" command gives me the phone's serial number. I visited the web-site you gave me too, but there is no information about I need. I know how can I read the messages are into the phone (the read and the unread messages) I need to alert about the new messages are arriving at the moment. Can you understand me? Perhaps I don't explain it very well because my English is not very good...

  10. #10
    New Member Dubai_Legend's Avatar
    Join Date
    May 2006
    Location
    United Arab Emirates, Dubi City
    Posts
    14

    Re: Wait for a SMS with Visual Basic

    Hi people

    Does anyone have a site to learn how to trasfer data from a phone to PC using Bluetooth?
    as if the phone was a client and the PC was the server

    Thanks in advance

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width