none
SMS Autoresponder System that checks received SMS and sends response from a database using GSM Modem and VB.Net RRS feed

  • Question

  • Hi, I'm having a tough time to finish my project and it's almost near to the deadline. I can't find any article regarding any projects that have the same function as the project being asked of me. The project that I needed to do is an Autoresponder System, basically it needs to receive SMS messages via AT Commands using a GSM Modem and VB.net codes. But I don't know how to process the received SMS and check if the provided Keywords in my system match the Keywords sent via the received SMS. Because only then the system will send a response coming from the database of which I'm using is Microsoft SQL Server 2014. I hope there is someone who could help me. Thanks in advance.

    Masikov Manoban

    You can kindly email me for your help and suggestions in masikov.manoban.0002@gmail.com

    Thanks again!

    Wednesday, June 24, 2020 12:04 AM

All replies

  • Hi Masikov Manoban,

    Thank you for posting here.

    >>I don't know how to process the received SMS and check if the provided Keywords in my system match the Keywords sent via the received SMS.

    Here's a small example of using serial port to get messages from GSM device, and you can refer to the following code:

       Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            SerialPort1.DataBits = 8
            SerialPort1.DtrEnable = True
            SerialPort1.Encoding.Equals("iso-8859-1")
            SerialPort1.WriteTimeout = 300
            SerialPort1.StopBits = StopBits.One
    
            Timer1.Enabled = True
            Timer1.Interval = 1000
            Timer1.Start()
        End Sub
    
        Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
            Timer1.Stop()
            getMessage()
            Timer1.Start()
        End Sub
        Public Sub getMessage()
            If SerialPort1.IsOpen Then
                AddHandler SerialPort1.DataReceived, AddressOf getResponse
            Else
                MessageBox.Show("SerialPort is closed")
                Return
            End If
        End Sub
    
        Public Sub getResponse(ByVal sender As Object, ByVal e As SerialDataReceivedEventArgs)
            Dim serPort As SerialPort = CType(sender, SerialPort)
            Dim input As String = serPort.ReadExisting()
    
            If input.Contains("+CMT:") Then
    
                If input.Contains("AT+CMGF=1") Then
                    Dim message As String() = input.Split(Environment.NewLine.ToCharArray()).Skip(7).ToArray()
                    TextBox1.Text = String.Join(Environment.NewLine, message)
                End If
    
                Me.Invoke(CType(Sub()
                                    TextBox1.Text = input
                                End Sub, MethodInvoker))
            Else
                Return
            End If
        End Sub

    Code from:

    Receive SMS through GSM modem

    Hope it could be helpful.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, June 25, 2020 2:13 AM
    Moderator
  • Hi Masikov Manoban,

    How is the question going? Did you solve your problem? If your question has been answered then please click the "Mark as Answer" Link at the bottom of the correct post(s), so that it will help other members to find the solution quickly if they face a similar issue.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, July 2, 2020 2:36 AM
    Moderator