TinyGPS++ / Serial Monitor Behavior

I have written the sketch below which waits for a serial monitor input of "o" then turns on the GPS and starts processing the datastream until it finds 7 sats or the time limit is reached. Then it prints out the lat, lon, time etc. and finally powers down the GPS. It is working just fine but here is where it gets interesting. If I press "o" again, it immediately prints the same output as before. The same timestamp, date, position, everything. On the other hand, if I close the serial monitor window and open a new one and press "o" it starts over from scratch like I would want. It seems like closing the window clears the last data out of memory. What is going on? Is there a way to make it start from scratch every time without closing the window?

#include <TinyGPS++.h> // Include the TinyGPS++ library
TinyGPSPlus tinyGPS; // Create a TinyGPSPlus object
#define GPS_BAUD 9600 // GPS module baud rate. GP3906 defaults to 9600.
#include <SoftwareSerial.h>
#define ARDUINO_GPS_RX 3 // GPS TX, Arduino RX pin
#define ARDUINO_GPS_TX 4 // GPS RX, Arduino TX pin
SoftwareSerial ssGPS(ARDUINO_GPS_TX, ARDUINO_GPS_RX); // Create a SoftwareSerial
#define gpsPort ssGPS  // Alternatively, use Serial1 on the Leonardo
#define Serial Serial
unsigned long gpsTimout = 120000;

int GPSpower = 10;

void setup() {
  Serial.begin(9600);
  pinMode(GPSpower, OUTPUT);  //
  gpsPort.begin(GPS_BAUD);
}

void loop() {

  char rx_byte;

  if (Serial.available() > 0) {    // is a character available?
    rx_byte = Serial.read();       //
    if (rx_byte == 'o') {
      digitalWrite(GPSpower, HIGH);
      unsigned long gpsTimer = 0;
      unsigned long gpsStart = millis();
      while ((tinyGPS.satellites.value() <= 6) && (gpsTimer <= gpsTimout)) {
        unsigned long now = millis();
        gpsTimer = (now - gpsStart);
        Serial.print("Serching for Sats -- Current Count: ");
        Serial.println(tinyGPS.satellites.value());
        printTime();
        Serial.println(gpsTimer);
        smartDelay(1000);
      }
      //digitalWrite(GPSpower, LOW);
      //Serial.println("GPS Toggled");
      printGPSInfo();
      delay(2000);
      digitalWrite(GPSpower, LOW);
      Serial.println("GPS Toggled");
    }
  }
}


void printGPSInfo()
{
  // Print latitude, longitude, altitude in feet, course, speed, date, time,
  // and the number of visible satellites.
  Serial.print("Lat: "); Serial.println(tinyGPS.location.lat(), 6);
  Serial.print("Long: "); Serial.println(tinyGPS.location.lng(), 6);
  Serial.print("Alt: "); Serial.println(tinyGPS.altitude.feet());
  Serial.print("Course: "); Serial.println(tinyGPS.course.deg());
  Serial.print("Speed: "); Serial.println(tinyGPS.speed.mph());
  Serial.print("Date: "); printDate();
  Serial.print("Time: "); printTime();
  Serial.print("Sats: "); Serial.println(tinyGPS.satellites.value());
  Serial.println();
}
void printDate()
{
  Serial.print(tinyGPS.date.day());
  Serial.print("/");
  Serial.print(tinyGPS.date.month());
  Serial.print("/");
  Serial.println(tinyGPS.date.year());
}
void printTime()
{
  Serial.print(tinyGPS.time.hour());
  Serial.print(":");
  if (tinyGPS.time.minute() < 10) Serial.print('0');
  Serial.print(tinyGPS.time.minute());
  Serial.print(":");
  if (tinyGPS.time.second() < 10) Serial.print('0');
  Serial.println(tinyGPS.time.second());
}

static void smartDelay(unsigned long ms)
{
  unsigned long start = millis();
  do
  {
    // If data has come in from the GPS module
    while (gpsPort.available())
      tinyGPS.encode(gpsPort.read()); // Send it to the encode function
    // tinyGPS.encode(char) continues to "load" the tinGPS object with new
    // data coming in from the GPS module. As full NMEA strings begin to come in
    // the tinyGPS library will be able to start parsing them for pertinent info
  } while (millis() - start < ms);
}

