简体   繁体   English

Azure IoT 中心遥测数据到移动应用程序

[英]Azure IoT Hub Telemetry Data to Mobile Application

I'm trying to get data from arduino yun to azure iot hub and read data from mobile app.我正在尝试从 arduino yun 获取数据到 azure iot hub 并从移动应用程序读取数据。 So I created IoT Hub on Azure and able to read telemetry data with nodejs on my computer.因此,我在 Azure 上创建了 IoT Hub,并能够在我的计算机上使用 nodejs 读取遥测数据。 It's working good.它运作良好。 But trying to create react app for reading data.但是试图创建用于读取数据的反应应用程序。 What should I do for best way to handle this.我应该怎么做才能最好地处理这个问题。 I must use react native for mobile application part.我必须对移动应用程序部分使用本机反应。

Project info: Load cell reading data, if change then it will provide info to iot hub as telemetry.项目信息:称重传感器读取数据,如果发生变化,它将作为遥测向物联网中心提供信息。 Then it should inform mobile application created with react native for users.然后它应该通知用户使用本机反应创建的移动应用程序。

For testing using button press right now.立即使用按钮进行测试。 Main code for load cell will deploy in the future.称重传感器的主要代码将在未来部署。 Sending data from arduino yun to local computer and pushing with nodejs application to Azure.将数据从 arduino yun 发送到本地计算机并使用 nodejs 应用程序推送到 Azure。

I manage to solve issue with some escape resolutions:我设法通过一些转义解决方案解决了问题:

  • Used a localhost to get messages from yun and transfer them to iot hub with nodejs backend and libraries.使用本地主机从 yun 获取消息并将它们传输到带有 nodejs 后端和库的 iot hub。
  • Used a webapp for visualize.使用 webapp 进行可视化。 Also now I am able to make a get request from anywhere on my mobile app load.此外,现在我可以在我的移动应用程序负载上从任何地方发出获取请求。 Integrated that in webapp code with endpoint.将其集成到带有端点的 webapp 代码中。
  • Also used websocket to get information from webapp to mobile device.还使用 websocket 从 webapp 获取信息到移动设备。
  • Created custom png file to show different stats and pressed values to text.创建了自定义 png 文件以显示不同的统计数据并将按下的值显示为文本。

I wish that I can send telemetry from device directly to azure.我希望我可以将遥测数据从设备直接发送到 azure。 But couldn't manage to solve that.但无法解决这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM