Adafruit Ultimate GPS FeatherWing MTK3339

This is a special forum devoted to educators using Adafruit and Arduino products for teaching.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
JoanCS
 
Posts: 55
Joined: Thu May 07, 2020 12:43 pm

Adafruit Ultimate GPS FeatherWing MTK3339

Post by JoanCS »

Good morning. In reading longitude and latitude, they have an incorrect reading. It returns the latitude to me with 5 digits !!!
What is my mistake?
Is it normal for speed not to mark me zero?

Location: 41514.2148N ??????

Time: 11:01:42.41520
Date: 20/5/2020
Fix: 1 quality: 1
Location: 41514.2148N, 214.3565E
Speed (knots): 0.27
Speed (Km/h): 0.50
Angle: 331.60
Altitude: 564.90
Satellites: 8

User avatar
JoanCS
 
Posts: 55
Joined: Thu May 07, 2020 12:43 pm

Re: Adafruit Ultimate GPS FeatherWing MTK3339

Post by JoanCS »

Good afternoon.
I can't figure out how to fix this. It happens to me both in latitude and in longitude.
He may be doing the readings well for a good while and suddenly he starts making some misreadings.
Any idea how I can fix it?
thanks.

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Ultimate GPS FeatherWing MTK3339

Post by adafruit_support_bill »

Which Feather are you using this with?
Can you post some more data - showing both good and bad readings?

User avatar
JoanCS
 
Posts: 55
Joined: Thu May 07, 2020 12:43 pm

Re: Adafruit Ultimate GPS FeatherWing MTK3339

Post by JoanCS »

Attached is an image of two misreadings but I have already treated them with software.

Also the piece of code I use to do the reading. Where I already discard the erroneous LAT but not the erroneous LON.

Data is already coming in wrong from GPS. There are some ways to get the coordinates in format
GD (decimal degrees) directly from GPS?

Code: Select all

 char c = GPS.read();
  
  if (GPS.newNMEAreceived()) 
  {
    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() - timer > 2000) {
    timer = millis(); // reset the timer
    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.println("GPS --------->");    
      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);
      LAT = 0;   //LAT = 4151.2124;  //Ausate
      LON = 0;   //LON = 214.3523;
      LAT = GPS.latitude;
      if ((int)GPS.fixquality < 2 )
        {
        goto Error;  
        }
      if (LAT > 8999)   //ERROR DE LAT ????????
        {
        LAT=4151.1962;
        goto Error;
        }  
      LON = GPS.longitude;
      ftoa(strLat,LAT, 4);
      ftoa(strLon,LON, 4);
      LatLon=1; 
      if (GPS.lat = "N" )  //LAT N
        {  
        LatconvertMinSecDeg(strLat,0);
        }
      else 
        {
        LatconvertMinSecDeg(strLat,1);  //LAT S      
        }
      LatLon=2; 
      if (GPS.lon = "S")  //LON 
        { 
        LatconvertMinSecDeg(strLon,0);    
        }
      else 
        {  
        LatconvertMinSecDeg(strLon,1);  //LON W
        }
  }
Attachments
lecturesERROR GPS.png
lecturesERROR GPS.png (6.67 KiB) Viewed 1480 times

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Ultimate GPS FeatherWing MTK3339

Post by adafruit_support_bill »

Which Feather are you using this with?

Please post some of the raw NMEA sentences - without any parsing or conversion.

User avatar
JoanCS
 
Posts: 55
Joined: Thu May 07, 2020 12:43 pm

Re: Adafruit Ultimate GPS FeatherWing MTK3339

Post by JoanCS »

Model:
Adafruit Ultimate GPS FeatherWing MTK3339


Ultimate GPS FeatherWing)
NMEA -->
$PGTOP,11,2*6E
$GPGGA,162518.000,41515.2147,N,00214.3828,E,2,03,2.33,613.4,M,51.1,M,0000,0000*65
$GPRMC,162518.000,A,41515.2147,N,00214.3828,E,0.64,187.65,280520,,,D*67
Attachments
LecturaK02.JPG
LecturaK02.JPG (38.75 KiB) Viewed 1537 times
Last edited by JoanCS on Thu May 28, 2020 12:31 pm, edited 1 time in total.

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Ultimate GPS FeatherWing MTK3339

Post by adafruit_support_bill »

Model:
Adafruit Ultimate GPS FeatherWing MTK3339
That is just the GPS wing. What processor are you using to read and parse the data from it?

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Ultimate GPS FeatherWing MTK3339

Post by adafruit_support_bill »

