Ultimate GPS Logger Shield Coding Questions

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

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
M1chael
 
Posts: 15
Joined: Wed Jul 02, 2014 2:35 pm

Ultimate GPS Logger Shield Coding Questions

Post by M1chael »

I have an Ultimate GPS logger shield and I’m using the shield_sdlog.ino code from the Adafruit GPS master library that is referenced on the learning page. In my playing around for better understanding a few questions have come up, I hope someone can help answer or point me to previous forum topic.

1. When I change the update rate from 1 Hz to 5 Hz, I no longer get any data being written to my SD card but data is being sent to the serial monitor at the faster update rate.

Code: Select all

GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);   // Original code
GPS.sendCommand(PMTK_SET_NMEA_UPDATE_5HZ);   // Change to 5 to get 5 Hz update rate.
2. When I’m getting both RMC and GGA sentences, there is only 1 RMC sentence per 3 or 4 GGA sentences, is this normal? How do I get it 1 for 1?

Finally, can someone explain this snippet of code to me? (ELI5) It’s the last part of the code in the loop of shield_sdlog.ino. My current understanding is this:
Line 1: // assigns stringptr value to = the value of the function GPS.lastNMEA
Line 2: // strlen returns the number of characters stringptr is, stringsize is then set = to that.
Line 3: // I’m not sure about this line. The If statement compares stringsize to the length of what is written in the log file. Does the fact that the logfile.write function is called in the If comparison do the actual writing to the file also?
Line 4: // call error() function with value of 4
Line 5: // search stringptr for RMC, if found flush the logfile
Line 6: // print blank line or hard return to serial monitor

Code: Select all

char *stringptr = GPS.lastNMEA(); 
uint8_t stringsize = strlen(stringptr);  
if (stringsize != logfile.write((uint8_t *)stringptr, stringsize))    //write the string to the SD file.  
  error(4);
if (strstr(stringptr, "RMC"))   logfile.flush(); 
Serial.println();  
Thanks

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Ultimate GPS Logger Shield Coding Questions

Post by adafruit_support_rick »

M1chael wrote:1. When I change the update rate from 1 Hz to 5 Hz, I no longer get any data being written to my SD card but data is being sent to the serial monitor at the faster update rate.
Are you getting complete sentences at 5Hz? They should all end with a checksum and a newline.

Are you using the interrupt for reading the GPS?
M1chael wrote:2. When I’m getting both RMC and GGA sentences, there is only 1 RMC sentence per 3 or 4 GGA sentences, is this normal? How do I get it 1 for 1?
Thy should always be 1 to 1. I suspect you're dropping data at 5Hz. See above questions.
M1chael wrote:Line 3: // I’m not sure about this line. The If statement compares stringsize to the length of what is written in the log file. Does the fact that the logfile.write function is called in the If comparison do the actual writing to the file also?
Yes, this is a bit of a lazy shortcut. the logfile.write does the write and returns the number of characters written. This is then compared with stringsize to check that the entire GPS string was written. Your comments for the other 4 lines are correct.

User avatar
M1chael
 
Posts: 15
Joined: Wed Jul 02, 2014 2:35 pm

Re: Ultimate GPS Logger Shield Coding Questions

Post by M1chael »

No, I'm not using interrupts. I'm just using the example shield_sdlog.ino code, posted below, that is included in the GPS master files. Is the interrupt used in the parsing.pde file the best example to implement?

Here is some additional info on what I'm getting currently.
The data file is empty when set to 5 Hz but here is the first few lines at 1 Hz.
$GPGGA,021633.000,4722.9755,N,12205.7379,W,1,8,0.88,137.3,M,-17.4,M,,*69
$GPGGA,021634.000,4722.9749,N,12205.7368,W,1,8,0.88,138.9,M,-17.4,M,,*66
$GPRMC,021634.000,A,4722.9749,N,12205.7368,W,0.13,0.00,290714,,,A*7B
$GPGGA,021635.000,4722.9747,N,12205.7362,W,1,8,0.88,139.7,M,-17.4,M,,*6C
$GPGGA,021636.000,4722.9745,N,12205.7356,W,1,8,0.88,140.3,M,-17.4,M,,*60
$GPRMC,021636.000,A,4722.9745,N,12205.7356,W,0.07,0.00,290714,,,A*7D
$GPGGA,021637.000,4722.9743,N,12205.7351,W,1,8,0.88,140.9,M,-17.4,M,,*6A
$GPGGA,021638.000,4722.9741,N,12205.7349,W,1,8,0.88,141.3,M,-17.4,M,,*65
$GPGGA,021639.000,4722.9740,N,12205.7346,W,1,8,0.88,141.7,M,-17.4,M,,*6E
$GPRMC,021639.000,A,4722.9740,N,12205.7346,W,0.11,0.00,290714,,,A*71
Screen shot of the 1 Hz Serial Monitor. It looks like the RMC sentence doesn't have the checksum but its in the data file.
Image

