Another question to Neo-6M GPS Module [Solved]

Hello together,

I started an Arduino Uno (R3) based project in which I need to get GPS-Coordinates.
So I decided to buy a Neo-6M (from AZ-Delivery).
It's the first time I'm using GPS in a project so my knowledge is based on datasheets and google.

I already looked into many forum posts and tried several approaches but none of them can solve my problem.

I've connected the GPS Module to the Arduino
VCC -> 5V
GND -> GND
Tx -> Pin6

I'm using TinyGPS+ (already tried TinyGPS with no change) and SoftwareSerial.
The Arduino Uno is connected to the PC via USB 2.

When I connect the Tx of the Module to the Tx (Pin 1) of the Arduino and Connect Reset to GND, I get Data, which looks (in my opinion) nearly correct.
By viewing this Data it looks like the Module can't get satelite lock:

$GPRMC,,V,,,,,,,,,,N*53
$GPVTG,,,,,,,,,N*30
$GPGGA,,,,,,0,00,99.99,,,,,,*48
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,1,1,01,17,,,21*7D
$GPGLL,,,,,,V,N*64

When I run the sketch on the Arduino I got this Output:

Start
Data: 36
Data: 80
Data: 77
Data: 44
Data: 86
Data: 44
Data: 44
Data: 44
Data: 44
Data: 44
Data: 42
Data: 51
Data: 10
Data: 71
Data: 86
Data: 71
Data: 44
Data: 44
Data: 44
Data: 44
Data: 78
Data: 51
Data: 13
Data: 36
Data: 80
Data: 71
Data: 44
Data: 44
Data: 44
Data: 48
Data: 48
Data: 44
End

It looks like TiniGPS+ cant't encode the Data it get's from the Module.

I've written the GPS part of my program based on many Codesnippets I've found while googling.

Here's my smallest piece of Code to reproduce the Error:

#define Debug

#ifdef Debug
  #define DebugInit(speed) Serial.begin(speed);
  #define DebugPrintLn(txt) Serial.println(txt);
  #define DebugPrint(txt) Serial.print(F(txt));
  #define DebugPrintValueDecimal(val) Serial.print(val, DEC);
  #define DebugValuePrintLn(txt, val) Serial.print(F(txt)); Serial.print(F(": ")); Serial.println(val);
#else
  #define DebugInit(speed) 
  #define DebugPrinLn(txt) 
  #define DebugValuePrintLn(txt, val) 
#endif

#include <SoftwareSerial.h>
#include <TinyGPS++.h>




uint32_t gpsBaud = 9600;

SoftwareSerial swsrl(6, 255);
TinyGPSPlus gps;

void setup() 
{  
  Serial.begin(9600);
  
  swsrl.begin(gpsBaud);
}

void loop() 
{
  GpsReceiver();  
}


void GpsReceiver()
{
  DebugPrintLn("Start");

  while(swsrl.available() > 0)
  {
    Serial.print("Data: ");
    Serial.println(swsrl.read());
	
	
    if(gps.encode(swsrl.read()))
    {
      Serial.println("True");

      float lat, lon;

      lat = gps.location.lat();
      lon = gps.location.lng();

      Serial.print(lat); 
      Serial.print("   ");
      Serial.println(lon);
    }
  } 
  
  DebugPrintLn("End");
  delay(3000);
}

And I know that the macro isn't necessary here but for my entire code it is.

I've made sure that the Serial Monitor of the IDE runs on 9600 Baud.

Is it possible that this error occurs because of the missing GPS lock?
Or is there something wrong in my code?

I'm not sure why the Module doesn't lock.
I've bought it a few days ago.
The LED of the Module isn't flashing either so I think it also has a problem.

Just to say before someone asks:
Yes it had direct view to the sky for the last 6 hours. (I was sitting in the garden.)

Edit:
My Error is now solved.
I've bought a new Neo-6M GPS Modul.

At first I got the same wrong Data that can't be encoded by TinyGPS.
But as soon as the Module got response from GPS, the encoding worked and the Data looks alright.

So thanks for your advices and help.

If would be better if You provided a wiring diagram. I don't draw it out of Your Words.
I'll supply my code for a speedometer project. There You can find how to read GPS data,

GPS_LCD_200229_auto_summer_time.ino (12.2 KB)

    Serial.print("Data: ");
    Serial.println(swsrl.read());

    if(gps.encode(swsrl.read()))

You are reading a character, printing that character (in decimal because .read() returns an 'int') and then trying to read a DIFFERENT character to give to the GPS library. The library gets, at best, only half the characters in each message! No wonder it doesn't recognize any valid sentences.

hurahagl:
By viewing this Data it looks like the Module can't get satelite lock:

Yes it had direct view to the sky for the last 6 hours. (I was sitting in the garden.)

If the GPS really is outdoors with a good view of the Sky and if the output you posted from the GPS is correct, then the GPS or its antenna is defective.

Plain and simple. No amount of cunning wheeze software will fix the issue.

Thanks for your replies.

@Railroader: I've attached a small wiring diagram so you can see it's quite simple.

@johnwasser: Oh, I didn't pay attention to that when I was implementing the print for debugging purposes.

Thanks for pointing this out.

So it looks like the main cause of my problem is (like srnet pointet out) an defective GPS module.
So I'll try a new one.

Thanks for your help.

hurahagl:
So it looks like the main cause of my problem is (like srnet pointet out) an defective GPS module.
So I'll try a new one.

Hi.

Congratulations on going so far using your self reliance. Good to see you making use of the forum discussions.

But it's too soon to declare the GPS faulty.

Can you post a photo of your setup?

John.