NMEA --> exemple:
$GPRMC,194509.000,A,4042.6142,N,07400.4168,W,2.03,221.11,160412,,,A*77
Please post more raw readings - showing both good and bad data.

User avatar
JoanCS
 
Posts: 55
Joined: Thu May 07, 2020 12:43 pm

Re: Adafruit Ultimate GPS FeatherWing MTK3339

Post by JoanCS »

Adafruit Feather con microcontrolador ATMega32U4 y módulo GSM FONA SIM800
and
Adafruit Ultimate GPS FeatherWing MTK3339
I have it connected to an 18000m Lipo battery

Strange things are happening to me. From time to time it is prescribed, etc ..
I am trying to match GPS data with good data and errors.

Now I can't get it to fail !!!

$PGTOP,11,2*6E
$GPGGA,165236.000,4151.2125,N,00214.3634,E,1,08,1.12,616.2,M,51.1,M,,*65
$GPRMC,165236.000,A,4151.2125,N,00214.3634,E,0.29,14.84,280520,,,A*54
$PGTOP,11,2*6E
$GPGGA,165237.000,4151.2124,N,00214.3637,E,1,08,1.12,616.2,M,51.1,M,,*66
$GPRMC,165237.000,A,4151.2124,N,00214.3637,E,0.24,39.57,280520,,,A*5B

User avatar
Josh_1
 
Posts: 4
Joined: Thu May 28, 2020 12:31 pm

Re: Adafruit Ultimate GPS FeatherWing MTK3339

Post by Josh_1 »

Hello,
I'm working with the same project as @JoanCS. With a 100km between his prototype and mine. And I'm having the same issues.
We are using: Adafruit Ultimate GPS featherwing, plugged on Adafruit Feather 32u4 FONA. I have my own both Feathers and @JoanCS have his own both Feathers.

The base of our porgram is tooked from (https://learn.adafruit.com/adafruit-ult ... no-library) and I think the problem is inside the library Adafruit_GPS→GPS_HardwareSerial_Parsing. Because the RAW NMEA sentences are correct but not the library convertion values.
Here the example wich I tooked 10 mins ago:
RAW_values.PNG
RAW_values.PNG (89.17 KiB) Viewed 1745 times

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Ultimate GPS FeatherWing MTK3339

Post by adafruit_support_bill »

Thank you for the additional information. I agree, it looks like the NMEA sentences appear to be getting parsed incorrectly.

Are you using the hardware serial or software serial to talk to the module?
Does your program also communicate with the FONA module - or are you just reading GPS data?

User avatar
JoanCS
 
Posts: 55
Joined: Thu May 07, 2020 12:43 pm

Re: Adafruit Ultimate GPS FeatherWing MTK3339

Post by JoanCS »

My program communicates with FONA and GPS.

I start to have doubts if I chose the right material. There are times when I think communications get mixed up. But it is an intuition.

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Ultimate GPS FeatherWing MTK3339

Post by adafruit_support_bill »

I suspect that some characters are getting dropped on the serial port when you are communicating with the FONA. The FONA communicates via SoftwareSerial and will disable interrupts while processing received characters. This can cause characters from the GPS to be dropped - resulting in a corrupted NMEA sentence.

User avatar
JoanCS
 
Posts: 55
Joined: Thu May 07, 2020 12:43 pm

Re: Adafruit Ultimate GPS FeatherWing MTK3339

Post by JoanCS »

What solution can I apply?

Is there any way for the GPS to return the data to me in my format? decimal degrees?

User avatar
Josh_1
 
Posts: 4
Joined: Thu May 28, 2020 12:31 pm

Re: Adafruit Ultimate GPS FeatherWing MTK3339

Post by Josh_1 »

adafruit_support_bill wrote:Thank you for the additional information. I agree, it looks like the NMEA sentences appear to be getting parsed incorrectly.

Are you using the hardware serial or software serial to talk to the module?
Does your program also communicate with the FONA module - or are you just reading GPS data?
Hello, your welcome for your fast responses.
We are using the HardwareSerial, the Serial1 to receive the information.
Related with the question: Does your program also communicate with the FONA module - or are you just reading GPS data?: We are just takeing the procesed information of the library and with this information we are doing some conversions of values to adapt on our sistem and after that build and URL to upload the values on a server via AT BANNED.
Let me point that we are not working with raw NMEA cuz how we had the Adafruit library wich that break them into separate parts and makes our job easier. But we saw this problem that more than the 50% of readings on Latitude or Longitude apears an extra value. And all time apears in the same position. I mean if the Raw Latitude is 4444.4444N the random extra digit apears all times before point, 4444X.4444N, being the other numbers correct.

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

Return to “For Educators”