Screen shot of the 5 Hz serial monitor. Again it doesn't look like the RMC sentence has the checksum but its 1 to 1 with the GGA sentences now.
Image

Again, there was no data entered into the data file, it was created but nothing there. Here is the code I'm using for 1 Hz rate. For 5Hz all I change is this: GPS.sendCommand(PMTK_SET_NMEA_UPDATE_5HZ);

Code: Select all

#include <SPI.h>
#include <Adafruit_GPS.h>
#include <SoftwareSerial.h>
#include <SD.h>
#include <avr/sleep.h>

// Ladyada's logger modified by Bill Greiman to use the SdFat library
//
// This code shows how to listen to the GPS module in an interrupt
// which allows the program to have more 'freedom' - just parse
// when a new NMEA sentence is available! Then access data when
// desired.
//
// Tested and works great with the Adafruit Ultimate GPS Shield
// using MTK33x9 chipset
//    ------> http://www.adafruit.com/products/
// Pick one up today at the Adafruit electronics shop 
// and help support open source hardware & software! -ada

SoftwareSerial mySerial(8, 7);
Adafruit_GPS GPS(&mySerial);

// Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console
// Set to 'true' if you want to debug and listen to the raw GPS sentences
#define GPSECHO  true
/* set to true to only log to SD when GPS has a fix, for debugging, keep it false */
#define LOG_FIXONLY false  

// Set the pins used
#define chipSelect 10
#define ledPin 13

File logfile;

// 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;
}

// blink out an error code
void error(uint8_t errno) {
/*
  if (SD.errorCode()) {
    putstring("SD error: ");
    Serial.print(card.errorCode(), HEX);
    Serial.print(',');
    Serial.println(card.errorData(), HEX);
  }
  */
  while(1) {
    uint8_t i;
    for (i=0; i<errno; i++) {
      digitalWrite(ledPin, HIGH);
      delay(100);
      digitalWrite(ledPin, LOW);
      delay(100);
    }
    for (i=errno; i<10; i++) {
      delay(200);
    }
  }
}

void setup() {
  // for Leonardos, if you want to debug SD issues, uncomment this line
  // to see serial output
  //while (!Serial);
  
  // connect at 115200 so we can read the GPS fast enough and echo without dropping chars
  // also spit it out
  Serial.begin(115200);
  Serial.println("\r\nUltimate GPSlogger Shield");
  pinMode(ledPin, OUTPUT);

  // make sure that the default chip select pin is set to
  // output, even if you don't use it:
  pinMode(10, OUTPUT);
  
  // see if the card is present and can be initialized:
  //if (!SD.begin(chipSelect, 11, 12, 13)) {
  if (!SD.begin(chipSelect)) {      // if you're using an UNO, you can use this line instead
    Serial.println("Card init. failed!");
    error(2);
  }
  char filename[15];
  strcpy(filename, "GPSLOG00.TXT");
  for (uint8_t i = 0; i < 100; i++) {
    filename[6] = '0' + i/10;
    filename[7] = '0' + i%10;
    // create if does not exist, do not open existing, write, sync after write
    if (! SD.exists(filename)) {
      break;
    }
  }

  logfile = SD.open(filename, FILE_WRITE);
  if( ! logfile ) {
    Serial.print("Couldnt create "); Serial.println(filename);
    error(3);
  }
  Serial.print("Writing to "); Serial.println(filename);
  
  // connect to the GPS at the desired rate
  GPS.begin(9600);

  // uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude
  GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
  // uncomment this line to turn on only the "minimum recommended" data
  //GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);
  // For logging data, we don't suggest using anything but either RMC only or RMC+GGA
  // to keep the log files at a reasonable size
  // Set the update rate
  GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);   // 1 or 5 Hz update rate

  // Turn off updates on antenna status, if the firmware permits it
  GPS.sendCommand(PGCMD_NOANTENNA);
  
  Serial.println("Ready!");
}

