Link to home
Start Free TrialLog in
Avatar of psiubest
psiubest

asked on

GPS connection

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

                           Psiu
Avatar of imarshad
imarshad
Flag of Pakistan image

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......

Imran
Avatar of vilia
vilia

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

:toScreen
      type com2
goto end

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

From command prompt:
      cp2file myLogFile.txt
or
      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)

Note:
(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.







Avatar of psiubest

ASKER

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
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......

Imran
ASKER CERTIFIED SOLUTION
Avatar of vilia
vilia

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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?!
The problem is that i dont know how to interpretate the NMEA protocol!
> 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:
      http://home.mira.net/~gnb/gps/nmea.html
(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:
      http://home.mira.net/~gnb/gps/nmea.html

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.