Skip to main content

Microsoft Azure IoT Device Library

Project description

azure-iot-device

Build Status

The Azure IoT Device SDK for Python enables Python developers to easily create IoT device solutions that seamlessly connect to the Azure IoT Hub ecosystem.

  • If you're looking for the azure-iot-hub library, it is now located in the azure-iot-hub-python repository

  • If you're looking for the v1.x.x client library, it is now preserved in the v1-deprecated branch.

Installing the library

The Azure IoT Device library is available on PyPI:

pip install azure-iot-device

Python 3.6 or higher is required in order to use the library

Using the library

API documentation for this package is available via Microsoft Docs.

See our quickstart guide for step by step instructions for setting up and using an IoTHub with devices.

You can also view the samples repository to see additional examples of basic client usage.

Want to start off on the right foot? Be sure to learn about common pitfalls of using this Python SDK before starting a project.

Features

:heavy_check_mark: feature available :heavy_multiplication_x: feature planned but not yet supported :heavy_minus_sign: no support planned*

*Features that are not planned may be prioritized in a future release, but are not currently planned

These clients only support the MQTT protocol.

IoTHub Device Client

Features Status Description
Authentication :heavy_check_mark: Connect your device to IoT Hub securely with supported authentication, including symmetric key, X-509 Self Signed, Certificate Authority (CA) Signed, and SASToken
Send device-to-cloud message :heavy_check_mark: Send device-to-cloud messages (max 256KB) to IoT Hub with the option to add custom properties.
Receive cloud-to-device messages :heavy_check_mark: Receive cloud-to-device messages and read associated custom and system properties from IoT Hub.
Device Twins :heavy_check_mark: IoT Hub persists a device twin for each device that you connect to IoT Hub. The device can perform operations like get twin tags, subscribe to desired properties.
Direct Methods :heavy_check_mark: IoT Hub gives you the ability to invoke direct methods on devices from the cloud. The SDK supports handler for method specific and generic operation.
Connection Status and Error reporting :heavy_check_mark: Error reporting for IoT Hub supported error code.
Connection Retry :heavy_check_mark: Dropped connections will be retried with a fixed 10 second interval by default. This functionality can be disabled if desired, and the interval can be configured
Upload file to Blob :heavy_check_mark: A device can initiate a file upload and notifies IoT Hub when the upload is complete.

IoTHub Module Client

Note: IoT Edge for Python is scoped to Linux containers & devices only. Learn more about using Linux containers for IoT edge on Windows devices.

Features Status Description
Authentication :heavy_check_mark: Connect your device to IoT Hub securely with supported authentication, including symmetric key, X-509 Self Signed, and Certificate Authority (CA) Signed. SASToken authentication is not currently supported.
Send device-to-cloud message :heavy_check_mark: Send device-to-cloud messages (max 256KB) to IoT Hub with the option to add custom properties.
Receive cloud-to-device messages :heavy_check_mark: Receive cloud-to-device messages and read associated custom and system properties from IoT Hub, with the option to complete/reject/abandon C2D messages.
Device Twins :heavy_check_mark: IoT Hub persists a device twin for each device that you connect to IoT Hub. The device can perform operations like get twin tags, subscribe to desired properties.
Direct Methods :heavy_check_mark: IoT Hub gives you the ability to invoke direct methods on devices from the cloud. The SDK supports handler for method specific and generic operation.
Connection Status and Error reporting :heavy_check_mark: Error reporting for IoT Hub supported error code.
Connection Retry :heavy_check_mark: Dropped connections will be retried with a fixed 10 second interval. TThis functionality can be disabled if desired, and the interval can be configured
Direct Invocation of Method on Modules :heavy_check_mark: Invoke method calls to another module using using the Edge Gateway.

Provisioning Device Client

Features Status Description
TPM Individual Enrollment :heavy_minus_sign: Provisioning via Trusted Platform Module.
X.509 Individual Enrollment :heavy_check_mark: Provisioning via X.509 root certificate. Please review the samples folder and this quickstart on how to create a device client.
X.509 Enrollment Group :heavy_check_mark: Provisioning via X.509 leaf certificate). Please review the samples folder on how to create a device client.
Symmetric Key Enrollment :heavy_check_mark: Provisioning via Symmetric key attestation). Please review the samples folder on how to create a device client.

Critical Upcoming Changes Notice

Certificates

All Azure IoT SDK users are advised to be aware of upcoming TLS certificate changes for Azure IoT Hub and Device Provisioning Service that will impact the SDK's ability to connect to these services. In October 2022, both services will migrate from the current Baltimore CyberTrust CA Root to the DigiCert Global G2 CA root. There will be a transition period beforehand where your IoT devices must have both the Baltimore and Digicert public certificates installed in their certificate store in order to prevent connectivity issues.

Devices with only the Baltimore public certificate installed will lose the ability to connect to Azure IoT hub and Device Provisioning Service in October 2022.

To prepare for this change, make sure your device's certificate store has both of these public certificates installed.

For a more in depth explanation as to why the IoT services are doing this, please see this article.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

azure-iot-device-2.12.0.tar.gz (134.7 kB view details)

Uploaded Source

Built Distribution

azure_iot_device-2.12.0-py3-none-any.whl (167.3 kB view details)

Uploaded Python 3

File details

Details for the file azure-iot-device-2.12.0.tar.gz.

File metadata

  • Download URL: azure-iot-device-2.12.0.tar.gz
  • Upload date:
  • Size: 134.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.5

File hashes

Hashes for azure-iot-device-2.12.0.tar.gz
Algorithm Hash digest
SHA256 a15a211341430674fa2959f4a87ac39d2ba1f7f0b8bfb09d94a4f1f1be27fb09
MD5 2fc64a53b199806f47ad5ac4316c6986
BLAKE2b-256 3527021fa4e4968ad83193ec18c8998ef416d3fbf9916e77167ce3fe6c21c30d

See more details on using hashes here.

File details

Details for the file azure_iot_device-2.12.0-py3-none-any.whl.

File metadata

File hashes

Hashes for azure_iot_device-2.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5352fec7250c2a4ae4a7863d60f3f55ff81f4e023c507abb95ea6f569be7e51
MD5 15c3192ecfcc0583f1d9da77af57666a
BLAKE2b-256 c0a9781a75901b1dccf8cbbe6b0ac7d1fdabf27600352ad4fe78776780e89e5d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page