void loop() {
  char c = GPS.read();
  if (GPSECHO)
     if (c)   Serial.print(c);

  // if a sentence is received, we can check the checksum, parse it...
  if (GPS.newNMEAreceived()) {
    // a tricky thing here is if we print the NMEA sentence, or data
    // we end up not listening and catching other sentences! 
    // so be very wary if using OUTPUT_ALLDATA and trying to print out data
    //Serial.println(GPS.lastNMEA());   // this also sets the newNMEAreceived() flag to false
        
    if (!GPS.parse(GPS.lastNMEA()))   // this also sets the newNMEAreceived() flag to false
      return;  // we can fail to parse a sentence in which case we should just wait for another
    
    // Sentence parsed! 
    Serial.println("OK");
    if (LOG_FIXONLY && !GPS.fix) {
        Serial.print("No Fix");
        return;
    }

    // Rad. lets log it!
    Serial.println("Log");
    
    char *stringptr = GPS.lastNMEA();
    uint8_t stringsize = strlen(stringptr);
    if (stringsize != logfile.write((uint8_t *)stringptr, stringsize))    //write the string to the SD file
      error(4);
    if (strstr(stringptr, "RMC"))   logfile.flush();
    Serial.println();
  }
}


/* End code */

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Ultimate GPS Logger Shield Coding Questions

Post by adafruit_support_rick »

Yeah - you're dropping characters. Before we add the interrupt stuff, give this a try:

Code: Select all

