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.