platform | device | language |
---|---|---|
raspbian |
quix sensor gateway |
python |
About this document
This document describes how to connect QuiX Sensor Gateway device running Raspbian with Azure IoT SDK. This multi-step process includes:
- Configuring Azure IoT Hub
- Registering your IoT device
- Build and deploy Azure IoT SDK on device
You should have the following items ready before beginning the process:
- Prepare your development environment
- Setup your IoT hub
- Provision your device and get its credentials
- QuiX Sensor Gateway device.
- Ethernet cable.
- Plug Ethernet Cable.
-
Open a PuTTY session and connect to the device.
-
Download the Microsoft Azure IoT Device SDK to the board by issuing the following command on the board::
git clone --recursive https://github.com/Azure/azure-iot-sdks.git
-
Run following commands to build the SDK:
cd azure-iot-sdks/python/build_all/linux sudo ./build.sh
-
After a successful build, the
iothub_client.so
Python extension module is copied to the python/device/samples folder. -
Navigate to samples folder by executing following command:
cd azure-iot-sdks/python/device/samples/
-
Edit the following file using any text editor of your choice:
For HTTP protocol:
nano iothub_client_sample_http.py
-
Find the following place holder for device connection string:
connectionString = "[device connection string]"
-
Replace the above placeholder with device connection string you obtained in Step 1 and save the changes.
-
Run the sample application using the following command:
For HTTP protocol:
python iothub_client_sample_http.py
-
See Manage IoT Hub to learn how to observe the messages IoT Hub receives from the application.
- See Manage IoT Hub to learn how to send cloud-to-device messages to the application.