Frostlock
Frostlock

Reputation: 11

Using a geopoint property in Azure IOT Central

I'm using the IOTC firmware (through python).I have been able to upload location data as telemetry. However I have not been able to upload location data as a basic property. Is this possible?

I'm formatting my JSON like this

{"location":{"lon":3.837585, "lat":41.174130}}

I have also tried this

{"location":{"value": {"lon":3.837585, "lat":41.174130}}}

The answer from Roman below shows that it is possible to do it through the MQTT API. But I would like to do it through the Azure iot central firmware with Python.

Upvotes: 0

Views: 539

Answers (1)

Roman Kiss
Roman Kiss

Reputation: 8255

Yes, it is possible to make a Location property. The following screen snippets show this example with a simple PnP template:

  1. create the custom template with one Location property:

enter image description here

  1. Assign the template to the real device (in my test is the device100) and then process its registering and provisioning. For testing purpose I am using my Azure IoT Hub Tester:

enter image description here

As the above picture shows, the reported property has the following format:

{
  "Location":{
    "value":{
      "lat":41.17413,
      "lon":3.837585
    }
  }
}

Publishing the above reported property to the IoT Central, we can see the Location on the dashboard:

enter image description here

Upvotes: 3

Related Questions