Arduino UNO and ITEAD GPS No

I have compiled and uploaded the following code and monitored the output from the GPS via the Serial Monitor. The GPS antenna is outside and has good sky access. I can see on teh Serial Monitor that the LAT and LONG contained in the GPS data is correct for my location but the system never gets to the point where newData is set TRUE:

#include <TinyGPS.h>

#include <SoftwareSerial.h>

#define RXPIN 6
#define TXPIN 7

TinyGPS gps;
SoftwareSerial ss = SoftwareSerial(RXPIN, TXPIN); // Aqui é feito o instanciamento, ou seja, atribuimos a comunicação serial denominada de  ss (poderia ser gps, minhaporta ou qualquer outra palavra) para as portas 3 e 4.

void setup()
{
  Serial.begin(115200); // Aqui é a velocidade de transmissão entre o Arduino e o PC é de 115200 bps.
  Serial.print("Simple TinyGPS library v. "); Serial.println(TinyGPS::library_version()); //só perfumaria...e os devidos //créditos do autor
  Serial.println("by Mikal Hart");
  Serial.println();
  pinMode(RXPIN, INPUT);
  pinMode(TXPIN, OUTPUT); 
  ss.begin(38400);
}

void loop() //loop principal. Os comentários do autor ajudam a entender.
{
  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);
}

The Serial Monitor Output is shown in the attached file.

Can anyone help please?

if (gps.encode(c)) // Did a new valid sentence come in?
newData = true;

Obviously your not getting in a valid sentence, does gps.encode(c) need the full string first then see if it is valid, or can it accept individual chars?

It looks like all your longer sentences are being truncated, possibly 1 second is not long enough to receive a full sentence?

I would take the GPS reading out of the 1-second limit loop:

void loop() //loop principal. Os comentários do autor ajudam a entender.
{
  static bool newData = false;
  unsigned long chars;
  unsigned short sentences, failed;
  unsigned long currentTime = millis();
  static unsigned long lastTimeOfLocation;
  static unsigned long lastTimeOfStatistics;

  if  (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?
      if (currentTime - lastTimeOfLocation >= 1000) { // Has it been a second

        float flat, flon;
        unsigned long age;
        lastTimeOfLocation = currentTime;
        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());
      }
  }

  // Display statistics every second
  if (currentTime - lastTimeOfStatistics >= 1000) {
    lastTimeOfStatistics = currentTime
      gps.stats(&chars, &sentences, &failed);
    Serial.print(" CHARS=");
    Serial.print(chars);
    Serial.print(" SENTENCES=");
    Serial.print(sentences);
    Serial.print(" CSUM ERR=");
    Serial.println(failed);
  }
}

Thanks for the tip johnwasser. I tried your code but with pretty much exactly the same result. The new serial monitor
output is in the attached file again. I am beginning to wonder if the GPS shield is faulty in some way.

Seems to be a problem in the GPS. Looks like it is not generating the checksum properly. The last thing in the sentence is supposed to be :

date,variance,dv*HH

dv is the direction of the variance: E or W
HH is a two hex digit checksum

You are getting endings like:

120714,,,AS
120714,,,A,
120714,,,A2

There is an extra comma, there is no * , and in a few cases the last two characters aren't valid HEX digits.

If you play around with the time ( change 1000 to 800) you will get a newline with each reading the GPS makes. However what I recommend it that you get rid of the for loop and check to see if the next character is a "$" if so create a new line.

I have the same GPS (GPS Shield from ITEAD Studios - http://imall.iteadstudio.com/im120417017.html) and I also cannot get the gps.encode(c) to return true.

#include <TinyGPS.h>

#include <SoftwareSerial.h>

#define RXPIN 6
#define TXPIN 7
TinyGPS gps;
SoftwareSerial ss = SoftwareSerial(RXPIN, TXPIN); // Aqui é feito o instanciamento, ou seja, atribuimos a comunicação serial denominada de  ss (poderia ser gps, minhaporta ou qualquer outra palavra) para as portas 3 e 4.

void setup()
{
  Serial.begin(115200); // Aqui é a velocidade de transmissão entre o Arduino e o PC é de 115200 bps.
  Serial.print("Simple TinyGPS library v. "); Serial.println(TinyGPS::library_version()); //só perfumaria...e os devidos //créditos do autor
  Serial.println("by Mikal Hart");
  Serial.println();
  pinMode(RXPIN, INPUT);
  pinMode(TXPIN, OUTPUT); 
  ss.begin(38400);
}

void loop() //loop principal. Os comentários do autor ajudam a entender.
{
  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;) //change the 1000 to something lower to get better results
//  {
    while (ss.available())
    {
      char c = ss.read();
      
      if ( c == '

) // make a new line every time a new "$" sign is shown.
        Serial.write("\n");
       
       
      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);
}

I seem to remember when I first got my GPS (Neo6M) that I had trouble with reception. I believe solved it by increasing the Software Serial buffer size in SoftwareSerial.h. May not be the answer for you but worked here.

Hey guys, thanks to everyone who was so kind to post their advice. I have changed the buffer size in SoftwareSerial and the code now works as expected.
Next step is to try and get the whole thing woirking in a data acquisition system for a model boat!!
Propeller revs
Current draw
Battery Voltage
Boat speed
etc etc.
At least it will keep me off the streets for a while!

I used a 23LCV1024 SPI SRAM chip to store data from my GPS for later downloading and mapping my route on Google Maps. 128K bytes and can be make non-volatile with a watch battery.

23lcv1024.pdf (680 KB)