Neo-6M problem with Precision, Altitute, Satelites and data on request.

Hi guys, I would like to ask you for help or advice.
I am using Arduino Nano, Neo-6M gps module (with square antena) and TinyGPS++ lib.

And I have 3 issues:
1. when I try to get data from module I am getting data issue (FailedCheckSum), overflowed and dont get any satelites numbers, precision, altitude and etc.
Interesting part is that raw data I can read that I get satellites and precision, but with TinyGPS++ lib. cannot decode them.
(mode in screenshots and code bellow)

2. I would like to ask you how to implement that I will get data just when I ask for them and not everytime in loop.
Strange to explain, but i read that its not good to use delay in case of receiving data from GPS. I know that I cannot use delay in this case because it breaking consistency of data.

  • Want to ask for data,
  • receive them,
  • process them (use just few information), do even another stuff like saving to SD card or what ever.
  • after process, decide when will be next “asking for data” (in one minute, in 5sec, or 1 hour)

3. Do you have any patter or know how, how to check if the module is moving? Check if you move more than 10m±
Like check position, speed and precision. Save it. And after some time (seconds or minutes) check position again and by precision and position check how far it could “move” or if it can be just issue of precision. I guess that if in 5minutes gps say that you are 2km far its not just precision issue but you really move.

Anyone can gave me some advice or give me some hints what I am doing wrong?
Thank you :slight_smile:

Result 1:

  • getting raw data without TInyGps++ lib and get sat and precision.
#include <SoftwareSerial.h>

// The serial connection to the GPS module
SoftwareSerial ss(5, 4);

void setup(){
  Serial.begin(9600);
  ss.begin(9600);
}

void loop(){
  Serial.println("-------------------------------------------------------------------");
  while (ss.available() > 0){
    // get the byte data from the GPS
    byte gpsData = ss.read();
    Serial.write(gpsData);
  }
}

Case1.png

Case1.png

Result 2:

  • using TInyGPS++ lib
  • getting issue with overflowed and check sum fail.
#include <TinyGPS++.h>           // Include TinyGPS++ library
#include <SoftwareSerial.h>      // Include software serial library
 
TinyGPSPlus gps;
 
#define S_RX    5                // Define software serial RX pin
#define S_TX    4                // Define software serial TX pin
 
SoftwareSerial SoftSerial(S_RX, S_TX);    // Configure SoftSerial library
 
void setup(void) 
{
  Serial.begin(9600);
  SoftSerial.begin(9600);  
}

void loop() 
{
  while (SoftSerial.available() > 0) 
  {
    if (gps.encode(SoftSerial.read())) 
    {
      Serial.println("-----------------------------------------");      
      Serial.println("-----------------------------------------");
      Serial.print("Sentences that failed checksum=");
      Serial.println(gps.failedChecksum());
 
      // Testing overflow in SoftwareSerial is sometimes useful too.
      Serial.print("Soft Serial device overflowed? ");
      Serial.println(SoftSerial.overflow() ? "YES!" : "No");
      Serial.println("-----------------------------------------");
      if (gps.location.isValid()) 
      {
        Serial.print("Latitude   = ");
        Serial.println(gps.location.lat(), 6);
        Serial.print("Longitude  = ");
        Serial.println(gps.location.lng(), 6);
      }
      else
        Serial.println("Location Invalid");

      if (gps.altitude.isValid()) 
      {
        Serial.print("Altitude   = ");
        Serial.print(gps.altitude.meters());
        Serial.println(" meters");
      }
      else
        Serial.println("Altitude Invalid");
 
      if (gps.speed.isValid()) 
      {
        Serial.print("Speed      = ");
        Serial.print(gps.speed.kmph());
        Serial.println(" kmph");
      }
      else
        Serial.println("Speed Invalid");

      if (gps.time.isValid()) 
      {
        Serial.print("Time (GMT) : ");
        if(gps.time.hour() < 10)     Serial.print("0");
        Serial.print(gps.time.hour());
        Serial.print(":");
        if(gps.time.minute() < 10)   Serial.print("0");
        Serial.print(gps.time.minute());
        Serial.print(":");
        if(gps.time.second() < 10)   Serial.print("0");
        Serial.println(gps.time.second());
      }
      else
        Serial.println("Time Invalid");

      if (gps.date.isValid()) 
      {
        Serial.print("Date       : ");
        if(gps.date.day() < 10)      Serial.print("0");
        Serial.print(gps.date.day());
        Serial.print("/");
        if(gps.date.month() < 10)    Serial.print("0");
        Serial.print(gps.date.month());
        Serial.print("/");
        Serial.println(gps.date.year());
      }
      else
        Serial.println("Date Invalid");
 
      if (gps.satellites.isValid()) 
      {
        Serial.print("Satellites = ");
        Serial.println(gps.satellites.value());
      }
      else
        Serial.println("Satellites Invalid");  
      
    }
  }
}