There are a couple of things interacting to keep if from doing what you wanted:

* Once you get some GPS data, you never let it get new data. This statement always checks the last value:

          while ((tinyGPS.satellites.value() <= 6) && (gpsTimer <= gpsTimout)) {

... and never enters the loop to get new data.

* You never empty the old characters out of the input buffer. They will still be there when you as for a new fix, even if the GPS is not sending new characters yet.

* This library does not handle multiple sentences (e.g. GGA + RMC) very well. You may get one of the sentences that says you have 7 satellites (the GGA), but the sentence with the speed value (the RMC) may not have arrived yet. You will not print the correct speed; it will be the old (possibly invalid) value.

In general, you should avoid any kind of delay, "smart" or otherwise. Instead, set a flag and run all the time, without "blocking" anywhere. In this sketch, you could use a waitingForFix flag to indicate that the "o" command is in progress.

You should also make sure that each piece of GPS data is really valid before printing it out.

After having these problems with all other GPS libraries (including the one you are using), I eventually wrote NeoGPS. It is faster, smaller and more accurate than other libraries, and the example programs are structured correctly. You can also configure it to parse only the fields that you really use, making it even smaller and faster.

Here is a NeoGPS version of your sketch:

#include <NMEAGPS.h>
NMEAGPS GPS;
gps_fix fix;

#include <NeoSWSerial.h>
#define ARDUINO_GPS_RX 3 // GPS TX, Arduino RX pin
#define ARDUINO_GPS_TX 4 // GPS RX, Arduino TX pin
//NeoSWSerial gpsPort(ARDUINO_GPS_TX, ARDUINO_GPS_RX);
#define gpsPort Serial1  // Alternatively, use Serial1 on the Leonardo, Mega or Due
#define GPS_BAUD 9600    // GPS module baud rate. GP3906 defaults to 9600.

      bool          waitingForFix = false;
const unsigned long GPS_TIMEOUT   = 120000; // 2 minutes
      unsigned long gpsStart      = 0;

const int           GPSpower      = 10;


void setup() {
  Serial.begin(9600);
  pinMode(GPSpower, OUTPUT);
  gpsPort.begin(GPS_BAUD);
}


void loop() {
  bool turnGPSoff = false;

  // Is a command character available?
  if (Serial.available() > 0) {
    char rx_byte = Serial.read();

    if (rx_byte == 'o') {
      digitalWrite(GPSpower, HIGH);
      gpsStart      = millis();
      waitingForFix = true;
    }
  }

  // Is a GPS fix available?
  if (GPS.available( gpsPort )) {
    fix = GPS.read();

    if (waitingForFix) {
      printGPSInfo();
      Serial.println( millis() - gpsStart ); // DEBUG

      if (fix.valid.satellites && (fix.satellites > 6)) {
        waitingForFix = false;
        turnGPSoff    = true;
      }
    }
  }

  // Have we waited too long for a GPS fix?
  if (waitingForFix && (millis() - gpsStart > GPS_TIMEOUT)) {
    waitingForFix = false;
    turnGPSoff    = true;
  }

  if (turnGPSoff) {
    digitalWrite(GPSpower, LOW);
    Serial.println( F("GPS Toggled") );
  }

} // loop


void printGPSInfo()
{
  Serial.print( F("\nLat: ") );
  if (fix.valid.location)
    Serial.print( fix.latitude(), 6);
  Serial.print( F("\nLong: ") );
  if (fix.valid.location)
    Serial.print( fix.longitude(), 6);
  Serial.print( F("\nAlt: ") );
  if (fix.valid.altitude)
    Serial.print( fix.altitude() * 3.2808 );
  Serial.print( F("\nCourse: ") );
  if (fix.valid.heading)
    Serial.print(fix.heading());
  Serial.print( F("\nSpeed: ") );
  if (fix.valid.speed)
    Serial.print(fix.speed_mph());
  Serial.print( F("\nDate: ") );
  if (fix.valid.date)
    printDate();
  Serial.print( F("\nTime: ") );
  if (fix.valid.time)
    printTime();
  Serial.print( F("\nSats: ") );
  if (fix.valid.satellites)
    Serial.print(fix.satellites);
  Serial.println('\n');
}

void printDate()
{
  Serial.print(fix.dateTime.date);
  Serial.print('/');
  Serial.print(fix.dateTime.month);
  Serial.print('/');
  Serial.print(fix.dateTime.year); // or full_year()
}

void printTime()
{
  Serial.print(fix.dateTime.hours);
  Serial.print(':');
  if (fix.dateTime.minutes < 10) Serial.print('0');
  Serial.print(fix.dateTime.minutes);
  Serial.print(':');
  if (fix.dateTime.seconds < 10) Serial.print('0');
  Serial.print(fix.dateTime.seconds);
}

Notice that it uses 2 flags and runs all the time, without delays. This will let you add more features that can run in parallel. They won't have to wait for 2 minutes if the GPS is not responding. It also reads all the old GPS data out of the input buffer. NeoGPS automatically merges multiple sentences into one coherent fix.

Also, you should avoid SoftwareSerial, because it is very inefficient. It disables interrupts for long periods of time, using about 95% of the CPU time, just waiting. This can interfere with other parts of your sketch or with other libraries.

AltSoftSerial is the absolute best choice for a second serial port, but you have to connect the GPS Tx/Rx to specific Arduino pins (e.g., 8/9 on an UNO).

Next best is my NeoSWSerial (as above) it works on any two pins at specific baud rates 9600, 19200 and 38400.

If you want to try it, NeoGPS is available from the Arduino IDE Library Manager, under the menu Sketch -> Include Library -> Manage Libraries.

Cheers,
/dev

When you open the Serial Monitor it resets your Arduino (unless you're using an ATmega32U4 based board such as Leonardo or Pro Micro). So that's the reason it starts from scratch when you close and open the Serial Monitor.

/dev:
* This library does not handle multiple sentences (e.g. GGA + RMC) very well. You may get one of the sentences that says you have 7 satellites (the GGA), but the sentence with the speed value (the RMC) may not have arrived yet. You will not print the correct speed; it will be the old (possibly invalid) value.

Thats true, and the easy workaround I use is;

if (gps.location.isUpdated() && gps.altitude.isUpdated())
{
Serial.println(F("GPS Fix !"));
}

Etc ......

Thanks everyone.

/dev - I will study the NeoGPS version and try it out. Really appreciate you taking the time to rewrite it for me.

srnet:
the easy workaround I use is;

if (gps.location.isUpdated() && gps.altitude.isUpdated())

How do you know the location is from the same interval as the altitude? It could be the last second's location with this second's altitude.

It gets more cumbersome when more pieces are used, especially when the same pieces are received from multiple sentences (see this table). Also, different devices emit the sentences in different orders. It's nearly impossible to write a sketch that will run on different devices with the same fidelity.

FWIW, I really tried to use other libraries before writing NeoGPS... :smiley: I got tired of coming up with work-arounds for these various quirks. There are some things you can't work around: some libraries force your sketch to use the floating-point library, and one of them doesn't even validate the checksum. o_O

Half of the blame goes to the NMEA organization for proliferating a poorly-designed message set. :stuck_out_tongue:

Cheers,
/dev

/dev:
How do you know the location is from the same interval as the altitude? It could be the last second's location with this second's altitude.

Because with that library if you just use 'gps.location.isUpdated()' the altitude comes out wrong, suggesting the location is being updated before the altitude.

Works for me.

srnet:
"How do you know the location is from the same interval as the altitude?

Because with that library if you just use 'gps.location.isUpdated()' the altitude comes out wrong, suggesting the location is being updated before the altitude.

LOL, I would surely like the source code to that:

    if (gps.altitudeIsWrong())

All libraries wait to update the pieces until a sentence has been completely received. There is no obvious "wrongness" about the values, so there is no simple way with those libraries to know the update interval for a particular piece. You have to know either:

  • the GPS time associated with each of the pieces (NOT the TinyGPS "age"), or

  • the order of the sentences emitted by your device.

You can work around the issue if you add code that deduces the above information. Your work-around does not do that.

Furthermore, the Arduino clock will drift against the GPS time, causing different orders of sentences to be parsed during each of the Arduino's 1000ms intervals. NeoGPS provides coherent fixes at the exact update rate of the GPS device, without relying on the Arduino clock. This also makes the main loop simpler, because you don't have to handle each sentence.

OTOH, it is very common not to care about coherency or sentences. But saying it "works for me" doesn't mean it's correct. It works for lots of people, but that just means the error doesn't affect their results enough to be noticed. In this case, the OP's application could manifest these errors, so I think it's important to explain why they happen and how NeoGPS addresses them.

Cheers,
/dev

Hey /dev,

I got it up and running and then spent some time reading the documentation for NeoGPS. The reason I wanted the number of sats to be greater than 6 was to make sure I had a good lat/lon fix before stopping. With that in mind I swapped out the # of sats requirement with fix.valid.location so it would stop when it had a valid lat/lon. This works but I saw some strange results that I am hoping you can shed some light on. Sometimes it got a lat/lon fix while also showing zero sats and sometimes it showed 3, 4, 5 or 6 sats with no location fix while he green fix light on my module was blinking.

Here is a copy of my updated sketch for reference.

#include <NMEAGPS.h>
NMEAGPS GPS;
gps_fix fix;

#include <NeoSWSerial.h>
#define ARDUINO_GPS_RX 3 // GPS TX, Arduino RX pin
#define ARDUINO_GPS_TX 4 // GPS RX, Arduino TX pin
NeoSWSerial gpsPort(ARDUINO_GPS_TX, ARDUINO_GPS_RX);
//#define gpsPort Serial1  // Alternatively, use Serial1 on the Leonardo, Mega or Due
#define GPS_BAUD 9600    // GPS module baud rate. GP3906 defaults to 9600.

      bool          waitingForFix = false;
const unsigned long GPS_TIMEOUT   = 240000; // 4 minutes
      unsigned long gpsStart      = 0;

const int           GPSpower      = 10;


void setup() {
  Serial.begin(9600);
  pinMode(GPSpower, OUTPUT);
  gpsPort.begin(GPS_BAUD);
}


void loop() {
  bool turnGPSoff = false;

  // Is a command character available?
  if (Serial.available() > 0) {
    char rx_byte = Serial.read();

    if (rx_byte == 'o') {
      digitalWrite(GPSpower, HIGH);
      gpsStart      = millis();
      waitingForFix = true;
    }
  }

  // Is a GPS fix available?
  if (GPS.available( gpsPort )) {
    fix = GPS.read();

    if (waitingForFix) {
      printGPSInfo();
      Serial.println( millis() - gpsStart ); // DEBUG

      if (fix.valid.location) {
        printGPSInfo();
        waitingForFix = false;
        turnGPSoff    = true;
      }
    }
  }

  // Have we waited too long for a GPS fix?
  if (waitingForFix && (millis() - gpsStart > GPS_TIMEOUT)) {
    waitingForFix = false;
    turnGPSoff    = true;
  }

  if (turnGPSoff) {
    digitalWrite(GPSpower, LOW);
    Serial.println( F("GPS Toggled") );
  }

} // loop


void printGPSInfo()
{
  Serial.print( F("\nLat: ") );
  if (fix.valid.location)
    Serial.print( fix.latitude(), 6);
  Serial.print( F("\nLong: ") );
  if (fix.valid.location)
    Serial.print( fix.longitude(), 6);
  Serial.print( F("\nAlt: ") );
  if (fix.valid.altitude)
    Serial.print( fix.altitude() * 3.2808 );
  Serial.print( F("\nCourse: ") );
  if (fix.valid.heading)
    Serial.print(fix.heading());
  Serial.print( F("\nSpeed: ") );
  if (fix.valid.speed)
    Serial.print(fix.speed_mph());
  Serial.print( F("\nDate: ") );
  if (fix.valid.date)
    printDate();
  Serial.print( F("\nTime: ") );
  if (fix.valid.time)
    printTime();
  Serial.print( F("\nSats: ") );
  if (fix.valid.satellites)
    Serial.print(fix.satellites);
  Serial.println('\n');
}

void printDate()
{
  Serial.print(fix.dateTime.date);
  Serial.print('/');
  Serial.print(fix.dateTime.month);
  Serial.print('/');
  Serial.print(fix.dateTime.year); // or full_year()
}

void printTime()
{
  Serial.print(fix.dateTime.hours);
  Serial.print(':');
  if (fix.dateTime.minutes < 10) Serial.print('0');
  Serial.print(fix.dateTime.minutes);
  Serial.print(':');
  if (fix.dateTime.seconds < 10) Serial.print('0');
  Serial.print(fix.dateTime.seconds);
}

I swapped out the # of sats requirement with fix.valid.location so it would stop when it had a valid lat/lon.

Yes, that's exactly right.

I saw some strange results that I am hoping you can shed some light on.

To accumulate all the pieces you are printing, NeoGPS will have to parse at least two sentences, the RMC and GGA. Those two sentences are enabled in the default NMEAGPS_cfg.h. I assume those are still enabled.

If you haven't run NMEAorder.ino yet, you should try it. It will display the sentence that your GPS sends for the LAST_SENTENCE_IN_INTERVAL. If the last sentence is not an RMC, edit this line in Libraries/NeoGPS/src/NMEAGPS_cfg.h. You can choose to use either (1) the sentence identified by NMEAorder.ino, or (2) RMC or GGA, whichever comes last.

If you had to change it, your sketch was probably losing GPS characters when it was printing the GPS info. During that print time, the Arduino's input buffer overflowed. Sentences after the RMC (the default last sentence) get corrupted, and they won't fill out the all the pieces of a fix (e.g., fix.satellites will be zero). This is a very common problem with GPS example programs.

To test that theory, don't print the GPS info every time. Wait until it meets your criteria:

  // Is a GPS fix available?
  if (GPS.available( gpsPort )) {
    fix = GPS.read();

    if (waitingForFix) {
      Serial.println( millis() - gpsStart ); // DEBUG

      if (fix.valid.location) {
        printGPSInfo();              // <--  moved from above
        waitingForFix = false;
        turnGPSoff    = true;
      }
    }
  }

Another possibility is that you are only getting 1 of the 2 sentences when it starts up. To make sure that the fix contains all the pieces you want, you could change the test to something like this:

     if (fix.valid.location & fix.valid.altitude & 
         fix.valid.satellites & fix.valid.time & fix.valid.date) {

If the first fix doesn't have all those pieces marked as valid, it waits for the next fix. That test is actually faster and takes less program space than

     if (fix.valid.satellites && (fix.satellites >= 6)) {

BTW, speed and heading are not always valid when you are stationary... it's ok if they are empty (i.e., not valid).

At startup, the GPS device may get a location, lose its lock on the satellites, and then recover, several times. You may see reports with a location, then no location, and then a location again. During a cold start, my GPS was only getting 4 satellites, enough to compute a lat/lon/altitude. Eventually it started receiving from 6, but it varied for a few minutes. YMMV.

Cheers,
/dev

/dev

Sentence order was the issue. GLL was the last sentence so once I updated the file for that all of the strangeness ended. It didn't matter whether it was printing all the GPS info every time or not.

What are the pluses and minuses of enabling the parsing of additional sentences in NMEAGPS_cfg.h? I went ahead and enabled all the ones that showed up in NMEAorder output for now.

Thanks so much for your help.

Jethro747:
What are the pluses and minuses of enabling the parsing of additional sentences in NMEAGPS_cfg.h?

If GPSfix_cfg.h is the default configuration, there is no advantage. The RMC and GGA provide all of those pieces, so the extra sentences do not add anything to the fix structure. The Arduino will spend a more time parsing duplicate fields, and your program size is larger because the extra sentences are enabled.

If you have enabled other fields in GPSfix_cfg.h, the other sentences may be required to set certain pieces. For example, according to this table, satellite IDs are only available from the GSA or GSV sentences.

If you have disabled some fields in the default GPSfix_cfg.h, you can use that table to choose a minimum set of sentences that should be enabled in NMEAGPS_cfg.h. This will reduce your program size to its minimum. And if you send a configuration command to the GPS device to disable unnecessary sentences, the Arduino will spend the minimum amount of time handling the characters.

I should point out that you don't have to enable the sentences in NMEAGPS_cfg.h in order for them to be "recognized". They will still be skipped if they aren't enabled. That's how NMEAorder works. This adds a little to the program size, because the sentence strings take up a little flash memory. There is an option to disable this recognition.

Cheers,
/dev

Thanks /dev I'm all squared away now.

/dev

Please confirm my understanding of the HDOP output. The documentation says integer thousandths so I think if I get an HDOP value of 1270 that means 1.27 meters. Is that correct?

if I get an HDOP value of 1270 that means 1.27 ...

Yes...

... meters. Is that correct?

No.

  // Dilution of Precision is a measure of the current satellite
  // constellation geometry WRT how 'good' it is for determining a 
  // position.  This is _independent_ of signal strength and many 
  // other factors that may be internal to the receiver.
  // It _cannot_ be used to determine position accuracy in meters.
  // Instead, use the LAT/LON/ALT error in cm members, which are 
  //   populated by GST sentences.

Dilution of Precision is a unitless value. GPS devices can provide Horizontal, Vertical, Positional or Time DoPs. Smaller is better.

If you want to reject "fuzzy" locations, you could use it as a threshold (e.g., < 2.0). This is a little finer metric than fix.valid.location, a simple presence flag.

Some mapping applications use it to set the size of a circle around your icon. But it's not very useful for most Arduino applications, so it's not part of the default NeoGPS configuration.

/dev

Thanks again for all your help.

I wrote up my full project here if you want to check it out:

I tried to execute below pgm in arduino uno using neo 6m GPS. Even though i am getting NMEA statements, latitude/longitude values are not displaying. please help me ...........

#include <TinyGPS++.h>
#include <SoftwareSerial.h>
static const int RXPin = 4, TXPin = 3;
//static const int RXPin = 1, TXPin = 0;
static const uint32_t GPSBaud = 9600;
TinyGPSPlus gps;
SoftwareSerial ss(RXPin, TXPin);

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

void loop(){
while (ss.available() > 0){
gps.encode(ss.read());
if (gps.location.isUpdated()){
Serial.print("Latitude= ");
Serial.print(gps.location.lat(), 8 );
Serial.print(" Longitude= ");
Serial.println(gps.location.lng(), 8 );
}
}
}

Below are the NMEA statements, i am getting.
$GNRMC,114838.801,V,,,,,,,220919,,,M5F
$GNVTG,,,,,,,,,M
2D
$GNZDA,114838.801,22,09,2019,00,0045
$GPTXT,01,01,01,ANTENNA OPEN
25
$GNGGA,114839.801,,,,,0,00,25.5,,,,,,75
$GNGLL,,,,,114839.801,V,M
68

I tried to keep my GPS module in open environment for around 10-15 min, the satellite fix is not happening i guess and the LED on my GPS is not Blinking/ turning ON.

I tried to execute below pgm in arduino uno using neo 6m GPS. Even though i am getting NMEA statements, latitude/longitude values are not displaying. please help me ...........

#include <TinyGPS++.h>
#include <SoftwareSerial.h>
static const int RXPin = 4, TXPin = 3;
//static const int RXPin = 1, TXPin = 0;
static const uint32_t GPSBaud = 9600;
TinyGPSPlus gps;
SoftwareSerial ss(RXPin, TXPin);

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

void loop(){
while (ss.available() > 0){
gps.encode(ss.read());
if (gps.location.isUpdated()){
Serial.print("Latitude= ");
Serial.print(gps.location.lat(), 8 );
Serial.print(" Longitude= ");
Serial.println(gps.location.lng(), 8 );
}
}
}

Below are the NMEA statements, i am getting.
$GNRMC,114838.801,V,,,,,,,220919,,,M5F
$GNVTG,,,,,,,,,M
2D
$GNZDA,114838.801,22,09,2019,00,0045
$GPTXT,01,01,01,ANTENNA OPEN
25
$GNGGA,114839.801,,,,,0,00,25.5,,,,,,75
$GNGLL,,,,,114839.801,V,M
68

I tried to keep my GPS module in open environment for around 10-15 min, the satellite fix is not happening i guess and the LED on my GPS is not Blinking/ turning ON.

robin711:
Below are the NMEA statements, i am getting.
$GNRMC,114838.801,V,,,,,,,220919,,,M5F
$GNVTG,,,,,,,,,M
2D
$GNZDA,114838.801,22,09,2019,00,0045
$GPTXT,01,01,01,ANTENNA OPEN
25
$GNGGA,114839.801,,,,,0,00,25.5,,,,,,75
$GNGLL,,,,,114839.801,V,M
68

I tried to keep my GPS module in open environment for around 10-15 min, the satellite fix is not happening i guess and the LED on my GPS is not Blinking/ turning ON.

Reporting ANTENNA OPEN, suggests either a problem with the antenna or fake GPS.