зеркало из
1
0
Форкнуть 0
A Python SDK for connecting devices to Microsoft Azure IoT services
Перейти к файлу
microsoft-github-policy-service[bot] c140c0245b
Add SECURITY.md (#999)
Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com>
2022-05-20 11:39:15 -07:00
.devcontainer Enable GitHub Codespaces to Repo (#848) 2021-09-14 14:00:37 -07:00
.github chore: Remove nspkg (#910) 2021-11-24 12:42:27 -08:00
azure-iot-device Remove flake8 F401 and F403 global suppressions (#986) 2022-04-14 12:56:33 -07:00
azure-iot-hub Remove flake8 F401 and F403 global suppressions (#986) 2022-04-14 12:56:33 -07:00
azure_provisioning_e2e feature(azure-iot-device): Support for user-provided SAS Tokens (#692) 2020-10-19 16:41:36 -07:00
device_e2e Remove flake8 F401 and F403 global suppressions (#986) 2022-04-14 12:56:33 -07:00
pip_alias chore: Formally added license files to packages (#918) 2021-12-10 12:36:35 -08:00
scripts Remove flake8 F401 and F403 global suppressions (#986) 2022-04-14 12:56:33 -07:00
sdklab/meantimerecovery chore: move to trusted node image for aedes container (#998) 2022-05-17 17:32:25 -07:00
vsts fix: Added enforcement of Windows VM in release scripts (#978) 2022-03-23 17:16:57 -07:00
.flake8 Remove flake8 F401 and F403 global suppressions (#986) 2022-04-14 12:56:33 -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 AAD token credential authentication (http) (#757) 2021-05-04 15:46:39 -07:00
LICENSE Initial commit 2018-09-13 10:58:00 -07:00
README.md chore: Remove reference to Provisioning Service Client from README(#992) 2022-04-28 15:17:55 -07:00
SECURITY.MD chore: Added Security MD file to the repo (#384) 2019-11-05 08:54:16 -08:00
SECURITY.md Add SECURITY.md (#999) 2022-05-20 11:39:15 -07:00
build_packages.py Packaging + Distribution (#83) 2019-04-22 15:15:39 -07:00
credscan_suppression.json feature(azure-iot-device): Support for proxies in HTTPTransport (#930) 2022-02-07 11:05:25 -08:00
env_setup.py chore: Remove nspkg (#910) 2021-11-24 12:42:27 -08:00
migration_guide.md doc: Update migration guide for receive handlers (#875) 2021-10-13 13:27:12 -07: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 fix(azure-iot-device): Fix flaky HandlerManager tests (#684) 2020-10-14 15:40:43 -07:00
requirements_dev.txt chore(azure-iot-device): Remove support for Python 2.7 and 3.5 (#952) 2022-02-22 15:56:57 -08:00
requirements_test.txt chore(azure-iot-device): Remove support for Python 2.7 and 3.5 (#952) 2022-02-22 15:56:57 -08:00
test_packages.py chore: Remove nspkg (#910) 2021-11-24 12:42:27 -08: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

V2 - We are now GA!

Build Status

This repository contains code for the Azure IoT SDKs for Python. This enables python developers to easily create IoT device solutions that seamlessly connect to the Azure IoT Hub ecosystem.

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

Azure IoT SDK for Python

This repository contains the following libraries:

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.

Installing the libraries

Pip installs are provided for all of the SDK libraries in this repo:

Device Client libraries

IoTHub Service library

Using the libraries

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

You can also view samples in each library:

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

This SDK only supports the MQTT protocol.

Device Client Library (azure-iot-device)

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

IoTHub Service Library (azure-iot-hub)

Registry Manager

Features Status Description
Identity registry (CRUD) ✔️ Use your backend app to perform CRUD operation for individual device or in bulk.
Cloud-to-device messaging ✔️ Use your backend app to send cloud-to-device messages, and set up cloud-to-device message receivers.
Direct Methods operations ✔️ Use your backend app to invoke direct method on device.
Device Twins operations ✔️ Use your backend app to perform device twin operations. *Twin reported property update callback and replace twin are in progress.
Query ✔️ Use your backend app to perform query for information.
Jobs ✖️ Use your backend app to perform job operation.

Releases

The Pythond SDK offers releases for new features, critical bug fixes, and Long Term Support (LTS). Versioning follows semantic versioning, x.y.z. or major.minor.patch. Any time the version is updated, it will be tagged x.y.z.

New Features and Critical Bug Fixes

New features and critical bug fixes (including security updates) will be released on the main branch. These releases will be tagged using the date formatted yyyy-mm-dd. A feature release will bump the minor version and reset the patch version to 0. A critical bug fix will bump the patch version only.

Long Term Support (LTS)

The project offers a Long Term Support (LTS) version to allow users that do not need the latest features to be shielded from unwanted changes.

LTS branches receive all bug fixes that fall in one of these categories:

  • security bugfixes
  • critical bugfixes (crashes, memory leaks, etc.)

No new features or improvements will be picked up in an LTS branch.

LTS branches are named lts_mm_yyyy, where mm and yyyy are the month and year when the branch was created. An example of such a branch is lts_07_2017.

LTS Schedule1

The first LTS version of the Python SDK is scheduled to be available in early 2022

Below is a table showing the mapping of the LTS branches to the packages released.

PIP Package GitHub Branch LTS Tag LTS Start Date Maintenance End Date
N/A

1 All scheduled dates are subject to change by the Azure IoT SDK team.

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.