Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Metro M4 Express with Ultimate GPS Shield
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Metro M4 Express with Ultimate GPS Shield

by rednifhtaP on Mon Jul 06, 2020 11:07 am

I'm having issue getting any output from the Ultimate GPS Logger Shield using the Metro M4 Express. Both were purchased within the last two weeks. I am able to get the GPS shield working on an UNO board. Because of this, I feel confident that the shield itself is soldered and working properly. However, when I put it on the M4, I get nothing.

At first, I was using trying the Software Serial option, but that does not compile. Eventually, I figured out to use the Direct option, flipping the switch on the board. This will compile and upload. Additionally, according to the LEDs on the unit, there is a GPS fix. It should be working, but the Echo Test example outputs absolutely nothing to Serial. Using the GPS_HardwareSerial_Parsing example (below), I get a bit of output, but only the specific serial printed statements; nothing from the GPS, even when the flag is set to output all GPS statements.

It feels like I might be missing something really obvious. I've scoured the forums and tried to figure this out on my own, but I'm coming up with nothing. I was unable to find anything on this specific combination of hardware. Does anyone have any suggestions or ideas?

Many thanks, in advance!!


Output (these lines are repeated indefinitely):
Code: Select all | TOGGLE FULL SIZE
Time: 00:00:00.000
Date: 0/0/200
Fix: 0 quality: 0



GPS_HardwareSerial_Parsing:
Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_GPS.h>

// what's the name of the hardware serial port?
#define GPSSerial Serial1

// Connect to the GPS on the hardware port
Adafruit_GPS GPS(&GPSSerial);

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

uint32_t timer = millis();


void setup()
{
  //while (!Serial);  // uncomment to have the sketch wait until Serial is ready

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

  delay(1000);

  // Ask for firmware version
  GPSSerial.println(PMTK_Q_RELEASE);
}

void loop() // run over and over again
{
  // 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 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
  }

  // approximately every 2 seconds or so, print out the current stats
  if (millis() - timer > 2000) {
    timer = millis(); // reset the timer
    Serial.print("\nTime: ");
    if (GPS.hour < 10) { Serial.print('0'); }
    Serial.print(GPS.hour, DEC); Serial.print(':');
    if (GPS.minute < 10) { Serial.print('0'); }
    Serial.print(GPS.minute, DEC); Serial.print(':');
    if (GPS.seconds < 10) { Serial.print('0'); }
    Serial.print(GPS.seconds, DEC); Serial.print('.');
    if (GPS.milliseconds < 10) {
      Serial.print("00");
    } else if (GPS.milliseconds > 9 && GPS.milliseconds < 100) {
      Serial.print("0");
    }
    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);
    }
  }
}

rednifhtaP
 
Posts: 6
Joined: Sat Jun 13, 2020 3:23 pm

Re: Metro M4 Express with Ultimate GPS Shield

by adafruit_support_carter on Tue Jul 07, 2020 1:17 pm

It should be working, but the Echo Test example outputs absolutely nothing to Serial.

That was this sketch?
https://github.com/adafruit/Adafruit_GP ... hoTest.ino

adafruit_support_carter
 
Posts: 16820
Joined: Tue Nov 29, 2016 2:45 pm

Re: Metro M4 Express with Ultimate GPS Shield

by rednifhtaP on Tue Jul 07, 2020 1:52 pm

Yes, that's the one. While that is running, nothing comes across to the serial monitor. I would expect to see NMEA statements, but again, nothing.

Thanks!

rednifhtaP
 
Posts: 6
Joined: Sat Jun 13, 2020 3:23 pm

Re: Metro M4 Express with Ultimate GPS Shield

by adafruit_support_carter on Tue Jul 07, 2020 1:58 pm

Try changing setup() in that sketch to this:
Code: Select all | TOGGLE FULL SIZE
void setup() {
  Serial.begin(115200);
  while (!Serial);
  Serial.println("GPS Echo Test");
  GPSSerial.begin(9600);
}

You should at least see "GPS Echo Test" in the serial monitor.

adafruit_support_carter
 
Posts: 16820
Joined: Tue Nov 29, 2016 2:45 pm

Re: Metro M4 Express with Ultimate GPS Shield

by rednifhtaP on Tue Jul 07, 2020 2:12 pm

As expected, I get one line of "GPS Echo Test", followed by nothing.

Image

rednifhtaP
 
Posts: 6
Joined: Sat Jun 13, 2020 3:23 pm

Re: Metro M4 Express with Ultimate GPS Shield

by adafruit_support_carter on Tue Jul 07, 2020 2:18 pm

OK, let's check the hardware. Even though it worked with the UNO, might be something still going on with the Metro setup.

Please post a photo of your setup showing the GP Shield on the Metro M4.

adafruit_support_carter
 
Posts: 16820
Joined: Tue Nov 29, 2016 2:45 pm

Re: Metro M4 Express with Ultimate GPS Shield

by rednifhtaP on Tue Jul 07, 2020 2:28 pm

Sure thing.

Image

rednifhtaP
 
Posts: 6
Joined: Sat Jun 13, 2020 3:23 pm

Re: Metro M4 Express with Ultimate GPS Shield

by adafruit_support_carter on Tue Jul 07, 2020 2:39 pm

Thanks. That soldering is excellent. I think I know what is happening. Sorry, should have remembered this sooner.

This shield was designed for an UNO, which has tx/rx backwards. So using it in "Direct" mode will only work with a few specific boards. See red alert box here:
https://learn.adafruit.com/adafruit-ult ... a-578965-2
(yes, this isn't ideal, but it's a limitation of the older board design)

You'll need to do something similar to the trick shown for the Leonardo:
https://learn.adafruit.com/adafruit-ult ... o-578971-8
where you set the switch to Software Serial and then add some jumper wires. After that, you should be able to use HW Serial1 from the Metro.

adafruit_support_carter
 
Posts: 16820
Joined: Tue Nov 29, 2016 2:45 pm

Re: Metro M4 Express with Ultimate GPS Shield

by rednifhtaP on Tue Jul 07, 2020 2:58 pm

That was it! I saw this note about the other boards, but none of the Metro boards were listed. It might be worth updating the documentation.

My question now is will this jumper configuration be necessary if I am only writing to the SD card? Or is this only needed if I intend to output to the serial monitor? Ideally, all my data will go to the card and I'll only need the serial monitor for initial prototyping and debugging.

Thanks again!

rednifhtaP
 
Posts: 6
Joined: Sat Jun 13, 2020 3:23 pm

Re: Metro M4 Express with Ultimate GPS Shield

by adafruit_support_carter on Tue Jul 07, 2020 4:08 pm

Yeah! Glad that was it.

Yep, you'll still need that connection for SD logging. The GPS uses UART (serial), but the SD card is over SPI. The SD card is not directly connected to the GPS module. So SD logging is essentially:
(1) Read GPS via serial
(2) Write to SD over SPI
all of which is done via your sketch software. Checkout this example sketch for SD logging:
https://github.com/adafruit/Adafruit_GP ... _sdlog.ino

adafruit_support_carter
 
Posts: 16820
Joined: Tue Nov 29, 2016 2:45 pm

Re: Metro M4 Express with Ultimate GPS Shield

by rednifhtaP on Tue Jul 07, 2020 4:13 pm

Sounds good! Thank you so much. I'll look in to that soon, but it shouldn't be an issue from here.

Adafruit rocks!

rednifhtaP
 
Posts: 6
Joined: Sat Jun 13, 2020 3:23 pm

Please be positive and constructive with your questions and comments.