TinyGPS library not working?

Hello,

I tried connecting this GPS module to the arduino after successfully testing it with an FTDI converter but it won't display the data properly with the arduino trial no idea why...
Have to mention it does display the "GPS start" thing but nothing after that.

Here is the code:

#include "TinyGPS++.h"
#include "SoftwareSerial.h"


#define GPS_UART_RX_PIN 10
#define GPS_UART_TX_PIN 11

SoftwareSerial serial_connection(GPS_UART_RX_PIN,GPS_UART_TX_PIN); //RX=pin 10, TX=pin 11
TinyGPSPlus gps;//This is the GPS object that will pretty much do all the grunt work with the NMEA data
void setup()
{
  Serial.begin(9600);//This opens up communications to the Serial monitor in the Arduino IDE
  serial_connection.begin(9600);//This opens up communications to the GPS
  Serial.println("GPS Start");//Just show to the monitor that the sketch has started
}

void loop()
{
  while(serial_connection.available())//While there are characters to come from the GPS
  {
    gps.encode(serial_connection.read());//This feeds the serial NMEA data into the library one char at a time
  }
  if(gps.location.isUpdated())//This will pretty much be fired all the time anyway but will at least reduce it to only after a package of NMEA data comes in
  {
    //Get the latest info from the gps object which it derived from the data sent by the GPS unit
    Serial.println("Satellite Count:");
    Serial.println(gps.satellites.value());
    Serial.println("Latitude:");
    Serial.println(gps.location.lat(), 6);
    Serial.println("Longitude:");
    Serial.println(gps.location.lng(), 6);
    Serial.println("Speed MPH:");
    Serial.println(gps.speed.mph());
    Serial.println("Altitude Feet:");
    Serial.println(gps.altitude.feet());
    Serial.println("");
  }
}

/*
 * $GPRMC,183729,A,3907.356,N,12102.482,W,000.0,360.0,080301,015.5,E*6F
$GPRMB,A,,,,,,,,,,,,V*71
$GPGGA,183730,3907.356,N,12102.482,W,1,05,1.6,646.4,M,-24.1,M,,*75
$GPGSA,A,3,02,,,07,,09,24,26,,,,,1.6,1.6,1.0*3D
$GPGSV,2,1,08,02,43,088,38,04,42,145,00,05,11,291,00,07,60,043,35*71
$GPGSV,2,2,08,08,02,145,00,09,46,303,47,24,16,178,32,26,18,231,43*77
$PGRME,22.0,M,52.9,M,51.0,M*14
$GPGLL,3907.360,N,12102.481,W,183730,A*33
$PGRMZ,2062,f,3*2D
$PGRMM,WGS 84*06
$GPBOD,,T,,M,,*47
$GPRTE,1,1,c,0*07
$GPRMC,183731,A,3907.482,N,12102.436,W,000.0,360.0,080301,015.5,E*67
$GPRMB,A,,,,,,,,,,,,V*71
*/

and here is a sample from what I got from the FTDI test:

$GPRMC,,V,,,,,,,,,,N*53
$GPVTG,,,,,,,,,N*30
$GPGGA,,,,,,0,00,$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,00*79
$GPGLL,,,,,,V,N*64

Thanks for helping.
Note that a 3.3V logic level arduino is used.

You don't have a satellite fix. Take the setup outdoors, for a clear view of the sky.

If the GPS unit has never had a fix, you may have to wait up to 15 minutes.

The output you are seeing is normal for a GPS that is being used indoors or has no antenna connected.

Besides not having a satellite fix, the Serial Monitor output is not quite right: you are losing some GPS characters:

    $GPGGA,,,,,,0,00,$GPRMC,,V,,,,,,,,,,N*53

You should consider using AltSoftSerial on pins 8 (to GPS TX) and 9 (to GPS_RX). SoftwareSerial is very inefficient, because it disables interrupts for long periods of time. This can interfere with other parts of your sketch or with other libraries. Read about more serial port choices here.

That is a page from my NeoGPS library, the smallest, fastest, most relibale and most accurate GPS library. NeoGPS has many examples that show the correct program structure (your sketch is not properly structured). There are also many tips on the Troubleshooting page.

AltSoftSerial and NeoGPS are available from the Arduino Library Manager, under the menu Sketch-> Include Library-> Manage Libraries.

MikeLemon:
and here is a sample from what I got from the FTDI test:

$GPGGA,,,,,,0,00,$GPRMC,,V,,,,,,,,,,N*53

If that as you suggest is the GPS output when its connected (directly) with an FTDI adapter, then something is wrong as there are characters missing, the end of a sentence has been missed.

OK guys thanks I got this working.

The problem was that I wasn't outdoors and didn't wait long enough to get the correct values so the library can display it properly.

Now the way the module works is that it just constantly stream a string of info like ALT, LONG and time without even initializing the module and all the library does is decoding that message to use it properly.

MikeLemon:
Now the way the module works is that it just constantly stream a string of info like ALT, LONG and time without even initializing the module and all the library does is decoding that message to use it properly.

Yes, it constantly sends characters for all those field values. You can send configuration commands, but it sends a default set of "sentences" even if you dont.

A common mistake is to not constantly read those characters. If you don't keep up, the Arduino input buffer fills up and overflows. Then the Arduino starts dropping characters, which prevents the library from parsing anything correctly.

This means that you shouldn't use delay or wait in a while loop. Many other libraries' examples have improper loop structure or they try to print too much information.

Like I said before, be sure to read the NeoGPS Troubleshooting page for tips on avoiding these and other problems, regardless of which library you use.

-dev:
Yes, it constantly sends characters for all those field values. You can send configuration commands, but it sends a default set of "sentences" even if you dont.

A common mistake is to not constantly read those characters. If you don't keep up, the Arduino input buffer fills up and overflows. Then the Arduino starts dropping characters, which prevents the library from parsing anything correctly.

This means that you shouldn't use delay or wait in a while loop. Many other libraries' examples have improper loop structure or they try to print too much information.

Like I said before, be sure to read the NeoGPS Troubleshooting page for tips on avoiding these and other problems, regardless of which library you use.

Aight thanks just one last question what are the procedures to make the module go to sleep and then wake it up for say 5 more readings?

Also when in goes to sleep does it need to wait for GPS fix again after wake up?

Most GPS modules don't "sleep", but if you have one that does, it will need to reacquire a fix upon wakeup.

MikeLemon:
Aight thanks just one last question what are the procedures to make the module go to sleep and then wake it up for say 5 more readings?

Also when in goes to sleep does it need to wait for GPS fix again after wake up?

That depends on the GPS.

Some can indeed be put to sleep into a low current mode.

But when woken up they will need time to re-aquire a new fix. The time for this depends on the type of GPS and the quality of its antenna, this time could be from 2 to 30 seconds or more, it depends.