IoT Hub Device Streams firmware integration

Van Petrosyan 0 Reputation points
2024-11-22T13:35:00.6866667+00:00

Dear Microsoft team,

We are looking to integrate the Device Streams feature into our IoT device firmware, built using Azure SDK for Embedded C and running on Zephyr RTOS. Our goal is to enable remote Zephyr shell access for diagnostics, which Device Streams seems ideal for, as standard IoT Hub endpoints are not efficient for this use case.

However, I couldn’t find any implementation or examples of Device Streams in the Azure SDK for Embedded C. Could you please provide guidance on any existing support or documentation for Device Streams in this SDK.

If this feature isn’t currently supported, are there alternative solutions you recommend?

Thank you for your assistance.

Best,
Van

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,222 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Robina 260 Reputation points
    2024-11-22T14:01:59.1266667+00:00

    Integration of Azure IoT Hub Device Streams into your IoT device firmware, which utilizes the Azure SDK for Embedded C on Zephyr RTOS. Device Streams are indeed designed to facilitate secure, bi-directional TCP tunnels, enabling scenarios like remote diagnostics without the need to open inbound firewall ports on devices. https://zcusa.951200.xyz/en-us/azure/iot-hub/iot-hub-device-streams-overview

    As of now, the Azure SDK for Embedded C does not natively support Device Streams. The primary focus of this SDK is to provide lightweight connectivity solutions for constrained devices, and certain advanced features like Device Streams are not yet implemented.

    Alternative Solutions:

    Given the current limitations, you might consider the following approaches:

    Custom Implementation:

    • Direct Integration: Develop a custom implementation to handle Device Streams by interfacing directly with the Azure IoT Hub's REST APIs. This approach would require a deep understanding of the Device Streams protocol and the ability to manage WebSocket connections within your firmware.
      • Considerations: This method can be resource-intensive and may not be suitable for all embedded devices, especially those with limited processing power and memory.
      Utilize Existing Zephyr RTOS Capabilities:
      - **Remote Shell Access:** Zephyr RTOS offers native support for remote shell access over various transport layers, including UART and network sockets. Leveraging these capabilities might provide a more straightforward solution for remote diagnostics without the need for Device Streams.
      
         - **Implementation:** Configure the Zephyr shell to operate over a secure network connection, such as TLS, to ensure encrypted communication.
      

    Hybrid Approach:

    • Combination of Methods: Implement a secure, custom protocol over MQTT or another supported transport to facilitate remote shell access. This approach would involve sending shell commands and receiving responses as IoT Hub messages, effectively simulating a remote shell session.
      • Considerations: While this method may not provide real-time interactivity comparable to Device Streams, it can serve as a viable alternative for certain diagnostic tasks.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.