grafana 与 azure 物联网集线器和 esp32

问题描述 投票:0回答:1

我是一个使用grafana的初学者,这里我尝试使用grafana和azure监视器来读取数据并在仪表板中可视化。我获得的数据来自 azure IoT 中心和接收 json 格式温度数据的设备,例如; {“温度”:25}。 我配置了 azure 监视器和应用程序注册并成功与 azure 监视器集成,但如何读取此特定数据并将其显示在仪表板中。

配置 Grafana 并从 azure 端进行角色分配和应用程序注册。 选择日志并尝试以下查询。

设备 |其中 deviceId == 'ESPDEVICE01' 并且measureName == 'temp' |项目价值

azure grafana esp32 azure-monitor grafana-dashboard
1个回答
0
投票

Azure IoT 中心不充当用于查询数据的遥测数据库。事实上,它会在保留策略中定义的指定时间内存储数据,但您无法从门户直接访问它。要获取数据,您可以执行以下操作 -

  • 在设备遥测消息上创建消息路由,将您的消息路由到外部存储

  • 使用 IoT 中心触发器创建一个 Azure 函数来获取消息,然后您可以通过编程方式路由它们

  • 使用 Azure IoT Device Explorer

    等工具
  • 使用EventProcessorHost库获取数据

  • 另一种方法是将数据/消息数据记录到Application Insights,然后发送到azure IoT Hub

    • 使用 Application Insights 监视服务以及将消息数据从 Azure IoT 中心发送到 Application Insights 的示例代码取自以下文档:
  • 使用 IoT Hub

    发送云到设备消息
  • 使用应用程序Insights监控服务和应用程序。

enter image description here

enter image description here

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.