-->
Page 1 of 1

"No GPS detected: check wiring." problem

PostPosted: Mon Jun 01, 2020 7:32 pm
by owningpudding
hello! i've been trying to build a GPS tracker using NodeMCU ESP8266 and NEO6M GPS module for my school project. The thing is I managed to get it done without problem before. But then I left it untouched about a week.
And today I tried to turn on the NodeMCU and I get that script. "No GPS detected: check wiring."

Code: Select all#include <TinyGPS++.h>
#include <SoftwareSerial.h>
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

static const int RXPin = 4, TXPin = 5 ;   // GPIO 4=D2(conneect Tx of GPS) and GPIO 5=D1(Connect Rx of GPS
static const uint32_t GPSBaud = 9600; //if Baud rate 9600 didn't work in your case then use 4800

TinyGPSPlus gps; // The TinyGPS++ object
WidgetMap myMap(V0);  // V0 for virtual pin of Map Widget

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

BlynkTimer timer;

float spd;       //Variable  to store the speed
float sats;
String bearing;  //Variable to store orientation or direction of GPS

char auth[] = "----";              //Your Project authentication key
char ssid[] = "tt";                                       // Name of your network (HotSpot or Router name)
char pass[] = "ayyyyylmao";                                      // Corresponding Password

//unsigned int move_index;         // moving index, to be used later
unsigned int move_index = 1;       // fixed location for now
 

void setup()
{
  Serial.begin(115200);
  Serial.println();
  ss.begin(GPSBaud);
  Blynk.begin(auth, ssid, pass);
  timer.setInterval(5000L, checkGPS); // every 5s check if GPS is connected, only really needs to be done once
}

void checkGPS(){
  if (gps.charsProcessed() < 10)
  {
    Serial.println(F("No GPS detected: check wiring."));
      Blynk.virtualWrite(V4, "GPS ERROR");  // Value Display widget  on V4 if GPS not detected
  }
}

void loop()
{
    while (ss.available() > 0)
    {
      // sketch displays information every time a new sentence is correctly encoded.
      if (gps.encode(ss.read()))
        displayInfo();
  }
  Blynk.run();
  timer.run();
}

void displayInfo()
{
  if (gps.location.isValid() )
  {   
    float latitude = (gps.location.lat());     //Storing the Lat. and Lon.
    float longitude = (gps.location.lng());
   
    Serial.print("LAT:  ");
    Serial.println(latitude, 6);  // float to x decimal places
    Serial.print("LONG: ");
    Serial.println(longitude, 6);
    Blynk.virtualWrite(V1, String(latitude, 6));   
    Blynk.virtualWrite(V2, String(longitude, 6)); 
    myMap.location(move_index, latitude, longitude, "GPS_Location");
    spd = gps.speed.kmph();               //get speed
       Blynk.virtualWrite(V3, spd);
       
       sats = gps.satellites.value();    //get number of satellites
       Blynk.virtualWrite(V4, sats);

       bearing = TinyGPSPlus::cardinal(gps.course.value()); // get the direction
       Blynk.virtualWrite(V5, bearing);                   
  }
 
 Serial.println();
}


I didn't changed anything, it just stop working for some reason.
my connections between GPS module to NodeMCU are :-
VCC ~ 3V
RX ~ D1
TX ~ D2
GND ~ GND

Previously whenever I plugged in the cable, both nodemcu and GPS module blink at least once. after successfully connected it will keep on blinking. but now only nodemcu seems responding with the blinking.
GPS module does not respond at all. no blink no nothing.

Help me figure out this one