Retrieving Location from Meta data

I need to retrieve the location set for my device in the Blynk.Console to use on my device.
According to the documentation I should use Blynk.sendInternal("meta", "get", "Location") and when I use this, I do get an answer on my BLYNK_WRITE(InternalPinMETA) implementation, but only params[0] is present with the property name, nml “Location”.

Also looking at examples in the chapter on retrieving Timezone / Location information (Timezone / Location - Blynk Documentation), it looks like its possible to retrieve this according to the example output at the top of the page.

All the examples on retrieving time and timezone information using Blynk.sendInternal("utc", ...) do work by the way

Am I doing something wrong, or is this implementation still not completed, as suggested on som eold posts about this topic?

Pete.

Thanks for the link, I’ve read it and as I understand it Dimity has fixed the problems the OP posted (Read Metadata values of Location or Text - #22 by Dmitriy) …

I tried the following internal commands, logging the results with this code:

BLYNK_WRITE(InternalPinMETA) {
  String field = param[0].asStr();
  String value = param[1].asStr();
  log_i("Param %s = %s", field, value);
}

Blynk.sendInternal("meta", "get", "Location") => Param Location =
Blynk.sendInternal("meta", "get", "Device Location") => Param ���?␏ =
Blynk.sendInternal("meta", "get", "Location of Device") => Param ���?␟ =

For my device, both the Lat/Lon are set (although they are set by the location of the Sim provider) and the Location is set from the Locations available in the organization.

I found what I did wrong :roll_eyes:
the log statement uses field and value in stead of field.c_str() and value.c_str()

But, I’m still not getting the location values!

So, with the corrected logging

  log_i("meta data received");
  uint8_t cnt = 0;
  while (param[cnt].isValid()) {
    log_i("%s", param[cnt++].asStr());
  }

These commands are send:

  Blynk.sendInternal("meta", "get", "backEndUrl");  // Manual created metadata
  Blynk.sendInternal("meta", "get", "IP LAT/LON");
  Blynk.sendInternal("meta", "get", "Device Location"); 
  Blynk.sendInternal("meta", "get", "Location of device"); 

results:

[  3167][I][BlynkNodeSim7x00.cpp:60] BlynkWidgetWriteInternalPinMETA(): meta data received
[  3167][I][BlynkNodeSim7x00.cpp:63] BlynkWidgetWriteInternalPinMETA(): backEndUrl
[  3168][I][BlynkNodeSim7x00.cpp:63] BlynkWidgetWriteInternalPinMETA(): https://[edited]
[  3352][I][BlynkNodeSim7x00.cpp:60] BlynkWidgetWriteInternalPinMETA(): meta data received
[  3352][I][BlynkNodeSim7x00.cpp:63] BlynkWidgetWriteInternalPinMETA(): IP LAT/LON
[  3656][I][BlynkNodeSim7x00.cpp:60] BlynkWidgetWriteInternalPinMETA(): meta data received
[  3656][I][BlynkNodeSim7x00.cpp:63] BlynkWidgetWriteInternalPinMETA(): Device Location   
[  4916][I][BlynkNodeSim7x00.cpp:60] BlynkWidgetWriteInternalPinMETA(): meta data received
[  4917][I][BlynkNodeSim7x00.cpp:63] BlynkWidgetWriteInternalPinMETA(): Location of device
1 Like