Updated GPS logger script for ATMEGA 328

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
henkie
 
Posts: 1
Joined: Thu Feb 04, 2010 12:43 pm

Re: Updated GPS logger script for ATMEGA 328

Post by henkie »

neo7530 wrote:Update:

new parser...

added automatic waypoint generation in csv-file. every 20th trackpoint is marked as waypoint and has additional info about speed, course altitude and sats used...

have fun...
I was wondering which files I have to load into my arduino. All 3 of them? and in what order should I do this?

Thx for all the help

henkie

User avatar
tcharron
 
Posts: 59
Joined: Tue Oct 13, 2009 7:15 pm

Re: Updated GPS logger script for ATMEGA 328

Post by tcharron »

neo7530 wrote:Update:
new parser...
have fun...
This looks really good.
Unfortunately, I think you'll scare away some interested folk (like me) without providing source code for an EXE. Can you provide it here or point to it on the web?
Thanks!

pacman
 
Posts: 1
Joined: Sun Mar 21, 2010 10:20 pm

Re: Updated GPS logger script for ATMEGA 328

Post by pacman »

Just dropped by, and saw this...

Code: Select all

// read a Hex value and return the decimal equivalent
uint8_t parseHex(char c) {
  if (c < '0')
    return 0;
  if (c <= '9')
    return c - '0';
  if (c < 'A')
    return 0;
  if (c <= 'F')
    return (c - 'A')+10;
}
I suggest either to remove all the 'return 0;' for speed or adding a return 0 at the bottom for reliability.

Personally, I prefer returning a negative number (which is more than 8 bit), in case there's an error in parsing the hex number; eg. something like this:

Code: Select all

int16_t parseHex(char c)
{
  if(c >= '0' && c <= '9')
  {
    return(c - '0');
  }
  else if(c >= 'A' && c <= 'F')
  {
    return(c + 10 - 'A')
  }
  else if(c >= 'a' && c <= 'f')
  {
    return(c + 10 - 'a');
  }
  return(-1);
}
This is just a basic piece of code.
Since we're dealing with a single digit here, you may even choose to change back the result to a uint8_t, and then return any value above 16, to indicate an error. I've added the lowercase check, in case you'd like to use this routine for something else as well.

Ofcourse, most of the time, these errors will not happen, and it might not mean anything when dealing with a microcontroller (and a hobby project), but if some of you should happen to work with code that controls devices with automatic navigation, it could become a reason for accidents, which you'd probably like to avoid.

For completeness...

Code: Select all

uint8_t hexDigit(uint8_t value)
{
  char *hex = "0123456789ABCDEF";
  return((uint8_t) hex[value & 0x0f]);
}
Exercises for the reader: Put the hex digits in progmem, change the routine to a macro, to save binary space.

asleepinverona
 
Posts: 16
Joined: Mon Nov 01, 2010 4:02 pm

Re: Updated GPS logger script for ATMEGA 328

Post by asleepinverona »

hehe, it's almost done...

it was a piece of hard work, but now i have bend all the bits and bytes to it's right position

The tracker sets up the sirf gps to sirf binary-mode, disables all unwanted messages and writes a GPSLOGXX.BIN file to the memorycard with all the trackpoints, sat-data, hdop, speed, altitude and a little bit more within 91 bytes a message / trackpoint.

after logging you have to convert the bin-file to a csv-file using the parser.exe

usage:

Code: Select all
parser.exe gpslogxx.bin


by using:

Code: Select all
parser.exe gpslogxx.bin debug


the parser will create a debug.txt file in a human readable format.

now you can upload the csv file to gpsvisualizer.com to plot the track.

have fun, and give a feedback, please...

EDIT: new parser.exe in zip-file... fixed precision in longitude and latitude
before: xx.xxxxx
after: xx.BANNED
Hi! I'm new here and I don't understand how these files work together. I tried compiling each one and none of them will compile

When compiling the gps_sirfbinary file:

Code: Select all

 gps_sirfbinary_logger.cpp: In function 'void setup()':
gps_sirfbinary_logger:61: error: 'init_gps' was not declared in this scope
gps_sirfbinary_logger:65: error: 'error' was not declared in this scope
gps_sirfbinary_logger:69: error: 'error' was not declared in this scope
gps_sirfbinary_logger:73: error: 'error' was not declared in this scope
gps_sirfbinary_logger:77: error: 'error' was not declared in this scope
gps_sirfbinary_logger:96: error: 'error' was not declared in this scope
gps_sirfbinary_logger:103: error: 'error' was not declared in this scope
gps_sirfbinary_logger.cpp: In function 'void loop()':
gps_sirfbinary_logger:113: error: 'decode_gps' was not declared in this scope

When compiling the "sirfstar" file:

Code: Select all

sirfstar.cpp: In function 'void decode_gps()':
sirfstar:55: error: 'gps_buffer' was not declared in this scope
sirfstar:62: error: 'gps_ender' was not declared in this scope
sirfstar:74: error: 'printbuffer' was not declared in this scope
sirfstar:87: error: 'gpsFix' was not declared in this scope
sirfstar.cpp: In function 'void GPS_join_data()':
sirfstar:96: error: 'gpsFix' was not declared in this scope
sirfstar:96: error: 'gps_buffer' was not declared in this scope
sirfstar:102: error: 'fixled' was not declared in this scope
sirfstar:105: error: 'fixled' was not declared in this scope
sirfstar.cpp: In function 'void configure_gps()':
sirfstar:187: error: 'gps_ender' was not declared in this scope
sirfstar.cpp: In function 'void change_to_sirf_protocol()':
sirfstar:198: error: 'SIRF_96' was not declared in this scope
sirfstar.cpp: In function 'void Wait_GPS_Fix()':
sirfstar:209: error: 'fixled' was not declared in this scope
sirfstar:214: error: 'gpsFix' was not declared in this scope
and when compiling the SDCard code:

Code: Select all



sdcard.cpp: In function 'void error(uint8_t)':
sdcard:4: error: 'fixled' was not declared in this scope
sdcard:5: error: 'writeled' was not declared in this scope
I'd like to know how to get these files to work together to created the GSP logger on the ATMEGA328.

Thanks!

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”