Overview of Azure IoT Device SDKs
The Azure IoT device SDKs are a set of device client libraries, developer guides, samples, and documentation. The device SDKs help you to programmatically connect devices to Azure IoT services.
As the diagram shows, there are several device SDKs available to fit your device and programming language needs. Guidance on selecting the appropriate device SDK is available in Which SDK should I use. There are also Azure IoT service SDKs available to connect your cloud-based application with Azure IoT services on the backend. This article focuses on the device SDKs, but you can learn more about Azure service SDKs here.
Why should I use the Azure IoT Device SDKs?
To connect devices to Azure IoT, you can build a custom connection layer or use Azure IoT Device SDKs. There are several advantages to using Azure IoT Device SDKs:
|Development cost||Custom connection layer||Azure IoT Device SDKs|
|Support||Need to support and document whatever you build||Have access to Microsoft support (GitHub, Microsoft Q&A, Microsoft Docs, Customer Support teams)|
|New Features||Need to add new Azure features to custom middleware||Can immediately take advantage of new features that Microsoft constantly adds to the IoT SDKs|
|Investment||Invest hundreds of hours of embedded development to design, build, test, and maintain a custom version||Can take advantage of free, open-source tools. The only cost associated with the SDKs is the learning curve.|
Which SDK should I use?
Azure IoT Device SDKs are available in popular programming languages including C, C#, Java, Node.js, and Python. There are two primary considerations when you choose an SDK: device capabilities, and your team's familiarity with the programming language.
When you're choosing an SDK, you'll need to consider the limits of the devices you're using. A constrained device is one that has a single micro-controller (MCU) and limited memory. If you're using a constrained device, we recommend that you use the Embedded C SDK. This SDK is designed to provide the bare minimum set of capabilities to connect to Azure IoT. You can also select components (MQTT client, TLS, and socket libraries) that are most optimized for your embedded device. If your constrained device also runs Azure RTOS, you can use the Azure RTOS middleware to connect to Azure IoT. The Azure RTOS middleware wraps the Embedded C SDK with extra functionality to simplify connecting your Azure RTOS device to the cloud.
An unconstrained device is one that has a more robust CPU, which is capable of running an operating system to support a language runtime such as .NET or Python. If you're using an unconstrained device, the main consideration is familiarity with the language.
Your team’s familiarity with the programming language
Azure IoT device SDKs are implemented in multiple languages so you can choose the language that your prefer. The device SDKs also integrate with other familiar, language-specific tools. Being able to work with a familiar development language and tools, enables your team to optimize the development cycle of research, prototyping, product development, and ongoing maintenance.
Whenever possible, select an SDK that feels familiar to your development team. All Azure IoT SDKs are open source and have several samples available for your team to evaluate and test before committing to a specific SDK.
How can I get started?
The place to start is to explore the GitHub repositories of the Azure Device SDKs. You can also try a quickstart that shows how to quickly use an SDK to send telemetry to Azure IoT.
Your options to get started depend on what kind of device you have:
- For constrained devices, use the Embedded C SDK.
- For devices that run on Azure RTOS, you can develop with the Azure RTOS middleware.
- For devices that are unconstrained, then you can choose an SDK in a language of your choice.
Constrained Device SDKs
These SDKs are specialized to run on devices with limited compute or memory resources. To learn more about common device types, see Overview of Azure IoT device types.
Embedded C SDK
- GitHub Repository
- Reference Documentation
- How to build the Embedded C SDK
- Size chart for constrained devices
Azure RTOS Middleware
Unconstrained Device SDKs
These SDKs can run on any device that can support a higher-order language runtime. This includes devices such as PCs, Raspberry Pis, and smartphones. They're differentiated primarily by language so you can choose whichever library that best suits your team and scenario.
C Device SDK
- GitHub Repository
- Reference Documentation
- Edge Module Reference Documentation
- Compile the C Device SDK
- Porting the C SDK to other platforms
- Developer documentation for information on cross-compiling and getting started on different platforms
- Azure IoT Hub C SDK resource consumption information
C# Device SDK
Java Device SDK
Node.js Device SDK
Python Device SDK
The IoT Hub service SDKs allow you to build applications that easily interact with your IoT Hub to manage devices and security. You can use these SDKs to send cloud-to-device messages, invoke direct methods on your devices, update device properties, and more.
Azure Digital Twins
Azure Digital Twins is a platform as a service (PaaS) offering that enables the creation of knowledge graphs based on digital models of entire environments. These environments could be buildings, factories, farms, energy networks, railways, stadiums, and more—even entire cities. These digital models can be used to gain insights that drive better products, optimized operations, reduced costs, and breakthrough customer experiences. Azure IoT offers service SDKs to make it easy to build applications that use the power of Azure Digital Twins.
Device Provisioning Service
The IoT Hub Device Provisioning Service (DPS) is a helper service for IoT Hub that enables zero-touch, just-in-time provisioning to the right IoT hub without requiring human intervention. DPS enables the provisioning of millions of devices in a secure and scalable way. The DPS Service SDKs allow you to build applications that can securely manage your devices by creating enrollment groups and doing bulk operations.