Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Gps Coordinates fetch algorithm  RSS feed

 
Gerald Amalraj
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using the code attached as a screen shot to fetch the lat/longitude coordinates from a gps tracker device through InputStream. I'm able to get the IMEI number correctly but not the coordinates nor the time.

My Coordinates are N12.931915, E80.145832
Time 12/24/2014

Any Help!

Capture.PNG
[Thumbnail for Capture.PNG]
Capture1.PNG
[Thumbnail for Capture1.PNG]
 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I must be missing something. My GPS (the cheapest I could find on EBay) provides information as serial output of lines of text and not as binary data as you seem to process. I get the latitude, longitude, time and some quality information from the $GPGGA record and the date from the $GPRMC record. I process the records using fairly complex regular expressions though it can be done using simple split() . Overall it takes just a few lines of Java or even less lines of Perl.

Once I have the values as Strings it is a simple matter to parse them using standard Java and Perl classes/calls and format the result to any desired form.

I'm fairly new to GPS so I could have it very very wrong and would be delighted to be enlightened.
 
Gerald Amalraj
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been using TK06A GPS tracker and I 'm developing my own server java file and I have received the initial login message packet as per the manual and now I need to send back the ack to the device to get the GPS message packet.

I am not getting the GPS message packet which holds the coordinates. I'm adding the code below. I'm sure that till obtaining the IMEI number in the LOC is correct and I'm having problems in the outputstream. I don't know where am I going wrong.

Kindly help



 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gerald Amalraj wrote:I have been using TK06A GPS tracker and I 'm developing my own server java file


Sorry - this is a long way from my simple GPS so cannot help.
 
Gerald Amalraj
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May I ask what is your GPS model and can you able to get the coordinates without sending the ack to the client ?
 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gerald Amalraj wrote:May I ask what is your GPS model and can you able to get the coordinates without sending the ack to the client ?


It's a NEO6 board which can be purchased on eBay from various shops in the far east. The company I bought mine from are no longer selling it but it is the same as available from http://www.ebay.co.uk/itm/For-Arduino-1PC-Ublox-NEO6MV2-GPS-Module-New-Aircraft-Flight-Controller-/390664152897 and many other Ebay shops. A search will find it. I use a USB to ttl cable like this http://www.ebay.co.uk/itm/High-Quality-USB-PL2303HX-to-RS232-TTL-Serial-Converter-Cable-Adapter-Module-/261618678324 ) to both power it and connect as a serial interface to the PC. The serial output is at 9600 baud and information about the messages can be obtained from http://aprs.gids.nl/nmea/ and other sites; just do a Google search for $GPGGA .

This may not be the best GPS system but for the work I am doing (making a cheap GPS provisioned frequency standard) it is pretty good. The only downside I have is that the 1PPS output from the NEO6 is not brought out to a pin on the board so I have had to use a "cat's whisker" approach to pick up the signal. I have the GPS on a window ledge and typically during the day I see 7 or more satellites but at night it can drop to 5. Yesterday afternoon was very clear and the GPS reported 11 satellites.
 
Gerald Amalraj
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Richard.
 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gerald Amalraj wrote:Thank you Richard.


I forgot to answer the second part of your question. The GPS output is sent as ASCII strings every second without being prompted.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!