void loop() {
  while (mySerial.available())
  {
    char c = GPS.read();
    if (GPSECHO)
       if (c)   Serial.print(c);
  }

... etc ...

User avatar
M1chael
 
Posts: 15
Joined: Wed Jul 02, 2014 2:35 pm

Re: Ultimate GPS Logger Shield Coding Questions

Post by M1chael »

Great, thanks for the help! I add the code as you suggested and got it working, here are the results.
Sample of the data for 1 Hz. As you can see it only records RMC sentences.
$GPRMC,020004.000,A,4722.9717,N,12205.7338,W,0.08,0.00,300714,,,A*73
$GPRMC,020005.000,A,4722.9714,N,12205.7342,W,0.64,203.52,300714,,,A*70
$GPRMC,020006.000,A,4722.9712,N,12205.7344,W,0.04,203.52,300714,,,A*75
$GPRMC,020007.000,A,4722.9713,N,12205.7343,W,0.04,203.52,300714,,,A*72
$GPRMC,020008.000,A,4722.9714,N,12205.7344,W,0.02,203.52,300714,,,A*7B
$GPRMC,020009.000,A,4722.9714,N,12205.7346,W,0.01,203.52,300714,,,A*7B
A screen capture of the serial monitor for 1 Hz,it captures full GGA and RMC sentences with checksums.
Image


Screen capture of the serial monitor for 5 Hz. Looks like there are several places that the RMC sentences are dropping characters.
Image

Sample data from the data file at 5 Hz. It actually wrote to it this time but as you can see the RMC sentences aren't consistent and don't include the checksum characters.
$GPGGA,020716.200,4722.9714,N,12205.7301,W,1,7,0.94,140.1,M,-17.4,M,,*66
$GPGGA,020716.600,4722.9714,N,12205.7300,W,1,7,0.94,140.1,M,-17.4,M,,*63
$GPGGA,020716.800,4722.9714,N,12205.7300,W,1,7,0.94,140.1,M,-17.4,M,,*6D
$GPGGA,020717.000,4722.9714,N,12205.7300,W,1,7,0.94,140.1,M,-17.4,M,,*64
$GPGGA,020717.800,4722.9714,N,12205.7299,W,1,7,0.94,140.2,M,-17.4,M,,*6E
$GPGGA,020718.600,4722.9714,N,12205.7299,W,1,7,0.94,140.5,M,-17.4,M,,*68
$GPGGA,020719.200,4722.9714,N,12205.7300,W,1,7,0.94,140.7,M,-17.4,M,,*6E
$GPGGA,020719.600,4722.9714,N,12205.7300,W,1,7,0.94,140.8,M,-17.4,M,,*65
$GPGGA,020719.800,4722.9714,N,12205.7300,W,1,7,0.94,140.9,M,-17.4,M,,*6A
$GPRMC,020720.000,A,4722.9713,N,1220.3,,.,.0374,*7$GPGGA,020720.400,4722.9713,N,12205.7300,W,1,7,0.94,141.0,M,-17.4,M,,*63
$GPGGA,020721.200,4722.9713,N,12205.7298,W,1,7,0.94,140.9,M,-17.4,M,,*6C
$GPGGA,020721.800,4722.9713,N,12205.7297,W,1,7,0.94,140.7,M,-17.4,M,,*67
$GPGGA,020722.200,4722.9712,N,12205.7297,W,1,7,0.94,140.6,M,-17.4,M,,*6E
$GPGGA,020722.400,4722.9712,N,12205.7297,W,1,7,0.94,140.5,M,-17.4,M,,*6B
$GPGGA,020723.000,4722.9712,N,12205.7296,W,1,7,0.94,140.4,M,-17.4,M,,*6E
$GPGGA,020723.600,4722.9711,N,12205.7295,W,1,7,0.94,140.3,M,-17.4,M,,*6F
$GPGGA,020724.000,4722.9711,N,12205.7295,W,1,7,0.94,140.3,M,-17.4,M,,*6E
$GPGGA,020724.200,4722.9711,N,12205.7294,W,1,7,0.94,140.2,M,-17.4,M,,*6C
$GPGGA,020724.400,4722.9711,N,12205.7294,W,1,7,0.94,140.2,M,-17.4,M,,*6A
$GPGGA,020724.800,4722.9710,N,12205.7294,W,1,6,1.13,140.1,M,-17.4,M,,*6B
$GPGGA,020725.400,4722.9709,N,12205.7294,W,1,6,1.13,140.0,M,-17.4,M,,*6F
$GPGGA,020725.600,4722.9709,N,12205.7293,W,1,7,0.94,139.9,M,-17.4,M,,*62
$GPGGA,020726.400,4722.9709,N,12205.7292,W,1,7,0.94,139.6,M,-17.4,M,,*6D
$GPGGA,020726.600,4722.9708,N,12205.7292,W,1,7,0.94,139.6,M,-17.4,M,,*6E
$GPGGA,020727.000,4722.9708,N,12205.7292,W,1,7,0.94,139.5,M,-17.4,M,,*6A
$GPGGA,020727.200,4722.9708,N,12205.7292,W,1,7,0.94,139.5,M,-17.4,M,,*68
$GPGGA,020727.400,4722.9708,N,12205.7291,W,1,7,0.94,139.5,M,-17.4,M,,*6D
$GPGGA,020728.400,4722.9708,N,12205.7291,W,1,7,0.94,139.5,M,-17.4,M,,*62
$GPGGA,020728.600,4722.9708,N,12205.7291,W,1,7,0.94,139.5,M,-17.4,M,,*60
$GPGGA,020728.800,4722.9708,N,12205.7291,W,1,7,0.94,139.5,M,-17.4,M,,*6E
$GPGGA,020729.600,4722.9708,N,12205.7291,W,1,7,0.94,139.5,M,-17.4,M,,*61
$GPGGA,020729.800,4722.9708,N,12205.7291,W,1,7,0.94,139.5,M,-17.4,M,,*6F
$GPGGA,020730.000,4722.9708,N,12205.7291,W,1,7,0.94,139.5,M,-17.4,M,,*6F
$GPGGA,020731.400,4722.9708,N,12205.7291,W,1,7,0.94,139.5,M,-17.4,M,,*6A
$GPGGA,020732.000,4722.9708,N,12205.7291,W,1,7,0.94,139.4,M,-17.4,M,,*6C
$GPRMC,020732.200,A,4722.9708,N,1220.2,,.,.0304,A2$GPGGA,020732.800,4722.9708,N,12205.7291,W,1,7,0.94,139.4,M,-17.4,M,,*64

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Ultimate GPS Logger Shield Coding Questions

Post by adafruit_support_rick »

Right. Try this - it's the standard shield_sdlog sketch, except I've added the interrupt processing for reading the GPS:

Code: Select all

#include <SPI.h>
#include <Adafruit_GPS.h>
#include <SoftwareSerial.h>
#include <SD.h>
#include <avr/sleep.h>

// Ladyada's logger modified by Bill Greiman to use the SdFat library
//
// This code shows how to listen to the GPS module in an interrupt
// which allows the program to have more 'freedom' - just parse
// when a new NMEA sentence is available! Then access data when
// desired.
//
// Tested and works great with the Adafruit Ultimate GPS Shield
// using MTK33x9 chipset
//    ------> http://www.adafruit.com/products/
// Pick one up today at the Adafruit electronics shop 
// and help support open source hardware & software! -ada

SoftwareSerial mySerial(8, 7);
Adafruit_GPS GPS(&mySerial);

// Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console
// Set to 'true' if you want to debug and listen to the raw GPS sentences
#define GPSECHO  true
/* set to true to only log to SD when GPS has a fix, for debugging, keep it false */
#define LOG_FIXONLY false  

// this keeps track of whether we're using the interrupt
// off by default!
boolean usingInterrupt = false;
void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy

// Set the pins used
#define chipSelect 10
#define ledPin 13

File logfile;

// 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;
}

