Home All Groups Group Topic Archive Search About

Talking with USB GPS in VB.Net

Author
3 May 2007 2:59 PM
Freddy Coal
Hi, I would like know how make the 'conversation' between VB.Net and Garmin
USB GPS, someone know work that?.

I have a etrex Vista Cx (USB cable connector), I would like make a program
for get the current GPS position, but I don´t understand how send commands
or receive data for this port.

Thanks in advance for any help, I´m very lost.

Freddy Coal

Author
3 May 2007 3:57 PM
Dick Grier
Hi,

There is one "standard" GPS protocol, NMEA-0183.  This serial protocol is
fairly easy to work with.  However, it is even easier if you download
DecodeGPS from my homepage.  The DecodeGPS .NET dll is free, and I include
example code.  The source code for the dll is in my book (see below), along
with additional information.  IMO, you should make sure that your GPS
receiver outputs data using this protocol (commands also may be issued to
the receiver using NMEA-0183, though very few applications require that the
GPS receiver be programmed).

Garmin also has a proprietary binary protocol.  It can be used instead of
NMEA-0183.  Again, there are very few applications that would require use of
this binary protocol, and it is much more difficult to use than the ASCII
(NMEA-0183) protocol.  I suspect that your actual receiver uses the NMEA
protocol by default (and it may not even support the binary one, so that may
not even be an issue).

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Author
3 May 2007 4:25 PM
Freddy Coal
Thanks Dick, very interesting DLL; I know the NMEA protocol, but I don't
understand how make the communitaction with the USB port.

I download the GPS Decoder example code, but he send errors, because I don´t
have the MapPoint. Your DLL work with USB or only with serial port?.

Thanks in advance.

Freddy Coal

Show quoteHide quote
"Dick Grier" <dick_grierNOSPAM@.msn.com> wrote in message
news:uEFOluZjHHA.5044@TK2MSFTNGP05.phx.gbl...
> Hi,
>
> There is one "standard" GPS protocol, NMEA-0183.  This serial protocol is
> fairly easy to work with.  However, it is even easier if you download
> DecodeGPS from my homepage.  The DecodeGPS .NET dll is free, and I include
> example code.  The source code for the dll is in my book (see below),
> along with additional information.  IMO, you should make sure that your
> GPS receiver outputs data using this protocol (commands also may be issued
> to the receiver using NMEA-0183, though very few applications require that
> the GPS receiver be programmed).
>
> Garmin also has a proprietary binary protocol.  It can be used instead of
> NMEA-0183.  Again, there are very few applications that would require use
> of this binary protocol, and it is much more difficult to use than the
> ASCII (NMEA-0183) protocol.  I suspect that your actual receiver uses the
> NMEA protocol by default (and it may not even support the binary one, so
> that may not even be an issue).
>
> Dick
>
> --
> Richard Grier, MVP
> Hard & Software
> Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
> Edition,
> ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
> 2006.
> See www.hardandsoftware.net for details and contact information.
Author
3 May 2007 7:57 PM
Dick Grier
Hi,

You can get a demo version of MapPoint Europe, if you want.

I will create a simpler demo tomorrow that simply places the location
(lat/lon) in a textbox.  I will let you know when it is available.

What version of Visual Studio are you using?  The actual serial port code
depends on this (if VS 2005, you can use the built-in serial port control,
if using 2003, then download DesktopSerialIO.dll from my homepage).

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Author
3 May 2007 9:20 PM
Freddy Coal
Thanks for your answer Dick, I´m using VS2005, I know how use the serial
port, but I don´t know how get data with the USB port.

My GPS is Garmin etrex Vista Cx - USB connector.

