Adafruit Ultimate GPS Breakout

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Adafruit Ultimate GPS Breakout

Post by wfitkin »

I have an PID: 5440 Adafruit Ultimate GPS Breakout.
Antenna Status remains at "0" despite using an external antenna.
"tft.print("Antenna status: "); tft.println((int)GPS.antenna);" this only outputs a zero even though it is typed exactly as shown in the GPS_HardwareSerial_Parsing example given with the Adafruit GPS Library
Adafruit5440.jpg
Adafruit5440.jpg (100.28 KiB) Viewed 360 times
Adafruit part numbers...
PID: 851 SMA to uFL/u.FL/IPX/IPEX RF Adapter Cable and...
PID: 860 GPS Antenna - External Active Antenna - 3-5V 28dB 5 Meter
Using the following code...

Code: Select all


#include <Adafruit_GPS.h>
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

// For the Adafruit shield, these are the default.
#define TFT_DC 9
#define TFT_CS 10
#define TFT_RST 8


Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);

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

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 parsing test!");

  tft.begin();
  tft.fillScreen(ILI9341_BLUE);
  tft.setRotation(2);

  // 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.print(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) {
    tft.setTextSize(2);
    tft.setTextColor(ILI9341_WHITE, ILI9341_BLUE);
    tft.setCursor(1, 1);
      tft.println("Location: ");
      tft.print(GPS.latitude, 4); tft.println(GPS.lat);
      tft.print(GPS.longitude, 4); tft.println(GPS.lon);
      tft.print("Speed (knots): "); tft.println(GPS.speed);
      tft.print("Angle: "); tft.println(GPS.angle);
      tft.print("Altitude: "); tft.println(GPS.altitude);
      tft.print("Satellites: "); tft.println((int)GPS.satellites);
      tft.print("Antenna status: "); tft.println((int)GPS.antenna);
    }
  }
}

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit Ultimate GPS Breakout

Post by adafruit_support_mike »

Try printing the raw NMEA sentences and see what those say.

I'm inclined to think it's a parsing glitch. The display above shows the module reporting 9 satellites in view, so it's obviously using one antenna or the other.

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit Ultimate GPS Breakout

Post by wfitkin »

Here is the raw data coming from the GPS

Time: 05:18:11.000
Date: 27/8/2022
Fix: 1 quality: 2
$GPGGA,051812.000,3353.8284,N,11745.8889,W,2,07,1.04,200.6,M,-33.6,M,,*58
$GPGGA,051812.000,3353.8284,N,11745.8889,W,2,07,1.04,200.6,M,-33.6,M,,*58
$GPRMC,051812.000,A,3353.8284,N,11745.8889,W,0.10,344.70,270822,,,D*79
$GPRMC,051812.000,A,3353.8284,N,11745.8889,W,0.10,344.70,270822,,,D*79
$GPGGA,051813.000,3353.8284,N,11745.8888,W,2,07,1.04,200.6,M,-33.6,M,,*58
$GPGGA,051813.000,3353.8284,N,11745.8888,W,2,07,1.04,200.6,M,-33.6,M,,*58
$GPRMC,051813.000,A,3353.8284,N,11745.8888,W,0.15,344.70,270822,,,D*7C
$GPRMC,051813.000,A,3353.8284,N,11745.8888,W,0.15,344.70,270822,,,D*7C

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit Ultimate GPS Breakout

Post by adafruit_support_mike »

It looks like you need another NMEA sentence. Information about the antenna comes from the $PGTOP sentence:

https://github.com/adafruit/Adafruit_GP ... #L176-L184

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit Ultimate GPS Breakout

Post by wfitkin »

800 lines of code to sift through really doesn't help.
All the parts are genuine Adafruit parts using Adafruit's example code.
Nothing done wrong on my end. It just doesn't work. Can't tell if I am on the internal antenna or the external one.
What line of code to I have to add to get that sentence?

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit Ultimate GPS Breakout

Post by adafruit_support_mike »

