繁体   English   中英

Azure IoT Hub - 使用 IoT Hub 从 Azure blob 下载文件到 IoT 设备

[英]Azure IoT Hub - Downloading file from Azure blob using IoT Hub to an IoT device

我有一个用例,我需要将文件从 Azure blob 位置下载到在 IoT 中心注册的 IoT 设备。

在这种情况下,我将向 IoT 设备(通过 IoT 中心)发送一条指令,以从 Azure blob 位置下载文件到机器上的特定目标(运行 IoT 设备应用程序的位置)。

这些指令将使用后端(自定义)应用程序通过 IoT 中心发送。

只是想知道 Azure IoT Hub 目前是否支持这个我可以直接在 IoT Device 应用程序中使用的工具(通过使用 Azure IoT API)。

任何参考都会有所帮助。

谢谢,

阿维纳什·德什穆赫

是的,当然。 As I known, you can generate an url of an Azure Blob file with its SAS token to send it as a cloud-to-device message from IoTHub, then to receive it from IoT device and to download file via the file url with SAS token直接在物联网设备上。

作为参考,您可以参考这些官方文档来尝试实现它。

  1. 要使用 SAS 令牌生成 blob url,请参阅Create an account SAS with .NET If you are using Java, I think it's very simple for you to write the Java one with Azure Storage SDK for Java.
  2. 要从 IoTHub Send cloud-to-device messages with IoT Hub (Java)
  3. 要在设备上接收 c2d 消息,所有语言的 REST API 是Device - Receive Device Bound Notification 或者您可以通过搜索关键字D2C来参考示例代码SendReceive.java部分,以了解如何从IoT Hub中检索消息。
  4. 如果您必须从设备上的 IoT 中心获取带有 SAS 令牌的 blob url,我认为从公共链接下载文件并不难。

希望能帮助到你。

是的,您可以通过使用 azure 云到设备消息传递来做到这一点。您可以直接传递 blob object url 的数据参数,但请确保它属于正确的安全组。 您可以关注文章https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-messages-c2d

暂无
暂无

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

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