Case 3:

  • TinyGps++ lib
  • No check sum fails!
  • Serial is overflowed
#include "TinyGPS++.h"
#include <SoftwareSerial.h>

#define S_RX    5                // Define software serial RX pin
#define S_TX    4                // Define software serial TX pin

TinyGPSPlus gps;
SoftwareSerial SoftSerial(S_RX, S_TX);    // Configure SoftSerial library

void setup() 
{
  Serial.begin(9600);
  SoftSerial.begin(9600);
}

void loop() 
{
  while (SoftSerial.available() > 0)
  {
    gps.encode(SoftSerial.read());

    if (gps.location.isUpdated())
    {
      Serial.println("-----------------------------------------");      
      Serial.println("-----------------------------------------");
      Serial.print("Sentences that failed checksum=");
      Serial.println(gps.failedChecksum());
 
      // Testing overflow in SoftwareSerial is sometimes useful too.
      Serial.print("Soft Serial device overflowed? ");
      Serial.println(SoftSerial.overflow() ? "YES!" : "No");
      Serial.println("-----------------------------------------");
      
      Serial.print("Latitude=");Serial.println(gps.location.lat(), 6); // Latitude in degrees (double)
      Serial.print("Longitude=");Serial.println(gps.location.lng(), 6); // Longitude in degrees (double)
      Serial.print("Altitude=");Serial.println(gps.altitude.meters()); // Altitude
      Serial.print("rawLatNeg=");Serial.println(gps.location.rawLat().negative ? "-" : "+");
      Serial.print("rawLatDeg=");Serial.println(gps.location.rawLat().deg); 
      Serial.print("rawLatBillionths=");Serial.println(gps.location.rawLat().billionths);
      Serial.print("rawLngNegative=");Serial.print(gps.location.rawLng().negative ? "-" : "+");
      Serial.print("rawLngDeg=");Serial.println(gps.location.rawLng().deg);
      Serial.print("rawLngBillionths=");Serial.println(gps.location.rawLng().billionths);
      Serial.print("date.value=");Serial.println(gps.date.value()); 
      Serial.print("date.year=");Serial.println(gps.date.year()); 
      Serial.print("date.month=");Serial.println(gps.date.month()); 
      Serial.print("date.day=");Serial.println(gps.date.day()); 
      Serial.print("time.value=");Serial.println(gps.time.value()); 
      Serial.print("time.hour=");Serial.println(gps.time.hour()); 
      Serial.print("time.minute=");Serial.println(gps.time.minute()); 
      Serial.print("time.second=");Serial.println(gps.time.second());
      Serial.print("time.centisecond=");Serial.println(gps.time.centisecond()); 
      Serial.print("speed.value=");Serial.println(gps.speed.value()); 
      Serial.print("speed.knots=");Serial.println(gps.speed.knots());
      Serial.print("speed.mph=");Serial.println(gps.speed.mph()); 
      Serial.print("speed.mps=");Serial.println(gps.speed.mps()); 
      Serial.print("speed.kmph=");Serial.println(gps.speed.kmph()); 
      Serial.print("course.value=");Serial.println(gps.course.value()); 
      Serial.print("course.de=");Serial.println(gps.course.deg()); 
      Serial.print("altitude.value=");Serial.println(gps.altitude.value()); 
      Serial.print("altitude.meters=");Serial.println(gps.altitude.meters()); 
      Serial.print("altitude.miles=");Serial.println(gps.altitude.miles());
      Serial.print("altitude.kilometers=");Serial.println(gps.altitude.kilometers()); 
      Serial.print("altitude.feet=");Serial.println(gps.altitude.feet()); 
      Serial.print("satellites.value=");Serial.println(gps.satellites.value()); // Satellites
      Serial.print("hdop.value=");Serial.println(gps.hdop.value()); // Horizontal Dim. of Precision (100ths-i32)
      Serial.println("------------------------------------------------------------------------------");
    }
  }
}

case2.png

case2.png

You spend so much time printing useless headings and numbers that software serial can't keep up with the input.

Increase the hardware serial Baud rate to something much higher than 9600 and set the serial monitor Baud rate to match.

  Serial.begin(9600);

Also, all of these text strings are stored in RAM, so you probably don't have much left, and may have memory problems.

      Serial.println("-----------------------------------------");
      Serial.print("Sentences that failed checksum=");

You should be using the F macro to store them in program memory instead, as follows

      Serial.println(F("-----------------------------------------"));
      Serial.print(F("Sentences that failed checksum="));

Yes, I would also suggest that all that use of Serial.print() whilst software serial is running will cause dropped characters from the GSP, hence the sentences with failed checksums.

NeoSWserial is a lot better at coping in that sort of situation than software serial.

There is a description of the problems with softwareserial here;