Click here to Skip to main content
15,888,221 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello! I have this Garmin GPS18x module. I plugged it via a serial port interface. I can connect to it from my vb.net application. But when I read data from it, I just get weird messages. Any ideas what I'm doing wrong?

text = "" " & vbCr & "??K?n???K?????? ? ?? L ?" & vbCr & "@? j? i? B? ?B L? ?A C"?n? ?" ? ?""


C#
Dim serialport As New SerialPort
serialport.PortName = "COM9"
serialport.BaudRate ="4800"
serialport.StopBits = 1
serialport.Open()
Dim text As String = serialport.ReadLine()
System.Console.WriteLine(text)


What I have tried:

I have tried everything and do not know what else to do? Is ther something wrong with my serial port? Or is the gps broken?
Posted
Updated 16-Oct-16 22:49pm
Comments
[no name] 16-Oct-16 15:09pm    
Are you sure the data is not encrypted?
Dave Kreskowiak 16-Oct-16 15:53pm    
Chances are really good you got the serial parameters wrong, like baud rate and stop bits. Check with the documentation or manufacturer to see what those values are supposed to be.

First of all, a com port have more settings that matters ! Char size (7 or 8 bits) and parity.

Advice: use a terminal emulator like HyperTerminal and play with settings until you find the right combination of parameters.
 
Share this answer
 
Comments
chrilleb 17-Oct-16 2:42am    
Has already tried to use a hyper terminal (realterm). Tried there with all settings can be done, but still just got a bunch of strange messages that can not be interpreted.

Got all settings for the com from this manual. http://static.garmincdn.com/pumac/GPS_18x_Tech_Specs.pdf

Dim serialport As New SerialPort
serialport.PortName = "COM9"
serialport.BaudRate = "4800"
serialport.StopBits = StopBits.One
serialport.Parity = Parity.None
serialport.Handshake = Handshake.None
serialport.DataBits = 8
serialport.Open()
Patrice T 17-Oct-16 4:02am    
You should have tell us!
"I have tried everything" means nothing to us.
What about asking Garmin or a users forum ?
chrilleb 17-Oct-16 4:20am    
Okay sorry, should told you.

I have now send the question to garmin suport.
Once you are sure the serial settings are correct, you could try to decode the message which (as far as I can understand from product presentation) is either 'NMEA 0183 format (industry standard)' or 'proprietary Garmin format'.
Since the message you received doesn't look a valid NMEA one, you could try to interpret it using the Garmin format.
 
Share this answer
 
According to the data sheet ([^]) there are different versions with different serial interface specifications:
GPS 18x USB, GPS 18x PC, GPS 18x LVC, and GPS 18x-5Hz.
If you have the 5Hz version you must use 19200 baud.

Quote:
GPS 18x LVC and GPS 18x-5Hz: 0 V dc to Vin, between 4 and 5.5 V dc (Asynchronous Serial, TIA-232-F (RS-232) Compatible Polarity)
indicates that the interfaces use logic voltage levels (TTL, GND and 5 V) while RS-232 uses +/- 3 to 15 V (see RS-232 - Wikipedia[^] ). So it can't be connected to the serial port of a PC. Instead, a RS-232 level shifter must be used.

Finally, it might be necessary to invert the received data ("Compatible Polarity" indicates that the output is inverted like with RS-232 but RS-232 level shifters will invert again and serial TTL inputs will not invert).
 
Share this answer
 
There were no problem with the serialprot or the code. The problem was in the GPS. Somehow the settings in the GPS had disappeared. I managed after a lot of testing to restore it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900