Hi.
I am having problems communicating with a UBLOX GPS device using the serial interface over USB. I would like to be able to receive data from the device asynchronously in a receive event when data is sent from the GPS to the computer.
Error received on the MySerialPort.Open()
My GPS device is sending data to the system on COM7 with the above settings and I can verify this with a terminal emulator such as PuTTY
When I run this code:
I get this...
But when I run this code:
This is the result (COM7 missing):
Unfortunately I have not really made any progress as to why I can retrieve data from the GPS serially via a terminal application, but cannot even open the port using .Net
Amongst other articles I have read, such as this one: If you *must* use .NET System.IO.Ports.SerialPort, I'm now concerned about using System.IO.Ports.SerialPort.
Any help would be gratefully received.
Thanks and regards.
I am having problems communicating with a UBLOX GPS device using the serial interface over USB. I would like to be able to receive data from the device asynchronously in a receive event when data is sent from the GPS to the computer.
VB.NET:
mySerialPort.PortName = "COM7"
mySerialPort.Close()
mySerialPort.BaudRate = 115200
mySerialPort.Parity = Parity.None
mySerialPort.DataBits = 8
mySerialPort.StopBits = StopBits.One
mySerialPort.DtrEnable = True
mySerialPort.Open()
Error received on the MySerialPort.Open()
The given port name is invalid. It may be a valid port, but not a serial port.
My GPS device is sending data to the system on COM7 with the above settings and I can verify this with a terminal emulator such as PuTTY
When I run this code:
VB.NET:
For Each sp As String In My.Computer.Ports.SerialPortNames
Debug.WriteLine(sp)
Next
COM4
COM1
COM7
But when I run this code:
VB.NET:
Using search As New ManagementObjectSearcher("SELECT * FROM Win32_SerialPort")
For Each mo In search.Get
Debug.WriteLine(mo.Item("DeviceID") & " " & mo.Item("Caption"))
Next
End Using
COM4 Intel(R) Active Management Technology - SOL (COM4)
COM1 Communications Port (COM1)
Unfortunately I have not really made any progress as to why I can retrieve data from the GPS serially via a terminal application, but cannot even open the port using .Net
Amongst other articles I have read, such as this one: If you *must* use .NET System.IO.Ports.SerialPort, I'm now concerned about using System.IO.Ports.SerialPort.
Any help would be gratefully received.
Thanks and regards.