// blink out an error code
void error(uint8_t errno) {
  /*
  if (SD.errorCode()) {
   putstring("SD error: ");
   Serial.print(card.errorCode(), HEX);
   Serial.print(',');
   Serial.println(card.errorData(), HEX);
   }
   */
  while(1) {
    uint8_t i;
    for (i=0; i<errno; i++) {
      digitalWrite(ledPin, HIGH);
      delay(100);
      digitalWrite(ledPin, LOW);
      delay(100);
    }
    for (i=errno; i<10; i++) {
      delay(200);
    }
  }
}

void setup() {
  // for Leonardos, if you want to debug SD issues, uncomment this line
  // to see serial output
  //while (!Serial);

  // connect at 115200 so we can read the GPS fast enough and echo without dropping chars
  // also spit it out
  Serial.begin(115200);
  Serial.println("\r\nUltimate GPSlogger Shield");
  pinMode(ledPin, OUTPUT);

  // make sure that the default chip select pin is set to
  // output, even if you don't use it:
  pinMode(10, OUTPUT);

  // see if the card is present and can be initialized:
  if (!SD.begin(chipSelect, 11, 12, 13)) {
    //if (!SD.begin(chipSelect)) {      // if you're using an UNO, you can use this line instead
    Serial.println("Card init. failed!");
    error(2);
  }
  char filename[15];
  strcpy(filename, "GPSLOG00.TXT");
  for (uint8_t i = 0; i < 100; i++) {
    filename[6] = '0' + i/10;
    filename[7] = '0' + i%10;
    // create if does not exist, do not open existing, write, sync after write
    if (! SD.exists(filename)) {
      break;
    }
  }

  logfile = SD.open(filename, FILE_WRITE);
  if( ! logfile ) {
    Serial.print("Couldnt create "); 
    Serial.println(filename);
    error(3);
  }
  Serial.print("Writing to "); 
  Serial.println(filename);

  // connect to the GPS at the desired rate
  GPS.begin(9600);

  // uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude
  GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
  // uncomment this line to turn on only the "minimum recommended" data
  //GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);
  // For logging data, we don't suggest using anything but either RMC only or RMC+GGA
  // to keep the log files at a reasonable size
  // Set the update rate
  GPS.sendCommand(PMTK_SET_NMEA_UPDATE_5HZ);   // 1 or 5 Hz update rate

  // Turn off updates on antenna status, if the firmware permits it
  GPS.sendCommand(PGCMD_NOANTENNA);

  // the nice thing about this code is you can have a timer0 interrupt go off
  // every 1 millisecond, and read data from the GPS for you. that makes the
  // loop code a heck of a lot easier!
  useInterrupt(true);

  Serial.println("Ready!");
}


// Interrupt is called once a millisecond, looks for any new GPS data, and stores it
SIGNAL(TIMER0_COMPA_vect) {
  char c;
  while (mySerial.available())
  {
    c = GPS.read();
    // if you want to debug, this is a good time to do it!
#ifdef UDR0
    if (GPSECHO)
      if (c) UDR0 = c;  
    // writing direct to UDR0 is much much faster than Serial.print 
    // but only one character can be written at a time. 
#endif
  }
}

