This folder contains simple samples showing how to use the various features of the Microsoft Azure IoT Hub service from a back-end application running Python.
- Device Registry manager operations sample: shows how to use the IoT Hub device Registry (create, update, delete devices...)
- C2D Messaging sample: shows how to send Cloud to Device Messages
- Device Twins sample: shows how to work with Device Twins from a back-end application
- Device Method sample: shows how to invoke a direct device Method from a back-end application
And if you are looking for end to end samples that show how to do simple analytics and processing of the data generated by your device using Azure services such as Stream Analytics, Big Data, Machine Learning and others, check out our E2E samples gallery.
In order to run the service samples you will first need the following prerequisites:
Note: On Windows, it is recommended to install the iothub-service-client module package using pip (see link above).
- Create an Azure IoT Hub instance
- Get the sample files:
- if you have cloned the repository, Navigate to the folder service/samples
- if you are using the iothub_service_client module installed with pip, download the samples folder content to your target.
- To learn more about the command line options to be passed for each of the samples, type the following command (replacing
sample_file.py
with the sample file of your choice):python sample_file.py -h