0
votes

I'm trying to get data out of a USB GPS device, PL-2303. USB to Serial Bridge Controller.

So I tried this.

sp = new SerialPort(portname, 9600, System.IO.Ports.Parity.None, 8, StopBits.One);
sp.Open();
while (sp.IsOpen)
{
string serialPortData = sp.ReadLine();
}

The connection is open - but no data is received. Do you think its because I'm trying to connect to a USB device by opening a serial port? Or do you think its because the GPS data isn't being received?

1
Hmm, shouldn't have have to call sp.Open() first before it is actually open? - vcsjones
You forgot to turn handshaking on. Set the RtsEnable and DtrEnable properties to true. - Hans Passant
Sorry I guess I omitted open from the text snippet but it was in the code... - patrick
@Hans: Why? The NMEA standard specifies that handshaking should be off. - Ben Voigt
The generic USB port emulator driver they throw at these products can't be relied upon to know anything about a nautical standard. - Hans Passant

1 Answers

2
votes

You probably have the wrong baud rate. Try the standard settings for NMEA.