TinyGPS Sentences=0

I am running a little serial debug code to make sure that my GPS is working correctly, see code

#include <SoftwareSerial.h>

#include <TinyGPS.h>

/* This sample code demonstrates the normal use of a TinyGPS object.
It requires the use of SoftwareSerial, and assumes that you have a
4800-baud serial GPS device hooked up on pins 3(rx) and 4(tx).
*/

TinyGPS gps;
SoftwareSerial ss(2, 3);

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

Serial.print("Simple TinyGPS library v. "); Serial.println(TinyGPS::library_version());
Serial.println("by Mikal Hart");
Serial.println();
}

void loop()
{
bool newData = false;
unsigned long chars;
unsigned short sentences, failed;

// For one second we parse GPS data and report some key values
for (unsigned long start = millis(); millis() - start < 1000;)
{
while (ss.available())
{
char c = ss.read();
Serial.write(c); // uncomment this line if you want to see the GPS data flowing
if (gps.encode(c)) // Did a new valid sentence come in?
newData = true;
}
}

if (newData)
{
float flat, flon;
unsigned long age;
gps.f_get_position(&flat, &flon, &age);
Serial.print("LAT=");
Serial.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);
Serial.print(" LON=");
Serial.print(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);
Serial.print(" SAT=");
Serial.print(gps.satellites() == TinyGPS::GPS_INVALID_SATELLITES ? 0 : gps.satellites());
Serial.print(" PREC=");
Serial.print(gps.hdop() == TinyGPS::GPS_INVALID_HDOP ? 0 : gps.hdop());
}
 
gps.stats(&chars, &sentences, &failed);
Serial.print(" CHARS=");
Serial.print(chars);
Serial.print(" SENTENCES=");
Serial.print(sentences);
Serial.print(" CSUM ERR=");
Serial.println(failed);
}

GPS baud is 9600 (matching the documentation) I can pull up a serial monitor and get…
CHARS=2203 SENTENCES=0 CSUM ERR=0
CHARS=2203 SENTENCES=0 CSUM ERR=0
CHARS=2203 SENTENCES=0 CSUM ERR=0
CHARS=2203 SENTENCES=0 CSUM ERR=0
CHARS=2203 SENTENCES=0 CSUM ERR=0
CHARS=2335 SENTENCES=0 CSUM ERR=0
CHARS=2491 SENTENCES=0 CSUM ERR=0
CHARS=2639 SENTENCES=0 CSUM ERR=0
CHARS=3042 SENTENCES=0 CSUM ERR=0
CHARS=3206 SENTENCES=0 CSUM ERR=0
CHARS=3370 SENTENCES=0 CSUM ERR=0
CHARS=3535 SENTENCES=0 CSUM ERR=0
CHARS=3698 SENTENCES=0 CSUM ERR=0

So a take a closer look by uncommenting Serial.write(c) and this is the NMEA data I get from the GPS

 CHARS=9350 SENTENCES=0 CSUM ERR=0
$GPGGA,210922.944,4521.5XXX,N,12235.1XXX,W,0,00,,65.6,M,-19.5,M,,0000*7F
$GPRMC,210922.944,V,4521.5XXX,N,12235.1XXX,W,,,050617,,,N*6A
$GPVTG,,T,,M,,N,,K,N*2C
 CHARS=9511 SENTENCES=0 CSUM ERR=0
$GPGGA,210923.944,4521.5XXX,N,12235.1XXX,W,0,00,,65.6,M,-19.5,M,,0000*7E
$GPRMC,210923.944,V,4521.5XXX,N,12235.1XXX,W,,,050617,,,N*6B
$GPVTG,,T,,M,,N,,K,N*2C
 CHARS=9672 SENTENCES=0 CSUM ERR=0
$GPGGA,210924.944,4521.5XXX,N,12235.1XXX,W,0,00,,65.6,M,-19.5,M,,0000*79
$GPRMC,210924.944,V,4521.5XXX,N,12235.1XXX,W,,,050617,,,N*6C
$GPVTG,,T,,M,,N,,K,N*2C
 CHARS=9833 SENTENCES=0 CSUM ERR=0

I am running this outside and I seem to get a GPS fix right away but I can’t figure out why Sentences=0

It's like it isn't recognizing any of those sentences. What sentences is it supposed to recognize?

$GPRMC,210923.944,V,4521.5XXX,N,12235.1XXX,W,,,050617,,,N*6B

RMC sentences are certainly recognized, but the "V" indicates that you don't have a valid fix. The "XXX" fields are also a problem.

You need to see an "A" instead of the "V".

The xxx is just me changing the values for privacy reasons. The lat and longitute values are right on when I checked the via Google maps.

Interesting that I seem to be getting good lat and long numbers but showing not a good fix. Maybe the gps is getting the numbers and then shutting off. Gps is a vk16e vk16e datasheet

The unit might just be reporting the last lat/lon values it had, during a valid fix.

It looks like that library doesn't recognize the $GPxxx as a valid sentence. It normally does, so that's weird. I would normally guess that a character got dropped and the checksum failed, but you aren't getting any checksum errors.

It might be SoftwareSerial; it's the worst library to use for a second serial port (read this and use something else).

You could try the diagnostic program in my NeoGPS library. It shows the raw received data, along with what sentences and fields could be parsed. NeoGPS is smaller, faster, more reliable and more accurate than all other libraries. If you want to try it, NeoGPS and NeoSWSerial are available from the Arduino IDE Library Manager, under the menu Sketch -> Include Library -> Manage Libraries. The example NMEAsimple.ino and NMEAloc.ino are a good place to start. Tabular.ino displays all the pieces in the default configuration.

Cheers, /dev

Something weird with the GPS by the look of it. Its already been pointed out that GPRMC shows an invalid fix, same with GPGGA, invalid fix and zero sats.

You would not excpect TinyGPS++ to process a sentence with an invalid fix.

And as an asside I have used softserial on 8Mhz Pro Minis to read GPSs quite a bit, cant say I recall ever having a problem using for a simple GPS reader.

Try the exact same code with a different type of GPS.

i went ahead and ordered another of the same exact GPS and it works great right away. even got a fix within a minute from inside the building. Not sure what is going on with the 1st one because if i move around the coordinates were lat and long changing like it had a fix. thanks for all the help