Go Premium for a chance to win a PS4. Enter to Win


GPS connection

Posted on 2004-10-13
Medium Priority
Last Modified: 2008-03-10
Hi people, i really need some help!
I am a portuguese student, and i am making a final project which is about personal services for GPS.

Basicly i want to connect a Garmin eTrex GPS unit to my laptop. I use a proper cable to do that and the software that i am using is the OziExplorer
which allow me to extract some info from the GPS like (waypoints, tracks or routes). The problem is to send that information (the one from the GPS)
to a database in my laptop (Mysql). In other words, which do you think is the best way to make this connection?
1 - Make a program that could read the data from the GPS unit and that could send that data to my database (filling the tables and fields in DB)
2 - or, like i am doing now, using a software like the Oziexplorer and collect trought that software the wanted information to put in the database,
but how can i make that connection (software -> database) and which software should i use ?? Oziexplorer ??

Can anyone help me with that connection
Kind Regards

Question by:psiubest
  • 4
  • 3
  • 2
LVL 13

Expert Comment

ID: 12306197
I will suggest you using the first approach i.e making a program of your own that will read GPS values from the GPS and then will add them to a database.....If you are using VB or any other progam as the frontend then it might not take more then 2-3 hrs to develop such a program......


Expert Comment

ID: 12308332
eTrex has 2 output modes: NMEA and a proprietary Garmin communication mode.

The easiest way is to copy GPS data from a COM port to a file. I use following batch file:

=== file cp2file.bat start =======================
mode com2 baud=4800 parity=n data=8 stop=1
if  "%1" == ""   goto toScreen
      type com2 > %1
goto end

      type com2
goto end

=== file cp2file.bat end =======================

From command prompt:
      cp2file myLogFile.txt
      cp2file    (it will copy GPS output to the screen)

As the output file is in TXT format you can use whatever language/tools you know/prefer to load data into mySql.

(You need to specify GPS output format on eTrex: menu screen -> setup -> interface -> NMEA)

(1) Some times the very first &last lines of the log file are incomplete so you need to erase them manually.
(2) the example is for COM 2. If you use a different port change: com2 to comX.


Author Comment

ID: 12308547
Thanks for the anwsers, but i am trying to find a program in Java, VB or PHP which can read the information from the GPS and add it to my DB (Mysql). Can anyone help me ?? Thanks
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

LVL 13

Expert Comment

ID: 12316249
Since this is your Final project so it is better if you write the program yourself......believe me it is very simple to write such a program once you know the development environment......


Accepted Solution

vilia earned 1500 total points
ID: 12319935
VB solution:

(A) GPS – PC communication

      (look for: “The VB Code”)

If GPS in NMEA mode you need to change:
      MSComm1.Settings = "1200,N,8,1" 'Set baud rate
      MSComm1.Settings = "4800,N,8,1" 'Set baud rate

(B) data to mySql


This is an ADO example (do not forget to install an ODBC driver)

Author Comment

ID: 12321367
Vilia thanks for your anwser!

       The VB code seems nice but i think that it is for another type of aplication, the main routine of the program is for a temperature.

Expert Comment

ID: 12321770
Yes the communication portion IS for temperature. I have posted the link, as the one is a good example how to setup a COM port communication and read from the one.

I cannot see why it is a problem to write additional 10 lines of code to have the program you need?!

Author Comment

ID: 12321819
The problem is that i dont know how to interpretate the NMEA protocol!

Expert Comment

ID: 12321957
> The problem is that i dont know how to interpretate the NMEA protocol!

The NMEA 0183 standard calls for data communication in the form of coded "sentences." Each sentence begins with the character "$" and ends with a carriage return and line feed.

Have a look at:
(there is a small communication program there. But I doubt the one is going to work on a newer Win platform.

For some NMEA sentence information:

To be in sync on the beginning of the communication look for CRLF and drop everything up to that point. After that read data – “sentences” (GPS is going to send them each second) find what they are ($….. CRLF) and store them as you want/need in mySql.


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I feel like more and more people want to know how to programmatically convert addresses into geospatial locations. So in this article, I will show you how you can do it with Bing Maps. I'm going to use PowerShell, which is a nice scripting language,…
Introduction This article is designed to assist GIS (Geographic Information System) and GPS (Global Positioning System) developers using ESRI ArcGIS and other spatial information management systems.   For the uninitiated the concept of projectio…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question