【问题标题】:What is the correct format for location that works with azure iot central's device property?与 azure iot Central 的设备属性一起使用的位置的正确格式是什么?
【发布时间】:2019-02-14 03:26:28
【问题描述】:

我使用 (11.111, -116.11) 和 dms 格式的位置浮点更新了设备属性,但仪表板中的 Azure 地图似乎没有更新。有人有什么想法吗?

【问题讨论】:

    标签: azure-iot-central


    【解决方案1】:

    如果您使用的是 .Net API,可以如下指定位置(代码示例):

    TwinCollection reportedProperties = new TwinCollection();
    
    reportedProperties["devicelocation"] = new { lon= 122, lat= 45 };
    

    【讨论】:

      【解决方案2】:

      以下是定位设备属性负载的示例:

      “设备位置”:{ “纬度”:122, “隆”:45 }

      在本例中,“devicelocation”是您在定义设备模型时必须声明的字段名称。

      【讨论】:

      • 我也在努力解决这个问题,并尝试了 sn-p 但无法在 iOT Central 上设置设备属性。在我的情况下,该属性被命名为“location_data_key”,当我发送数据时,我只能看到[object object]。请您详细说明您的答案吗?
      • @Rodrigo - 你能在这里分享代码吗? code/firmware samples 提供了有关如何将位置数据作为报告属性发送到 IoT Central 的示例。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多