BLYNK_CONNECTED()
{
// Send requests for different metadata
Blynk.sendInternal("meta", "get", "Board Type");
Blynk.sendInternal("meta", "get", "Device Location");
Blynk.sendInternal("meta", "get", "Map Coordinates");
}
BLYNK_WRITE(InternalPinMETA) {
String field = param[0].asStr();
if (field == "Board Type")
{
String value = param[1].asStr();
Serial.print("Board Type = ");
Serial.println(value);
}
if (field == "Device Location")
{
String value = param[1].asStr();
Serial.print("Device Loaction = ");
Serial.println(value);
}
if (field == "Map Coordinates")
{
String value = param[1].asStr();
Serial.print("Map Coordinates = ");
Serial.println(value);
}
}
Serial Output…
[2652] Connecting to blynk.cloud:443
[3529] Certificate OK
[3540] Ready (ping: 10ms).
Board Type = ESP32 DevBoard
Device Loaction = The desk in my office
Map Coordinates =
Note that Map Coordinates is blank (or 0.00 if I change to Float).
I also tried param[2].asStr() and param[3].asStr() in the hope that Latitude and Longitude were hidden in there, but no joy.
Also, when you view the Device metadata, the field names are capitalised…
@VIGHNESHNS2008 please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```
So you read the first param lon, in order to read the next one you need to use param[2].asStr(). Right only lon/lat is supported. It was done for one of the clients. I’ll check if can attach more data.
I am able to read latitude and longitude. I tried reading param1,2,3,4,5,6,7,8.
Two have values. Other’s blank. Yhere are other values country state zip