send incomming msg (SMS) to VB


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    johor,Malaysia
    Posts
    57

    Default send incomming msg (SMS) to VB

    hello, every one..

    My problem is to read incomming msg (SMS) and send the data to VB6 and MS access .. i use Sony Erricsson T610. i want build database.. for the system i need use pic or i can directly send the msg to VB..

    can someone help me..

    i need your help..

    ---> i need use pic or not.
    ---> i want know how to send msg data to VB and MS Access.
    ---> want now how to build database and link to MS access.

    thank for help..

  2. #2
    Join Date
    Mar 2006
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    You don't need to use a PIC to interface your cell to your PC, you just need a data cable and program the computer to listen on its serial port for AT commands and responses which the cell phone uses to communicate. When a cell phone receives a SMS, it can be set to alert an external device (such as your computer) by sending a serial message called an AT command. You then program your computer to send the correct commands to access the bank in which the message was stored in.

    here's an example of what the communication would look like:

    (from cell phone): +CMTI: "ME",27
    (from computer): at+cmgr=27
    (from cell phone): +CMGR: "REC UNREAD","+15551234567","John Doe","05/10/18,23:21:45-20"
    Hello World


    the break down:
    when a cell phone receives an SMS, it sends an AT response of "CMTI ME, 27". The ME means it was stored in memory in storage bank number 27. Your computer must then access this bank by sending "AT+CMGR=27", the cell phone then responds with the message. You can test all of this out without even programming anything, just connect your cell phone to your serial port and then open up a serial terminal emulator (such as Hyperterm for Windows).

    You can interface your cell phone to a PIC using serial communication. It is possible to directly interface the pins to the cell phone since they are both of TTL voltage RS-232 (the cell phone actually uses 3v while the PIC uses 5v, but I haven't had any problems).

    I hope that helps you get started.
    Last edited by kamet; - 24th March 2006 at 04:44.

  3. #3
    Join Date
    Feb 2006
    Location
    johor,Malaysia
    Posts
    57


    Did you find this post helpful? Yes | No

    Default

    hello

    thank kamet..

    i only have USB data cable.u thing i can use it or i must use serial cable...

    i have the at commnad but i down know how to send the command using vb. can u help me.

  4. #4
    Join Date
    Mar 2006
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    I'm sorry but I don't know how to interface it by USB directly, however, you may want to search for a "virtual serial port driver" for your USB. The driver will trick your application into believing your USB port is a serial port and behave like one. The driver should handle the in-betweens of serial information exchange of the USB port and your VB program.

    Again, I've never done this, its just a suggestion, the easier route would be to buy an actual serial data cable, but if you cannot, then maybe a USB to serial converter cable.

    Here's a link to help you with basicsetup of serial communication with VB: http://www.pages.drexel.edu/~bns23/tutorial.html

    Good luck.

  5. #5
    Join Date
    Feb 2006
    Location
    johor,Malaysia
    Posts
    57


    Did you find this post helpful? Yes | No

    Default

    thank
    kamet

    ok i find the serial data cable.

    now i try to send the at command using vb.. that my program.
    but i have problem i dont know why the msg cant display in text.. i thing have some problem.

    this program dont error bit just not display the output

    can u check the program for me.
    i realy new in vb6

    Private Sub Command1_Click()
    Dim sms As String
    Dim buffer$

    MSComm1.CommPort = 1
    MSComm1.Settings = "9600,N,8,1"
    MSComm1.InputLen = 0
    MSComm1.Handshaking = comNone

    MSComm1.PortOpen = True

    'echo off
    MSComm1.Output = "ATE0" & Chr$(13)

    Do
    DoEvents
    buffer$ = buffer$ & MSComm1.Input
    Loop Until InStr(buffer$, "OK")
    buffer$ = ""

    'Report Mobile Equipment Error ( enable )
    MSComm1.Output = "AT+CMEE=1" & Chr$(13)
    Do
    DoEvents
    buffer$ = buffer$ & MSComm1.Input
    Loop Until InStr(buffer$, "OK")
    buffer$ = ""

    'Received read message
    MSComm1.Output = "AT+CMGR=1" & Chr$(13)
    Do
    DoEvents
    buffer$ = buffer$ & MSComm1.Input
    Loop Until InStr(buffer$, "+CMGR: 1,,159")
    buffer$ = ""

    sms = MSComm1.Input
    Text1.Text = sms

    Do
    DoEvents
    buffer$ = buffer$ & MSComm1.Input
    Loop Until InStr(buffer$, "OK")

    MSComm1.PortOpen = False

    'if use hyperterminal the command output like below
    'AT CMGR = 1
    '+CMGR: 1,,159
    '07910621000010F5240B910621671663F1000060104222334 423A0C2E030088232834E19C8049A06
    '9 BC2AAF3B87482905569D5E8CC06750A625A0F0AB7C32037B90 E62D7D761103B3C4F83C46190B8EE
    '9E87D7207A1A5E9683CEE97619E41E8741F2F43A4D0785C5F 3FA18949E97C96190FBBC0E83DCE230
    '485 C77CFCB20F739CC9E97C9A0B0FB3C07A5C5F575BB0C729FCB6 A50985E6783D2F3B03B0D72A75D
    'E8301A1446875D

    End Sub


    if i use hyperterminal the output like this

    'if use hyperterminal the command output like below
    'AT CMGR = 1
    '+CMGR: 1,,159
    '07910621000010F5240B910621671663F1000060104222334 423A0C2E030088232834E19C8049A06
    '9BC2AAF3B87482905569D5E8CC06750A625A0F0AB7C32037B 90E62D7D761103B3C4F83C46190B8EE '9E87D7207A1A5E9683CEE97619E41E8741F2F43A4D0785C5F 3FA18949E97C96190FBBC0E83DCE230
    '485C77CFCB20F739CC9E97C9A0B0FB3C07A5C5F575BB0C729 FCB6A50985E6783D2F3B03B0D72A75D
    'E8301A1446875D

    thank

  6. #6
    Join Date
    Mar 2006
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    Does it not display anything at all or is it displaying "garbage" response? Where in your code does it display the response? The garbage response you see in your hyperterminal is because the cell phone is by default in PDU format. Some sony ericssons have a TEXT mode and a PDU mode, you must look for the AT command to switch it to TEXT mode first (unless you want to write software for it in PDU mode, which you'll have to do some hex conversion).

    It appears that you only loop until you receive an "OK" and then you move onto the next output. You have to write a response to screen to show that each output was sucessfully received by the celll phone as an "OK" so that you know what is going on.

    Make sure your serial output is working first, the easiest way would be to command the cell phone to dial a phone number. This is easier because it does not require the phone to respond by serial "OK" (because you don't know if your output is working yet, so input is still questionable), it will show the phone dialing the number from the cell's display screen. I believe the command to dial a number is ATD1234567890 (the number 1234567890 would be replaced by whatever number you choose)

    Good luck.

Similar Threads

  1. Active low input?
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th August 2010, 20:31
  2. Please send me a SMS program
    By hjcool in forum GSM
    Replies: 7
    Last Post: - 17th June 2009, 10:33
  3. how to send and receive sms using vb?
    By shyhigh2002 in forum Off Topic
    Replies: 0
    Last Post: - 1st April 2009, 09:18
  4. Replies: 0
    Last Post: - 1st September 2008, 07:03
  5. sms send sht11 pic16f876 nokia 6210
    By elektoro2009 in forum GSM
    Replies: 11
    Last Post: - 9th June 2008, 08:57

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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