ADK and GPS logger shield

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ADK and GPS logger shield

Post by adafruit_support_rick »

Please copy and paste the exact output you are getting on the serial monitor, not just a single line

bvass777
 
Posts: 22
Joined: Tue Mar 25, 2014 9:42 am

Re: ADK and GPS logger shield

Post by bvass777 »

It appears I cannot copy and paste from the serial monitor.
it goes something like this:
$GPGSV,1,1,02,02,,,30,04,,25*79
$GPRMC,004319.085,V,,,,,0.00,K,N*3E
$GPVTG,319.07,T,,M,0.00,K,N*3E
$GPGGA,004320.085,,,,,0,0,,,M,,M,,*40
$GPCSA,A,1,,,,,,,,,,,,,*1E
$GPRMC,004320.085,V,,,,,,0.00,319.07,200614,,,N*49
repeats similarily........

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

Re: ADK and GPS logger shield

Post by adafruit_support_rick »

Not sure what's going on here.
Howver, you should not be getting all of those different NMEA sentences. Your code issues a command to only report RMC and GGA sentences, so the GPS does not seem to be getting that command.

Check your RX and TX connections. Se if you van get it to where you're only seeing RMC and GGA sentences.

bvass777
 
Posts: 22
Joined: Tue Mar 25, 2014 9:42 am

Re: ADK and GPS logger shield

Post by bvass777 »

switching my adk board to soft serial stops the $GPGSA type streams. Switching back to direct we get the stream to continue. Seems the TX/RX is connected.

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

Re: ADK and GPS logger shield

Post by adafruit_support_rick »

Right. You need the switch to be in Soft Serial mode. For the ADK, you need to install a jumper between Digital 8 and Digital 19, and another jumper between Digital 7 and Digital 18.

With the switch in the Soft Serial position, the shield uses Digital 7 and 8 to communicate with the GPS. The ADK does not support software serial on those pins. That's why you need to jumper them.

With the jumpers in place, you will not be using Software Serial in the Parsing sketch. Instead, set it up to use Serial1 (Follow the instructions for the Mega).

I've pre-configured the parsing sketch for the Mega ADK. Use this:

Code: Select all

// Test code for Adafruit GPS modules using MTK3329/MTK3339 driver
//
// 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 module
// using MTK33x9 chipset
//    ------> http://www.adafruit.com/products/746
// Pick one up today at the Adafruit electronics shop 
// and help support open source hardware & software! -ada

#include <Adafruit_GPS.h>
#include <SoftwareSerial.h>

// If you're using a GPS module:
// Connect the GPS Power pin to 5V
// Connect the GPS Ground pin to ground
// If using software serial (sketch example default):
//   Connect the GPS TX (transmit) pin to Digital 3
//   Connect the GPS RX (receive) pin to Digital 2
// If using hardware serial (e.g. Arduino Mega):
//   Connect the GPS TX (transmit) pin to Arduino RX1, RX2 or RX3
//   Connect the GPS RX (receive) pin to matching TX1, TX2 or TX3
#define mySerial Serial1

// If you're using the Adafruit GPS shield, change 
// SoftwareSerial mySerial(3, 2); -> SoftwareSerial mySerial(8, 7);
// and make sure the switch is set to SoftSerial

// If using software serial, keep these lines enabled
// (you can change the pin numbers to match your wiring):
//SoftwareSerial mySerial(3, 2);

Adafruit_GPS GPS(&mySerial);
// If using hardware serial (e.g. Arduino Mega), comment
// out the above six lines and enable this line instead:
//Adafruit_GPS GPS(&Serial1);


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

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

void setup()  
{
    
  // 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("Adafruit GPS library basic test!");

  // 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800
  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 parsing data, we don't suggest using anything but either RMC only or RMC+GGA since
  // the parser doesn't care about other sentences at this time
  
  // Set the update rate
  GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);   // 1 Hz update rate
  // For the parsing code to work nicely and have time to sort thru the data, and
  // print it out we don't suggest using anything higher than 1 Hz

  // Request updates on antenna status, comment out to keep quiet
  GPS.sendCommand(PGCMD_ANTENNA);

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

  delay(1000);
  // Ask for firmware version
  mySerial.println(PMTK_Q_RELEASE);
}


// Interrupt is called once a millisecond, looks for any new GPS data, and stores it
SIGNAL(TIMER0_COMPA_vect) {
  char 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;
  }
}

uint32_t timer = millis();
void loop()                     // run over and over again
{
  // in case you are not using the interrupt above, you'll
  // need to 'hand query' the GPS, not suggested :(
  if (! usingInterrupt) {
    // read data from the GPS in the 'main loop'
    char c = GPS.read();
    // if you want to debug, this is a good time to do it!
    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 trytng 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
  }

  // if millis() or timer wraps around, we'll just reset it
  if (timer > millis())  timer = millis();

  // approximately every 2 seconds or so, print out the current stats
  if (millis() - timer > 2000) { 
    timer = millis(); // reset the timer
    
    Serial.print("\nTime: ");
    Serial.print(GPS.hour, DEC); Serial.print(':');
    Serial.print(GPS.minute, DEC); Serial.print(':');
    Serial.print(GPS.seconds, DEC); Serial.print('.');
    Serial.println(GPS.milliseconds);
    Serial.print("Date: ");
    Serial.print(GPS.day, DEC); Serial.print('/');
    Serial.print(GPS.month, DEC); Serial.print("/20");
    Serial.println(GPS.year, DEC);
    Serial.print("Fix: "); Serial.print((int)GPS.fix);
    Serial.print(" quality: "); Serial.println((int)GPS.fixquality); 
    if (GPS.fix) {
      Serial.print("Location: ");
      Serial.print(GPS.latitude, 4); Serial.print(GPS.lat);
      Serial.print(", "); 
      Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);
      
      Serial.print("Speed (knots): "); Serial.println(GPS.speed);
      Serial.print("Angle: "); Serial.println(GPS.angle);
      Serial.print("Altitude: "); Serial.println(GPS.altitude);
      Serial.print("Satellites: "); Serial.println((int)GPS.satellites);
    }
  }
}

