NEO 6M GPS module gets a fix, but no useful output

Hello everyone,
I am new to using a GPS, so it might be possible I just made a really stupid mistake, but I tried everything I've found online and nothing works... I'm clueless.

I have been trying to get my GPS to give (useful) output, but the best I got is showed in the following picture:
![](https://i.imgur.com/DBQepM0.png

The code I used is the 'FullExample' from the TinyGPS++:

#include <TinyGPS++.h>
#include <SoftwareSerial.h>
/*
   This sample code demonstrates the normal use of a TinyGPS++ (TinyGPSPlus) object.
   It requires the use of SoftwareSerial, and assumes that you have a
   4800-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
*/
static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object
TinyGPSPlus gps;

// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);

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

  Serial.println(F("FullExample.ino"));
  Serial.println(F("An extensive example of many interesting TinyGPS++ features"));
  Serial.print(F("Testing TinyGPS++ library v. ")); Serial.println(TinyGPSPlus::libraryVersion());
  Serial.println(F("by Mikal Hart"));
  Serial.println();
  Serial.println(F("Sats HDOP  Latitude   Longitude   Fix  Date       Time     Date Alt    Course Speed Card  Distance Course Card  Chars Sentences Checksum"));
  Serial.println(F("           (deg)      (deg)       Age                      Age  (m)    --- from GPS ----  ---- to London  ----  RX    RX        Fail"));
  Serial.println(F("----------------------------------------------------------------------------------------------------------------------------------------"));
}

void loop()
{
  static const double LONDON_LAT = 51.508131, LONDON_LON = -0.128002;

  printInt(gps.satellites.value(), gps.satellites.isValid(), 5);
  printFloat(gps.hdop.hdop(), gps.hdop.isValid(), 6, 1);
  printFloat(gps.location.lat(), gps.location.isValid(), 11, 6);
  printFloat(gps.location.lng(), gps.location.isValid(), 12, 6);
  printInt(gps.location.age(), gps.location.isValid(), 5);
  printDateTime(gps.date, gps.time);
  printFloat(gps.altitude.meters(), gps.altitude.isValid(), 7, 2);
  printFloat(gps.course.deg(), gps.course.isValid(), 7, 2);
  printFloat(gps.speed.kmph(), gps.speed.isValid(), 6, 2);
  printStr(gps.course.isValid() ? TinyGPSPlus::cardinal(gps.course.deg()) : "*** ", 6);

  unsigned long distanceKmToLondon =
    (unsigned long)TinyGPSPlus::distanceBetween(
      gps.location.lat(),
      gps.location.lng(),
      LONDON_LAT, 
      LONDON_LON) / 1000;
  printInt(distanceKmToLondon, gps.location.isValid(), 9);

  double courseToLondon =
    TinyGPSPlus::courseTo(
      gps.location.lat(),
      gps.location.lng(),
      LONDON_LAT, 
      LONDON_LON);

  printFloat(courseToLondon, gps.location.isValid(), 7, 2);

  const char *cardinalToLondon = TinyGPSPlus::cardinal(courseToLondon);

  printStr(gps.location.isValid() ? cardinalToLondon : "*** ", 6);

  printInt(gps.charsProcessed(), true, 6);
  printInt(gps.sentencesWithFix(), true, 10);
  printInt(gps.failedChecksum(), true, 9);
  Serial.println();
  
  smartDelay(1000);

  if (millis() > 5000 && gps.charsProcessed() < 10)
    Serial.println(F("No GPS data received: check wiring"));
}

// This custom version of delay() ensures that the gps object
// is being "fed".
static void smartDelay(unsigned long ms)
{
  unsigned long start = millis();
  do 
  {
    while (ss.available())
      gps.encode(ss.read());
  } while (millis() - start < ms);
}

static void printFloat(float val, bool valid, int len, int prec)
{
  if (!valid)
  {
    while (len-- > 1)
      Serial.print('*');
    Serial.print(' ');
  }
  else
  {
    Serial.print(val, prec);
    int vi = abs((int)val);
    int flen = prec + (val < 0.0 ? 2 : 1); // . and -
    flen += vi >= 1000 ? 4 : vi >= 100 ? 3 : vi >= 10 ? 2 : 1;
    for (int i=flen; i<len; ++i)
      Serial.print(' ');
  }
  smartDelay(0);
}

static void printInt(unsigned long val, bool valid, int len)
{
  char sz[32] = "*****************";
  if (valid)
    sprintf(sz, "%ld", val);
  sz[len] = 0;
  for (int i=strlen(sz); i<len; ++i)
    sz[i] = ' ';
  if (len > 0) 
    sz[len-1] = ' ';
  Serial.print(sz);
  smartDelay(0);
}

