Thomas Uhrig
Thomas Uhrig

Reputation: 31605

Read data from a GPS-tracker that is pretty undocumented

I have a GPS-tracker, a small device I can connect via USB to my laptop. Also, I have a driver and a little software to view the GPS data. But, I want to evaluate the data on my own.

How can I read (with Java or JNI) the data from this GPS-tracker? I don't have any experience with things like drivers or external devices. How I start? How can I use the existing driver, shipped with the GPS-tracker?

EDIT: Oh, and what I missed to say: There is neither any API, nor a documentation.

Upvotes: 0

Views: 969

Answers (2)

arcy
arcy

Reputation: 13123

The existing driver almost certainly maps the output through USB to a com port. You can look up how to read strings from a com port in Java. (I just realized I am assuming a Windows system here -- I don't know what this looks like on Unix or Mac.)

Unfortunately, WHICH com port it uses may change each time you unplug and replug it. So you will need to make your program flexible, either having the user enter which com port is in use today (the method I used) or have the program try a series of com ports in turn to see if it can 'find' the device.

All the devices like this that I've seen operate automatically; once you plug them in, they continuously output strings of data. Each string of data is in a specific format that almost certainly follows the NMEA specification. This is almost a standard; I say "almost" because there is nothing except convention and market share to keep the manufacturers from outputting something else. However, they all do seem to use those strings. There is lots of information

The device probably outputs one string every so often; it probably outputs different formats of strings from the NMEA list. It probably outputs a newline sequence after every data line. Your program will likely only be interested in one or two of these, so it will need to parse through them and discard the ones it does not want.

Each string represents one kind of data output by the device; my own program to do this looks at the GGA string, which provides 3D fix and accuracy. There are lots of sites that give you all the details on all the NMEA strings.

Next you'll have the fun of trying to figure out just where you are based on the GPS location. That's an even more complicated affair, starting with the database of information you need to translate the location into a place name. But that's why we're all programmers, isn't it?

Upvotes: 2

George
George

Reputation: 255

You probably can configure it to send data to particular IP and PORT. After you can start server and start listening to the PORT where you will get array of bytes from the GPS tracker, you parse it and get information. Use JBoss Netty framework, it is pretty interesting and good tool. Jboss Netty. Checkout the docs and examples. Everything is shown there.

Upvotes: 1

Related Questions