зеркало из
1
0
Форкнуть 0
A Python SDK for connecting devices to Microsoft Azure IoT services
Перейти к файлу
Walter Bonetti e75d1c2026
fix: importlib_metadata.entry_points attribute error by updating flake8 (#1186)
Co-authored-by: Carter Tinney <carter.tinney@microsoft.com>
2024-07-17 11:04:37 -07:00
.devcontainer Updated dependencies to fix breaking changes in requests (#1189) 2024-07-15 11:21:29 -07:00
.github chore: Remove nspkg (#910) 2021-11-24 12:42:27 -08:00
azure-iot-device/azure/iot/device release: 2.14.0 - 2024-07-15 (#1190) 2024-07-17 08:14:45 -07:00
dev_utils Static analysis fixes (#1154) 2023-08-28 09:52:26 -07:00
doc chore: Restructure repository for single project (#1030) 2022-08-04 12:58:57 -07:00
pip_alias chore: Remove azure-iot-hub source code (#1022) 2022-07-28 12:46:34 -07:00
samples fix: sample disconnect when all the messages are sent (#1176) 2024-07-17 10:40:49 -07:00
scripts Updated dependencies to fix breaking changes in requests (#1189) 2024-07-15 11:21:29 -07:00
sdklab Test: Tests for gate and for fuzzing (#1025) 2022-08-16 09:15:27 -07:00
tests Updated dependencies to fix breaking changes in requests (#1189) 2024-07-15 11:21:29 -07:00
vsts Updated dependencies to fix breaking changes in requests (#1189) 2024-07-15 11:21:29 -07:00
.bumpversion.cfg bump version (#1171) 2024-02-12 12:39:24 -08:00
.flake8 chore: Restructure repository for single project (#1030) 2022-08-04 12:58:57 -07:00
.gitattributes marshal all calls into a single pipeline thread (#133) 2019-07-22 06:03:27 -07:00
.gitignore DeviceClient E2E tests (#861) 2021-10-06 16:17:30 -07:00
.pre-commit-config.yaml fix: importlib_metadata.entry_points attribute error by updating flake8 (#1186) 2024-07-17 11:04:37 -07:00
LICENSE Initial commit 2018-09-13 10:58:00 -07:00
MANIFEST.in chore: Restructure repository for single project (#1030) 2022-08-04 12:58:57 -07:00
README.md Updated dependencies to fix breaking changes in requests (#1189) 2024-07-15 11:21:29 -07:00
SECURITY.md Add SECURITY.md (#999) 2022-05-20 11:39:15 -07:00
credscan_suppression.json chore: Restructure testing directory for future testing (#1045) 2022-08-26 12:27:47 -07:00
devbox_setup.md Fix minor typos (#1036) 2022-08-22 11:29:17 -04:00
migration_guide.md Fix minor typos (#1036) 2022-08-22 11:29:17 -04:00
newtsaupload.gdntsa Change iteration path (#982) 2022-03-30 15:32:25 -07:00
pyproject.toml Add pre-commit hooks for black and flake8 (#23) 2018-11-21 15:23:14 -08:00
pytest.ini chore: Restructure repository for single project (#1030) 2022-08-04 12:58:57 -07:00
requirements_dev.txt chore: Restructure repository for single project (#1030) 2022-08-04 12:58:57 -07:00
requirements_test.txt Removed 3.6 infrastructure (#1170) 2024-02-12 10:55:22 -08:00
setup.py Updated dependencies to fix breaking changes in requests (#1189) 2024-07-15 11:21:29 -07:00
thirdpartynotice.txt fix (azure-iot-device): use paho disconnect/reconnect to refresh sas token (#576) 2020-06-16 07:10:11 -07:00
tls_protocol_version_and_ciphers.md docs: Adding tls document describing what we support (#433) 2020-01-09 14:16:39 -08:00

README.md

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.8 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

✔️ feature available ✖️ feature planned but not yet supported 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 ✔️ 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 ✔️ Send device-to-cloud messages (max 256KB) to IoT Hub with the option to add custom properties.
Receive cloud-to-device messages ✔️ Receive cloud-to-device messages and read associated custom and system properties from IoT Hub.
Device Twins ✔️ 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 ✔️ 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 ✔️ Error reporting for IoT Hub supported error code.
Connection Retry ✔️ 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 ✔️ 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 ✔️ 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 ✔️ Send device-to-cloud messages (max 256KB) to IoT Hub with the option to add custom properties.
Receive cloud-to-device messages ✔️ 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 ✔️ 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 ✔️ 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 ✔️ Error reporting for IoT Hub supported error code.
Connection Retry ✔️ 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 ✔️ Invoke method calls to another module using using the Edge Gateway.

Provisioning Device Client

Features Status Description
TPM Individual Enrollment Provisioning via Trusted Platform Module.
X.509 Individual Enrollment ✔️ 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 ✔️ Provisioning via X.509 leaf certificate). Please review the samples folder on how to create a device client.
Symmetric Key Enrollment ✔️ 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.