void useInterrupt(boolean v) {
  if (v) {
    // Timer0 is already used for millis() - we'll just interrupt somewhere
    // in the middle and call the "Compare A" function above
    OCR0A = 0xAF;
    TIMSK0 |= _BV(OCIE0A);
    usingInterrupt = true;
  } 
  else {
    // do not call the interrupt function COMPA anymore
    TIMSK0 &= ~_BV(OCIE0A);
    usingInterrupt = false;
  }
}

void loop() {
  char c;
  while (mySerial.available())
  {
    c = GPS.read();
    if (GPSECHO)
      if (c)   Serial.print(c);
  }
  
  // if a sentence is received, we can check the checksum, parse it...
  if (GPS.newNMEAreceived()) {
    // a tricky thing here is if we print the NMEA sentence, or data
    // we end up not listening and catching other sentences! 
    // so be very wary if using OUTPUT_ALLDATA and trying to print out data
    //Serial.println(GPS.lastNMEA());   // this also sets the newNMEAreceived() flag to false

    if (!GPS.parse(GPS.lastNMEA()))   // this also sets the newNMEAreceived() flag to false
      return;  // we can fail to parse a sentence in which case we should just wait for another

    // Sentence parsed! 
    Serial.println("OK");
    if (LOG_FIXONLY && !GPS.fix) {
      Serial.print("No Fix");
      return;
    }

    // Rad. lets log it!
    Serial.println("Log");

    char *stringptr = GPS.lastNMEA();
    uint8_t stringsize = strlen(stringptr);
    if (stringsize != logfile.write((uint8_t *)stringptr, stringsize))    //write the string to the SD file
        error(4);
    if (strstr(stringptr, "RMC"))   logfile.flush();
    Serial.println();
  }
}


/* End code */


User avatar
M1chael
 
Posts: 15
Joined: Wed Jul 02, 2014 2:35 pm

Re: Ultimate GPS Logger Shield Coding Questions

Post by M1chael »

Awesome, thanks! I'll give it a try tonight after work.

User avatar
M1chael
 
Posts: 15
Joined: Wed Jul 02, 2014 2:35 pm

Re: Ultimate GPS Logger Shield Coding Questions

Post by M1chael »

No joy in getting your updated code to work. It compiles but the serial output is just gibberish, the data file is created but no data is written to it. I tested both 1Hz and 5Hz with the same results.

Screen capture of the serial monitor.
Image

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Ultimate GPS Logger Shield Coding Questions

Post by adafruit_support_rick »

That looks like your GPS has been set to a different baud rate. Have you tried to change the baud rate of the module at some point?

Try changing the GPS.begin(9600); to some other number, like 4800 and 19200, and see if you start to get good data.

User avatar
M1chael
 
Posts: 15
Joined: Wed Jul 02, 2014 2:35 pm

Re: Ultimate GPS Logger Shield Coding Questions

Post by M1chael »

Ok, tried a couple other baud rates for the GPS as you mentioned with no improvement. I thought that the Audafruit_GPS.h only accepted 9600 and 57600, is there an updated library version that accepts others? Also tried changing the serial monitor rate with different GPS rates with no luck.. I looked through the code for anything obvious but nothing jumped out.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Ultimate GPS Logger Shield Coding Questions

Post by adafruit_support_rick »

Maybe it's a connection issue? Please post clear, detailed pictures of both sides of the shield, showing your soldering.

User avatar
M1chael
 
Posts: 15
Joined: Wed Jul 02, 2014 2:35 pm

Re: Ultimate GPS Logger Shield Coding Questions

Post by M1chael »

Ok, here are the pictures. Sorry for the size but wanted to make sure you could see the details.


Image

Image

Image

Image

Image

Image

Image

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Ultimate GPS Logger Shield Coding Questions

Post by adafruit_support_rick »

Beautiful pictures. I wish everybody posted them like that.
2 or 3 of the pins could use a little more solder, but they're not involved in GPS communications anyway. Otherwise, the soldering is fine.

I'm at a loss here. All I can think to do is to try replacing the shield.
Please email [email protected] with a link to this thread for a replacement GPS Shield. Remember to ask them for a new set of stacking headers as well.

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

Return to “Arduino Shields from Adafruit”