0

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?

  • Since my device isn't supposed to move around I wasn't planning on sending telemetry location. I would prefer just to send the location once as a device property when the device boots and connects to Azure IOT Central.
  • The location datatype is GeoPoint which enables to plot it on a map in Azure IOT Central.

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.

Frostlock
  • 11
  • 2

1 Answers1

3

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

Roman Kiss
  • 7,925
  • 1
  • 8
  • 21
  • Thanks Roman! That looks to prove that it is indeed possible to put a Geopoint in a Location property on a map :) That looks to point to the IOTC firmware of which I'm using the python flavor has an issue (Or I'm doing something wrong :)). I'm looking for a way to do it from Python. – Frostlock Jan 10 '20 at 19:29