From c7c74a6931de4950628bd64fa0b7e32fe573e244 Mon Sep 17 00:00:00 2001 From: "Terry.Qiu" <42408686+suvivi779@users.noreply.github.com> Date: Mon, 4 Nov 2019 15:03:30 +0800 Subject: [PATCH] windows-10-iot-ARCS-python ORISOL Ltd ARCS --- windows-10-iot-ARCS-python | 123 +++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 windows-10-iot-ARCS-python diff --git a/windows-10-iot-ARCS-python b/windows-10-iot-ARCS-python new file mode 100644 index 0000000..4cdc28d --- /dev/null +++ b/windows-10-iot-ARCS-python @@ -0,0 +1,123 @@ +--- +platform: {Windows 10} +device: {ARCS} +language: python +--- + +Run a simple python sample on {enter your device name here} device running {enter the OS name running on device} +=== +--- + +# Table of Contents + +- [Introduction](#Introduction) +- [Step 1: Prerequisites](#Prerequisites) +- [Step 2: Prepare your Device](#PrepareDevice) +- [Step 3: Setup your development environment](#Environment) +- [Step 4: Build and Run the Sample](#Build) +- [Next Steps](#NextSteps) + +# Instructions for using this template + +- Replace the text in {placeholders} with correct values. +- Delete the lines {{enclosed}} after following the instructions enclosed between them. +- It is advisable to use external links, wherever possible. +- Remove this section from final document. + + +# Introduction + +**About this document** + +This document describes how to connect {enter your device name here} device running {enter the OS name running on device} 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 + + +# Step 1: Prerequisites + +You should have the following items ready before beginning the process: + +- [Prepare your development environment][setup-devbox-python] +- [Setup your IoT hub][lnk-setup-iot-hub] +- [Provision your device and get its credentials][lnk-manage-iot-hub] +- {enter your device name here} device. +- {{Please specify if any other software(s) or hardware(s) are required.}} + + +# Step 2: Prepare your Device +- {{Make sure the Internet is on the machine, make sure the OPCUA function is turned on, and then execute the azure-iot connection. Azure}} + + +# Step 3: Build and Run the sample + + +## 3.1 Build SDK and sample + +- Download latest SDK using following command: + + git clone --recursive https://github.com/Azure/azure-iot-sdk-python.git + +- Ensure that the desired Python version is installed (2.7.x, 3.4.x or 3.5.x). Run python --version or python3 --version at the command line to check the version. + +- Open a Visual Studio 2015 x86 Native Tools command prompt and navigate to the folder python/build_all/windows in your local copy of the repository. + +- Run the script build.cmd in the python\build_all\windows directory. + +- As a result, the **iothub_client.pyd** Python extension module is copied to the python/device/samples folder. + +- Navigate to the folder python/device/samples in your local copy of the repository. + +- Open the file **iothub_client_sample_amqp.py**, **iothub_client_sample_http.py** or **iothub_client_sample_mqtt.py** in a text editor. + +- Locate the following code in the file: + + connectionString = "[device connection string]" + +- Replace [device connection string] with the connection string for your device. Save the changes. + +## 3.2 Send Device Events to IoT Hub: + +- Run the sample application using the following command through Visual Studio 2015 x86 Native Tools command prompt and navigate to the folder python/build_all/windows in your local copy of the repository: +{{***Keep the command set based on your protocol(s) and remove the rest.***}} + + {{**If using AMQP protocol:**}} + + python iothub_client_sample_amqp.py + + {{**If using HTTPS protocol:**}} + + python iothub_client_sample_http.py + + {{**If using MQTT protocol:**}} + + python iothub_client_sample_mqtt.py + +- See [Manage IoT Hub][lnk-manage-iot-hub] to learn how to observe the messages IoT Hub receives from the application. + +## 3.3 Receive messages from IoT Hub + +- See [Manage IoT Hub][lnk-manage-iot-hub] to learn how to send cloud-to-device messages to the application. + + +# Next Steps + +You have now learned how to run a sample application that collects sensor data and sends it to your IoT hub. To explore how to store, analyze and visualize the data from this application in Azure using a variety of different services, please click on the following lessons: + +- [Manage cloud device messaging with iothub-explorer] +- [Save IoT Hub messages to Azure data storage] +- [Use Power BI to visualize real-time sensor data from Azure IoT Hub] +- [Use Azure Web Apps to visualize real-time sensor data from Azure IoT Hub] +- [Weather forecast using the sensor data from your IoT hub in Azure Machine Learning] +- [Remote monitoring and notifications with Logic Apps] + +[Manage cloud device messaging with iothub-explorer]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-explorer-cloud-device-messaging +[Save IoT Hub messages to Azure data storage]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-store-data-in-azure-table-storage +[Use Power BI to visualize real-time sensor data from Azure IoT Hub]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-power-bi +[Use Azure Web Apps to visualize real-time sensor data from Azure IoT Hub]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-web-apps +[Weather forecast using the sensor data from your IoT hub in Azure Machine Learning]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-weather-forecast-machine-learning +[Remote monitoring and notifications with Logic Apps]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-monitoring-notifications-with-azure-logic-apps +[setup-devbox-python]: https://github.com/Azure/azure-iot-device-ecosystem/blob/master/get_started/python-devbox-setup.md +[lnk-setup-iot-hub]: ../../setup_iothub.md +[lnk-manage-iot-hub]: ../../manage_iot_hub.md