Makefile not working with tinyGPS and tinyGPSPlus

I am trying to compile an example of tinyGPSPlus (same goes tinyGPS) for it works fine when i compile it using arduino IDE but when i use make upload there is no error but i don't receive any GPS data.
Please note that i have all ready uploaded functional programs using make upload.

The makefile i am using is : GitHub - ladislas/Bare-Arduino-Project: Start your Arduino projects right out of the box
tinyGPSPlus library can be found here: TinyGPS++ | Arduiniana

and the code :

#include <TinyGPSPlus.h>
#include <SoftwareSerial.h>
/*
This sample sketch 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 = 3, TXPin = 2;
static const uint32_t GPSBaud = 4800;

// The TinyGPS++ object
TinyGPSPlus gps;

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

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

void loop()
{
while (ss.available() > 0)
if (gps.encode(ss.read()))
if (gps.location.isValid())
{
Serial.print("Location: ");
Serial.print(gps.location.lat(), 6);
Serial.print(",");
Serial.println(gps.location.lng(), 6);
}

}

kamel:
it works fine when i compile it using arduino IDE but when i use make upload there is no error but i don't receive any GPS data.

Enable "Show verbose output during: compilation" in the Arduino IDE, recompile and then post the verbose compilation output.
Compile using your Makefile project and post the output from it too.

Maybe someone can spot a significant difference.

You might be interested in my NeoGPS library. It's smaller, faster, more accurate and more reliable than all other libraries. It can be configured to parse only the fields and sentences that you really use in your sketch (e.g., just location). Everything else is quickly skipped, saving even more.

Instead of using SoftwareSerial on pins 2 & 3, you might want to read this. It could save you some headaches later.

Here's a NeoGPS+NeoSWSerial version of that sketch:

#include <NMEAGPS.h>
#include <NeoSWSerial.h>

/*
   Simple NeoGPS example, using the more-efficient NeoSWSerial
*/
static const int RXPin = 3, TXPin = 2;
static const uint32_t GPSBaud = 4800;    // <-- Are you sure?  Most are 9600!

NMEAGPS gps;

NeoSWSerial gpsPort(RXPin, TXPin);

void setup()
{
  gpsPort.begin(GPSBaud);
  Serial.begin(9600);
}

void loop()
{
  while (gps.available( gpsPort )) {
    gps_fix fix = gps.read();

    if (fix.valid.location) {
      Serial.print( F("Location: ") ); // <-- F macro saves RAM
      Serial.print(fix.latitude(), 6);
      Serial.print(',');
      Serial.println(fix.longitude(), 6);
    } else {
      Serial.print( '.' );
    }
  }
}

The original program uses 8544 bytes of program space and 548 bytes of RAM.
The NeoGPS version uses 6696 bytes of program space and 387 bytes of RAM.

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 NMEAloc.ino is a good place to start.

Cheers,
/dev

Thank you all for helping out i figured out how to solve it : i set GPSBaud to 9600 and it worked just fine.

@Edison: i am checking out your library right now, just one question about it : can we extract brute NMEA sentence without adding latitude longitude time and other variables one by one ?

@Edison: i am checking out your library right now, just one question about it : can we extract brute NMEA sentence without adding latitude longitude time and other variables one by one ?

Ok, I'll assume you were talking to me...

If you want to display all the pieces, you have to print all the pieces. Several NeoGPS examples show how to print some of them (e.g., NMEAloc.ino and NMEAsimple.ino. Tabular.ino shows how to print all of the pieces in the default configuration.

The Streamers.cpp file shows how to print all pieces in a CSV format. It is used by the example NMEA.ino. You could use in your sketch, too:

  trace_all( Serial, gps, fix_data );

This will work for any kind of Print destination: Serial, an SD File, an AltSoftSerial port, an Ethernet Client, etc.

If you want to send a message with all the pieces, you could send the fix structure itself:

  send_message( (uint8_t *) &fix, sizeof(fix) );

That sends the raw bytes of the fix structure, in the most efficient way possible (binary). The receiver would copy those bytes into it's own fix structure.

  receive_message( (uint8_t *) &fix, sizeof(fix) );

At this point, the fix pieces would be ready to use. No parsing would be necessary.

I should also mention that this binary form is 10x to 80x smaller than the raw NMEA data. NeoGPS merges all NMEA data into one coherent fix structure. Many NMEA sentences contain duplicate information that is in other NMEA sentences (e.g., lat/lon and time are in many sentences). Sending the raw NMEA data would be very inefficient.

Cheers,
/dev

Noted thank you very much !