For the MapPoint, maybe you can try with MapWindow (
http://www.mapwindow.org/ ) it's a really excellent tool and it´s free.

Thanks in advance if you can help to get the data using the USB port.

Freddy Coal


Show quoteHide quote
"Dick Grier" <dick_grierNOSPAM@.msn.com> wrote in message
news:ObnWt0bjHHA.4516@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> You can get a demo version of MapPoint Europe, if you want.
>
> I will create a simpler demo tomorrow that simply places the location
> (lat/lon) in a textbox.  I will let you know when it is available.
>
> What version of Visual Studio are you using?  The actual serial port code
> depends on this (if VS 2005, you can use the built-in serial port control,
> if using 2003, then download DesktopSerialIO.dll from my homepage).
>
> Dick
>
> --
> Richard Grier, MVP
> Hard & Software
> Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
> Edition,
> ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
> 2006.
> See www.hardandsoftware.net for details and contact information.
>
Author
4 May 2007 5:48 PM
Dick Grier
Hi,

A USB serial adapter (such as is used by your GPS receiver) is just another
serial port.  Instead of a hardware UART, it uses a virtual serial port
device driver that emulates the hardware.  You treat it like any other
serial device.

I have decided to create a control that encapsulates the serial port class,
GPS receiver detection, and GPS (NMEA-0183) decoding.  All that you will
have to do is to drop it on a Winforms application, call the EnableGPS
method, and it will automatically detect your GPS receiver, and start
generating GPSDecode events that you can use to query its built-in
properties for Lan/Lon/Speed/Course/Date&Time, etc.  I will post it on my
website on Monday, so look for it then.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Author
5 May 2007 9:11 PM
Dick Grier
Freddy,

I have posted the GPSControl that I mentioned to my web site.  It requires
only one line of code to strart it up, and as few as two lines of code to
read the decoded GPS location (Lat/Lon).  Naturally, there are more "things"
than just location data, if you need them.  It does automatic GPS detection,
so you don't have to do anything tricky to use it.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Author
7 May 2007 3:17 PM
Freddy Coal
Dick, I try your library, but don't work for me. I use your program, but the
program doesn't establish connection.



Maybe this works with a Serial connector, but my GPS have a direct
connection to the USB port; I read in internet that the new Garmin don't
have the NMEA.



http://www.oreillynet.com/xml/blog/2004/10/garmin_gps_goes_more_proprieta.html



Thanks in advance for your help.



My Best regards,



Freddy Coal



Show quoteHide quote
"Dick Grier" <dick_grierNOSPAM@.msn.com> wrote in message
news:OdjShn1jHHA.2552@TK2MSFTNGP06.phx.gbl...
> Freddy,
>
> I have posted the GPSControl that I mentioned to my web site.  It requires
> only one line of code to strart it up, and as few as two lines of code to
> read the decoded GPS location (Lat/Lon).  Naturally, there are more
> "things" than just location data, if you need them.  It does automatic GPS
> detection, so you don't have to do anything tricky to use it.
>
> Dick
>
> --
> Richard Grier, MVP
> Hard & Software
> Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
> Edition,
> ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
> 2006.
> See www.hardandsoftware.net for details and contact information.
>
Author
8 May 2007 2:25 AM
Dick Grier
Hi,

>>
Maybe this works with a Serial connector, but my GPS have a direct
connection to the USB port; I read in internet that the new Garmin don't
have the NMEA.
<<

If it doesn't output NMEA, then it can only be used with proprietary
software (or you can write your own, if it uses the Garmin "standard" binary
protocol).  What documentation do they offer for the protocol that it does
use?

BTW, as I said before... USB GPS receivers ARE serial devices.  That is,
they emulate a standard serial port via the device driver that is installed
with the device (look in Device Manager under Control Panel then view Ports.
You should see it listed there).

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Author
8 May 2007 5:25 AM
Spam Catcher
"Dick Grier" <dick_grierNOSPAM@.msn.com> wrote in
news:#HMCKgRkHHA.4936@TK2MSFTNGP03.phx.gbl:

> BTW, as I said before... USB GPS receivers ARE serial devices.  That
> is, they emulate a standard serial port via the device driver that is
> installed with the device (look in Device Manager under Control Panel
> then view Ports. You should see it listed there).

No not all - some of the newer Garmins (i.e. NUVI) show up as mass storage
devices and have no NEMA serial interfaces  :(
Author
8 May 2007 6:17 PM
Dick Grier
Hi,

You are right, if is isn't designed as a serial device, then there is no
(practical)way to interface with it.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Author
8 May 2007 2:29 PM
Freddy Coal
Dick, I know the binary protocol, but I don´t understand  how make the
connection with the USB GPS with VB.Net; You know how make that?.

My GPS not emulate a serial device, under ports (Device Manager) don't
appear nothing different when I connect the GPS.

Thanks in advance for any help.

Freddy Coal

Show quoteHide quote
"Dick Grier" <dick_grierNOSPAM@.msn.com> wrote in message
news:%23HMCKgRkHHA.4936@TK2MSFTNGP03.phx.gbl...
> Hi,
>
>>>
> Maybe this works with a Serial connector, but my GPS have a direct
> connection to the USB port; I read in internet that the new Garmin don't
> have the NMEA.
> <<
>
> If it doesn't output NMEA, then it can only be used with proprietary
> software (or you can write your own, if it uses the Garmin "standard"
> binary protocol).  What documentation do they offer for the protocol that
> it does use?
>
> BTW, as I said before... USB GPS receivers ARE serial devices.  That is,
> they emulate a standard serial port via the device driver that is
> installed with the device (look in Device Manager under Control Panel then
> view Ports. You should see it listed there).
>
> Dick
>
> --
> Richard Grier, MVP
> Hard & Software
> Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
> Edition,
> ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
> 2006.
> See www.hardandsoftware.net for details and contact information.
>
Author
8 May 2007 6:21 PM
Dick Grier
Hi,

No.  If it is a proprietary interface, then probably they do not intend that
you use it.  If you can get programming information from Garmin, then there
may be a way.  If not, then it would cost FAR too much to even consider.

Why not just buy a different GPS receiver?  You probably can get one for
less than $60.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.