[RESOLVED] problem sending at command
hey eveyone. im trying to query a usb modem (which i believe is treated like a serial connection). bellow is my code but its not returning any strings. can anyone take a look at it?
Public Function getmyModemModel()
Dim RN As String
Dim Port As SerialPort = _
New SerialPort("Com6", 9600, IO.Ports.Parity.None, 8)
Port.Open()
Port.Write(("AT+GMM" & vbCrLf))
System.Threading.Thread.Sleep(4000)
Dim returnStr As String = ""
Dim Incoming As String = Port.ReadLine.ToString
returnStr = Incoming
MsgBox(Incoming)
Port.Close()
Return RN
End Function
i get no errors. the msgbox just pops empty.
Re: problem sending at command
turn dtr on then open SerialPort1.DtrEnable = True
use vbCr - a lot of modems don't like Lf
Dim Incoming As String = Port.ReadExisting() 'and they don't always reply with crlf