I am trying to write a send SMS program using SIMCOM 900A. With My below code I am facing the problems...
1.
sending when getting serialport received-data as
> AT+CMGS="9674642260"
TESTING SMS-1
It is sending the message text preceded by the entire serialport received data.
message sent : <pre>ATAT+CMGS="9674642260"
TESTING SMS-1
2.
But not sending SMS when received-data is
AT+CMGS="9674642260"
TESTING SMS-1
>
if I click the send button again then it is sending the sms successfully but again with entire command set + message text.
can anyone help me where to modify my current code. Also I need to send the message to multiple numbers.
Thanks in Advance.
What I have tried:
my send button code:
<pre> If SerialPort1.IsOpen Then
SerialPort1.Close()
End If
SerialPort1.Open()
Try
With SerialPort1
.Write("AT" & vbCrLf)
Threading.Thread.Sleep(1000)
' .Write("AT+COPS?" & vbCrLf)
' Threading.Thread.Sleep(1000)
.Write("AT+CMGF=1" & vbCrLf)
Threading.Thread.Sleep(1000)
.Write("AT+CMGS=" & Chr(34) & txtNumber.Text & Chr(34) & vbCrLf)
.Write(txtMsg.Text & Chr(26))
Threading.Thread.Sleep(1000)
'.Write("AT" & vbCrLf)
End With
rcvData.Text = recData.ToString
SerialPort1.Close()
Catch ex As Exception
End Try