I have an Electron, updated the firmware, implemented and tested the Google Maps API integration.
Now I’m using the sample code (and added a serial print output).
#include <google-maps-device-locator.h>
SerialLogHandler logHandler;
GoogleMapsDeviceLocator locator;
void setup() {
Serial.begin(9600);
// Scan for visible networks and publish to the cloud every 30 seconds
// Pass the returned location to be handled by the locationCallback() method
locator.withSubscribe(locationCallback).withLocatePeriodic(30);
}
void locationCallback(float lat, float lon, float accuracy) {
// Handle the returned location data for the device. This method is passed three arguments:
// - Latitude
// - Longitude
// - Accuracy of estimated location (in meters)
String Coordinates;
Coordinates = String::format("{\"lat\":%f,\"lon\":%f,\"accuracy\":%d}", lat, lon, accuracy);
Serial.print("Sending Coordinates : ");
Serial.println(Coordinates);
}
void loop() {
locator.loop();
}
However, I can’t see the Coordinates:
publishLocation
scanData={"c":{"o":"O2 - DE","a":[{"i":145105418,"l":40214,"c":262,"n":3}]}}
0000048129 [comm.protocol] INFO: rcv'd message type=13
publishLocation
scanData={"c":{"o":"O2 - DE","a":[{"i":145105418,"l":40214,"c":262,"n":3}]}}
0000082545 [comm.protocol] INFO: rcv'd message type=13
publishLocation
scanData={"c":{"o":"O2 - DE","a":[{"i":145105418,"l":40214,"c":262,"n":3}]}}
0000105289 [comm.protocol] INFO: rcv'd message type=13