I have connected an L80-M39 to my ESP32. I think i can communicate correctly with the GPS module but whatever i do, it cannot get any satellite information.
This is the raw result:
$GPRMC,000528.800,V,,,,,0.00,0.00,050180,,,N*46
$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32
$GPGGA,000528.800,,,,,0,0,,,M,,M,,*4F
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,1,1,00*79
$GPGLL,,,,,000528.800,V,N*7D
$GPTXT,01,01,02,ANTSTATUS=OPEN*2B
This is the code i am using:
#include <TinyGPS++.h> //get library here > http://arduiniana.org/libraries/tinygpsplus/
TinyGPSPlus gps; //create the TinyGPS++ object
void setup()
{
Serial.begin(115200); //setup Serial monitor ouput
Serial1.begin(9600, SERIAL_8N1, 13, 12); //start Serial for GPS at defined baud rate
}
float GPSLat; //Latitude from GPS
float GPSLon; //Longitude from GPS
float GPSAlt; //Altitude from GPS
uint8_t GPSSats; //number of GPS satellites in use
uint32_t GPSHdop; //HDOP from GPS
uint32_t GPSstarttimemS; //time in mS when GPS is scanned fo fix
uint32_t GPSendtimemS; //time in mS when GPS got a fix
void loop()
{
gpsWaitFix();
displayGPSfix();
Serial.println("");
}
void gpsWaitFix()
{
//waits till the GPS gets an updated fix
uint8_t GPSchar;
Serial.println(F("Wait for updated GPS Fix"));
GPSstarttimemS = millis();
while (1)
{
if (Serial1.available() > 0)
{
GPSchar = Serial1.read();
gps.encode(GPSchar);
Serial.write(GPSchar);
}
if (gps.location.isUpdated() && gps.altitude.isUpdated())
{
GPSendtimemS = millis();
break;
}
}
}
void displayGPSfix()
{
float tempfloat;
Serial.println();
Serial.println();
Serial.print(F("New GPS Fix "));
Serial.print(GPSendtimemS - GPSstarttimemS);
Serial.print(F("mS "));
GPSLat = gps.location.lat();
GPSLon = gps.location.lng();
GPSAlt = gps.altitude.meters();
GPSSats = gps.satellites.value();
GPSHdop = gps.hdop.value();
tempfloat = ( (float) GPSHdop / 100);
Serial.print(F("Lat,"));
Serial.print(GPSLat, 6);
Serial.print(F(",Lon,"));
Serial.print(GPSLon, 6);
Serial.print(F(",Alt,"));
Serial.print(GPSAlt, 1);
Serial.print(F("m,Sats,"));
Serial.print(GPSSats);
Serial.print(F(",HDOP,"));
Serial.print(tempfloat, 2);
Serial.println();
Serial.println();
}
I assume the communication is okay since i do get results from the gps module?
The module is put in front of the window with the label up