You seem to be unclear on the distinction between 'programmable hardware' and 'turnkey solutions'.

Turnkey solutions provide functionality with little or no understanding of how they work, but usually provide no way to change the functionality. To the extent that they do allow modification, it tends to be a menu of preselected options. The user's control amounts to choosing a subset of the available options.

Programmable hardware provides a greater level of control over the system's functionality, but that power comes at the price of a learning curve.

We sell programmable hardware. Our libraries provide base-level functionality for the sake of convenience. Our example code makes it easier for people to get a device to an initial working condition which can then be modified. We also provide support in these forums to help people as they learn. The existence of those resources doesn't eliminate the need to learn the hardware and code though.


In this case, the code to get an antenna value lives in one of the examples:

Code: Select all

  GPS.sendCommand(PGCMD_ANTENNA);
https://github.com/adafruit/Adafruit_GP ... ng.ino#L55

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit Ultimate GPS Breakout

Post by wfitkin »

If you look at my code I already provided to you will see that I already have the following in my code.

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

The problem I have is not a lack of understanding. The code and hardware does not work as advertised.
You could be less demeaning and more helpful. I do spend a lot of money at Adafruit.com

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit Ultimate GPS Breakout

Post by wfitkin »

I have been completely through the entire tutorial for this breakout by Lady Ada. I have followed it exactly using only the parts recommended by Lady Ada. Despite that I have no way to tell what antenna it is using because this command taken from the example sketch only produces a zero and never anything else.
tft.println((int)GPS.antenna);
I am using the Adafruit provided example "GPS_HardwareSerial_Parsing". Even when used exactly as is without any changes the antenna output command still produces nothing but a zero.

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit Ultimate GPS Breakout

Post by adafruit_support_mike »

What return value do you get from the

Code: Select all

GPS.sendCommand(PGCMD_ANTENNA);
command?

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit Ultimate GPS Breakout

Post by wfitkin »

Looks like nothing is returned that starts with $PGTOP

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit Ultimate GPS Breakout

Post by adafruit_support_mike »

Try sending the command:

Code: Select all

$CDCMD,33,1*7C<CRLF>

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit Ultimate GPS Breakout

Post by wfitkin »

I aded this line...
GPS.sendCommand($CDCMD,33,1*7C<CRLF>);
I get this error...
'$CDCMD' was not declared in this scope

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit Ultimate GPS Breakout

Post by adafruit_support_mike »

You need to quote the string, and the GPS library will add the carriage-return/linefeed characters when sending the string to the GPS module:

Code: Select all

GPS.sendCommand( "$CDCMD,33,1*7C" );

User avatar
lilmikey101
 
Posts: 1
Joined: Fri Sep 16, 2022 2:51 am

Re: Adafruit Ultimate GPS Breakout

Post by lilmikey101 »

Code: Select all

GPS.sendCommand( "$CDCMD,33,1*7C" );
works but on the newer version of the Ultimate GPS you will see $PCD,11,1*66 and not $PGTOP

I'm was having a similar issue and I found the answer in this thread.

viewtopic.php?p=892632&hilit=pgtop#p892632
https://cdn-shop.adafruit.com/product-f ... asheet.pdf

Code: Select all

PCD—Status of antenna
Table-13 contains the values for the following list:
$PCD,11,value*checksum
Example:
$PCD,11,1 *66 $PCD,11,2 *65 $PCD,11,3 *64
Value: 1=> Using Internal Antenna
 2=> Using Active Antenna
 3=> Active Antenna Shorted
I may try to submit a change to https://github.com/adafruit/Adafruit_GPS and also see if suggestions to update the documentation to account for both cases would be done https://learn.adafruit.com/adafruit-ult ... al-antenna. As of 2021 adafruit is not shipping the old chip.

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit Ultimate GPS Breakout

Post by adafruit_support_carter »

Looks worth opening a new issue here:
https://github.com/adafruit/Adafruit_GPS/issues
as well to document and track this. Can someone here on this thread do that?

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

Return to “Other Products from Adafruit”