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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rahul2310
    New Member
    • Oct 2013
    • 62

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

    Hi I am Developing web application in asp.net 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

    Code:
    Dim ph_no As String
    ph_no = Char.ConvertFromUtf32(34) + txtadphonenorec.Text + Char.ConvertFromUtf32(34)
    
    SP.Write("AT")
    SP.Write("AT+CMGF=1" & vbCrLf)
    SP.Write("AT+CMGS=" & ph_no & "" & vbCrLf)
    SP.Write(txtmsg.Text + Char.ConvertFromUtf32(26))
    Response.Write("Send")
    Please Help
  • Luk3r
    Contributor
    • Jan 2014
    • 300

    #2
    What error are you getting? I would start by changing line 4 to this
    Code:
    SP.Write("AT" & vbCrLf)

    Comment

    • rahul2310
      New Member
      • Oct 2013
      • 62

      #3
      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

      Comment

      • Luk3r
        Contributor
        • Jan 2014
        • 300

        #4
        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:
        Code:
        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.

        Comment

        • rahul2310
          New Member
          • Oct 2013
          • 62

          #5
          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

          Comment

          • rahul2310
            New Member
            • Oct 2013
            • 62

            #6
            Does code changes if GSM modem is connected to USB Port

            Comment

            Working...