bvass777
 
Posts: 22
Joined: Tue Mar 25, 2014 9:42 am

Re: ADK and GPS logger shield

Post by bvass777 »

Re: ADK and GPS logger shield

by adafruit_support_mike on Thu Jun 05, 2014 3:01 pm

Okay, you're using the Direct Connect method.

The comments in the sketch are for people connecting a GPS breakout. The shield makes all the connections for you, so you don't need any extra wiring. In your case, the comments just tell you what connections the shield makes.

You do need to move the switch on the shield to the 'Direct' position, as shown on the tutorial page. That connects the GPS module's TX and RX pins to pins 0 and 1 on the Arduino, then the Arduino's serial-to-USB chip carries the data to your computer.
User avatar
adafruit_support_mike Posts: 8141Joined: Thu Feb 11, 2010 1:51 pm
,
,
,now I am confused:
i am told to use direct
I am told to use soft

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

Re: ADK and GPS logger shield

Post by adafruit_support_rick »

'Direct' mode is only for viewing raw GPS data in Serial Monitor. The Arduino cannot actually read GPS data in Direct mode.

'Soft Serial' mode is designed to work with the Arduino Uno, which can receive GPS data on Digital 8. The Mega/ADK cannot receive GPS data on Digital 8, so you must jumper to Serial1, as I described earlier.

bvass777
 
Posts: 22
Joined: Tue Mar 25, 2014 9:42 am

Re: ADK and GPS logger shield

Post by bvass777 »

I am using windows 7
I can copy the code , but I cannot paste it anywhere, the option to do so is greyed out.
I commented out the direct serial in the standard code and jumpered 7/8 to 18/19

Still no output

When we do eventually get this running can we change the speed in knots to read in MPH?
why does the code turn orange at times when it is uploading?

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

Re: ADK and GPS logger shield

Post by adafruit_support_rick »

Jumper 8 to 19 and 7 to 18 and use the sketch I posted above.

bvass777
 
Posts: 22
Joined: Tue Mar 25, 2014 9:42 am

Re: ADK and GPS logger shield

Post by bvass777 »

still nothing...
continuing on...
On the Ultimate GPS logger shield, can we use the TX/RX on the 5 hole pad - 3V ,CD,CCS,PPS,TX,RX instead of the TX pin 8, RX pin 7? Clearance issues would help if we could use the 5 hole pad RX?TX holes.
On our 10DOF breakout board we I have soldered it our 16x12 PWM Servo board shield and then into the plugged into the Ultimate GPS shield then into the ADK.

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

Re: ADK and GPS logger shield

Post by adafruit_support_rick »

Yes, you can use the RX/TX on the jumper pads.

bvass777
 
Posts: 22
Joined: Tue Mar 25, 2014 9:42 am

Re: ADK and GPS logger shield

Post by bvass777 »

copied and pasted and uploaded given sketch
TX/RX GPS shield 5 hole pad to ADK to RX/TX 18/17 respectively
No output with serial/direct switch to serial
Scrolling comma separated GSCA etc output in Com 4 serial screen
Also have 10DOF and 2 Max31855 TC breakout boards(both Max31855)using same cs but different analog? output) mounted to our 16x12 servo board.( we hope to remotely adjust 1 or 2 servos)
2 questions:
Is there a sketch avail for the 10DOf ?
How do we load multiple sketches (ie 1 sketch running for the GPS(hopefully we get that sorted out), while running the other 10DOF sketch?
we will eventually be looking for 7 digital inputs and 3 pulses per rev for a speed in mph )
That's why we would like to convert the gps speed in knots to speed in mph
Last edited by bvass777 on Thu Jul 10, 2014 6:15 pm, edited 1 time in total.

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

Re: ADK and GPS logger shield

Post by adafruit_support_rick »

bvass777 wrote:TX/RX GPS shield 5 hole pad to ADK to RX/TX 18/17 respectively
You jumpered to 17/18, or was that a typo?
Should be RX to 18, TX to 19.
With the switch in Direct, you will see GPS data on the Serial Monitor. You don't want that. Leave the switch in Software Serial mode. You will read GPS data on Serial1

bvass777
 
Posts: 22
Joined: Tue Mar 25, 2014 9:42 am

Re: ADK and GPS logger shield

Post by bvass777 »

gps shield TX to ADK RX 19
gps shield RX to ADK TX 18

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

Re: ADK and GPS logger shield

Post by adafruit_support_rick »

bvass777 wrote:Is there a sketch avail for the 10DOf ?
The 10DOF library is here. There are three example sketches with the library.
https://github.com/adafruit/Adafruit_10DOF
You will also need to install the Unified Sensor Library:
https://github.com/adafruit/Adafruit_Sensor
bvass777 wrote:How do we load multiple sketches (ie 1 sketch running for the GPS(hopefully we get that sorted out), while running the other 10DOF sketch?
You can't load "multiple" sketches. You have to write a single sketch that does everything you want. To some extent, you can cut-and-paste sections from different example sketches into one combined sketch, but that is usually only enough to get you started. You will still have to customize this combined sketch for your particular application.

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

Return to “Arduino”