Hi, my air quality tracking device has been working well for several months. Yesterday I updated Blynk IOT on Android and I am now unable to see the GPS position using the mobile Map widget (see code snippets below.) Continues to work ok on IOS and GPS position is updated on Web dashboard.
Phone is Samsung Galaxy A20 running Android 11 updated yesterday as well.
This code has been working reliably for months so something has gone awry or I am missing something. Appreciate your thoughts here.
Drew
double latID = 0;
double lonID = 0;
...
void getGPS() {
String line1, line2;
// Using Sparkfun GPS module
myGNSS.checkUblox(); //See if new data is available. Process bytes as they come in.
if(nmea.isValid() == true) // if valid data go get it
{
long latitude_mdeg = nmea.getLatitude();
long longitude_mdeg = nmea.getLongitude();
latI = latitude_mdeg / 1000000.;
lonI = longitude_mdeg / 1000000.;
latID = latitude_mdeg/1000000.;
lonID = longitude_mdeg/1000000.;
line1 = String("lat: ") + String(latI, 6);
line2 = String("lng: ") + String(lonI, 6);
mapGPS(); //update location on Blynk map
nmea.clear(); // Clear the MicroNMEA storage to make sure we are getting fresh data
}
else
{
// Serial.println("Waiting for fresh data");
}
}
void mapGPS() {
...
sprintf(pmLabel, "PM2.5:%4dug/m3\n", dustvalues1.PM2_5Val_atm); // use PM2.5 value for marker label
// V5 is defined in Datastream as data type "String" and associated in mobile app with Map // widget
Blynk.virtualWrite(V5, markerNum, latID, lonID, pmLabel, newColor); // update marker position=GPS, color=PMAQI (marker color hack for iOS)
...
}
void setup() {
...
timer.setInterval(3000L, getGPS); // get GPS coords.
...
}