Solved

GPS connection

Posted on 2004-10-13
9
710 Views
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

                           Psiu
0
Comment
Question by:psiubest
  • 4
  • 3
  • 2
9 Comments
 
LVL 13

Expert Comment

by:imarshad
Comment Utility
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
0
 
LVL 5

Expert Comment

by:vilia
Comment Utility
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.







0
 

Author Comment

by:psiubest
Comment Utility
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
0
 
LVL 13

Expert Comment

by:imarshad
Comment Utility
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
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 5

Accepted Solution

by:
vilia earned 500 total points
Comment Utility
VB solution:

(A) GPS – PC communication

http://www.rentron.com/PicBasic/VB_PIC_TEMP.htm
      (look for: “The VB Code”)

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



(B) data to mySql

http://www.vbmysql.com/samplecode/blob_dot_net.html

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

Author Comment

by:psiubest
Comment Utility
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.
0
 
LVL 5

Expert Comment

by:vilia
Comment Utility
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?!
0
 

Author Comment

by:psiubest
Comment Utility
The problem is that i dont know how to interpretate the NMEA protocol!
0
 
LVL 5

Expert Comment

by:vilia
Comment Utility
> 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.

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now