static void printDateTime(TinyGPSDate &d, TinyGPSTime &t)
{
  if (!d.isValid())
  {
    Serial.print(F("********** "));
  }
  else
  {
    char sz[32];
    sprintf(sz, "%02d/%02d/%02d ", d.month(), d.day(), d.year());
    Serial.print(sz);
  }
  
  if (!t.isValid())
  {
    Serial.print(F("******** "));
  }
  else
  {
    char sz[32];
    sprintf(sz, "%02d:%02d:%02d ", t.hour(), t.minute(), t.second());
    Serial.print(sz);
  }

  printInt(d.age(), d.isValid(), 5);
  smartDelay(0);
}

static void printStr(const char *str, int len)
{
  int slen = strlen(str);
  for (int i=0; i<len; ++i)
    Serial.print(i<slen ? str[i] : ' ');
  smartDelay(0);
}

The only two things I changed are the GPSBaud (first 4800, now 9600), and the Serial.begin (first 115200, now 9600)

If I run the code, the GPS module blinks the blue LED about every second

I made the following connections:
Arduino GPS Module(NEO 6M)
5V VCC
D4 RX
D3 TX
GND GND

I tried to give all the information you might need, but if something is still unclear, please tell me.)

A simpler test would be to echo whatever you receive from the GPS to serial. No point using TinyGPS until you establish that you're getting good data.

Try something like this echo program:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); //(RX, TX) check correct pin assignments.

void setup() {
  mySerial.begin(9600);
  Serial.begin(9600);
  Serial.println("GPS start");
}

void loop() {
  while (mySerial.available()) {
    Serial.print(mySerial.read());
  }
}

you do know that TX on the board goes to RX on the module, and RX on the board goes to TX on the module...

Thanks wildbill and jremington for the tip! I will try it!
Thanks Geek Emeritus, but yes, I already know.
I'll let you know this afternoon if I found something.

Okay, it took a little longer, but with the code you guys gave me, I didn't get any output at all... Just a 'GPS Start'
Hope someone knows anything else I can try...

In your OP, you have RX to RX and TX to TX which as Geek Emeritus points out, won't work. Did you do the same thing with the simpler echo code? Even if you think you have them right, turn it off and swap them over for another try.

a thing you may not know: you can shut off a block of code by putting

/*

at the beginning of the code, and

*/

at the end. this can make the compiler overlook brackets after the switched off section.

you can switch off one line, or the remainder of a line, with //

switch off everything after void loop() and substitute this:

{
  while (GPS.available())                              // look for data from GPS module
  {
     char c = GPS.read();  
     Serial.print(c);                                       // read in all available chars   
     gps.encode(c);                                     // and feed chars to GPS parser
  }  
}

and print the results here.

Thanks, Geek Emeritus,
I tried it, but I got an error...
The code I used is:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); //(RX, TX) check correct pin assignments.

void setup() {
mySerial.begin(9600);
Serial.begin(9600);
Serial.println("GPS start");
}

void loop() {
/*
while (mySerial.available()) {
Serial.print(mySerial.read());
}
*/

while (GPS.available()) // look for data from GPS module
{
char c = GPS.read();
Serial.print(c); // read in all available chars
gps.encode(c); // and feed chars to GPS parser
}
}
}

At line 18 (start of the while loop), I get the following error:
"'GPS' was not declared in this scope"
I tried including TinyGPS++ and creating a GPS object, but that wasn't the solution...

Can you please tell me what I'm doing wrong?

tweeijsbeer:
At line 18 (start of the while loop), I get the following error:
"'GPS' was not declared in this scope"
I tried including TinyGPS++ and creating a GPS object, but that wasn't the solution...

Can you please tell me what I'm doing wrong?

Rather than GPS, you have declared your softwareSerial instance that talks to the physical gps as mySerial. Either rename it or change your read to use mySerial.

You're using encode from the tiny serial library, so you will indeed need to include it too.

Hi. Have you made sure that the NEO-6M GPS module is outputting at 4800 bps? The default baudrate is 9600 bps. Might want to have a go at this baudrate first.

Hi,

NEO6M outputs at 9 600, so your settings seems to be right.

Can you copy your code with your actual pin assignments ?

Also: for a cold start, on a clear outside environment, it can take as long as 5 minutes to get a fix.

But even without a fix you should get NMEA frames.

Alex

AlexBZH:
Also: for a cold start, on a clear outside environment, it can take as long as 5 minutes to get a fix.

A cold start first fix time of 5 minutes is indicative of a GPS with a poor antenna or one in a poor location.

With a decent antenna and in a good location expect cold start first fix time to be between 35 and 60 seconds.