I am using an ESP32 microcontroller and I am trying to get my data uploaded to my database as I am trying to make an emergency alert system. The problem is that the module is already blinking every second and It has been 1 hour but my data is still 0.0000
This is my getGPS() function
void getGps() {
String check = "Newdata available";
boolean newData = false;
for (unsigned long start = millis(); millis() - start < 2000;) {
while (neogps.available()) {
if (gps.encode(neogps.read())) {
newData = true;
break;
}
}
}
if (newData) //If newData is true
{
latitude = String(gps.location.lat(), 6);
longitude = String(gps.location.lng(), 6);
newData = false;
}
else {
Serial.println("No GPS data is available");
latitude = "";
longitude = "";
}
Serial.print("Latitude= ");
Serial.println(latitude);
Serial.print("Longitude= ");
Serial.println(longitude);
}
If the GPS LED is flashing it usually means its getting a fix.
That you seeing 0s for Long and Lat either means your in a fairly unique location or there is a problem with tyour code (any of it) or how you have the GPS connected.
Ya know I have heard that before. Now I am sitting in the South East Cleveland Ohio USA suburbs in a two story wood frame house with overcast skies.
Using one of these GPS modules I have it connected to both an Arduino UNO and direct USB to PC. The Arduino is using com 8 and the direct USB to PC using com 13. Power up and within s few min I have the 1 sec pulse out and am seeing 10 or 11 satellites in view and using 6 or 7. I get about the same results using a PA1010D RTC module.
The building and clear view seem to have no effect?
Exactly the opposite, you can clearly see the GPS signals are very weak and marginal.
And that is another indication of weak signals. With a good clear view of the sky the GPS should get a fix in circa 45 seconds, but it needs good strong signals for that.
Well alrighty then. I did notice the serial port data was not last nights. So outside on a clear night I would get faster lock up and maybe more satellites.
Actually my wife's truck is an older 1999 Tahoe so we just tossed a Garmin GPS in it. That boots up and runs pretty quickly. Never gave it much thought.
Indoors typically tracking 6 to 7 satellites with 11 or 12 in view. The numbers are good. I just figure the thread starter should be seeing something unless he is in a cave or Faraday cage. That assumes everything is wired correctly.
And no way of knowing from that whether the GPS\Antenna combination is faulty or not. If the initial fix takes that long, it could well drop out when the satellites are in a different configuration.
If a 90minute fix is acceptable then fine .........