Not Getting GPS Location from Neo 6M

Hi, I am trying to do a project to take the gps location from the module Neo 6M. I follow this schematic for wiring: schematic. And my code is as following:

#define BLYNK_PRINT Serial
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <DHT.h>
#include <Adafruit_Sensor.h>
#include <TinyGPS++.h>
#include <SoftwareSerial.h>

char auth[] = "fdb435043f2e481696f2f8761de71c67";
char server[] = "blynk-cloud.com";

char ssid[] = "TP-LINK_4387";
char pass[] = "96401910";

static const int RXPin = 4, TXPin = 5;  //D3 -- 5; D4 -- 4

static const uint32_t GPSBaud = 9600; 

TinyGPSPlus gps; // The TinyGPS++ object
SoftwareSerial ss(RXPin, TXPin);  // The serial connection to the GPS device
BlynkTimer timer;

float hum;  //Stores humidity value
float temp; //Stores temperature valu e
float sats;      //Variable to store no. of satellites response

void setup()
{
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass, server, 8442);
  dht.begin();
  ss.begin(GPSBaud);
  timer.setInterval(2000L,checkGPS);
}

void checkGPS()
{
  if (gps.charsProcessed() < 10)
  {
    Serial.println("No GPS detected: check wiring.");
  }
}

void loop()
{
  while (ss.available() > 0) 
  {
      // sketch displays information every time a new sentence is correctly encoded.
      if (gps.encode(ss.read()))
      {
        displayInfo();
        delay(1000L);
      }
  }
  Blynk.run();
  timer.run();
}
void displayInfo()
{ 
  Serial.println("this is from displayInfo() outside if loop");
  Serial.println(gps.satellites.value());
  
  if (gps.location.isValid() ) 
  {
    Serial.print("this is from displayInfo()");
    float latitude = (gps.location.lat());     //Storing the Lat. and Lon. 
    float longitude = (gps.location.lng()); 
    
    Serial.print("LAT:  ");
    Serial.println(latitude, 6);
    Serial.print("LONG: ");
    Serial.println(longitude, 6);
    Blynk.virtualWrite(V1, String(latitude, 6));   
    Blynk.virtualWrite(V2, String(longitude, 6));                   
  }
  Serial.println();
}

And this is my serial output:


The main problem is:
the LED of the GPS Module is not blinking after I upload the code to Arduino, and therefore there is no satellites value? I checked my wiring multiple times and still couldn’t figure where went wrong.

I understand the problem I am facing has nothing related to Blynk, but since I am using Blynk for the project, I hope someone can give me an idea for the issue since I am stuck here for hours. Thanks.

Takes a couple of minutes “outdoors”.

Take that while code out of the void loop() and run it in a timed function/loop of it’s own. And be aware that 1 second delay could cause connection issues, even in a timed loop.

I placed the module on the windowsill and it started to blink after few minutes! I didn’t realize it is that sensitive. Thank you!

I placed the module on the windowsill and it started to blink and give me the values after few minutes! Thank you anyway!

@Darre_Lau I wasted 3 days setting mine up :slight_smile:
It’s been sat peering out of the window for the last few months.
See this thread for more info [SOLVED] Arduino or NodeMCU GPS tracking system on Map widget

Oh, I wasn’t referring to the GPS issues… just recommending caution when running potential blocking functions in the void loop() Bad Blynk practice and ends up causing issues as your code grows.

Does your home move that frequently that you need to keep track of it :stuck_out_tongue:

1 Like

@Gunner no but as it took me 3 days to get the first signal I never turn it off now. Weeks go by without me even thinking about it until a GPS thread pops up on this site. The GPS stuff we learnt came in handy for the geo-located control section of the ESPproMon app, which uses the “free” receiver in your phone.

Yes, I remember messing with a large puck sized (and locked in) Garmin GPS… couldn’t test it indoors at all. Even in a car it had to be right up in the windshield or even stuck on top of the car roof. But fun driving 700km through canyons and having the laptop warn of upcoming 'targets" like tunnels (all based on CD loaded maps… long before mobile data was an option).

Now I have a tiny & efficient receiver, and satellite maps, in a half dozen phones and tablets… and I never go anywhere :stuck_out_tongue:

1 Like