Skip to content

Commit d7f3055

Browse files
authored
Merge pull request #982 from neeraj-khanna/master
Device-specific instructions
2 parents 80d11d9 + 4384ab2 commit d7f3055

14 files changed

+1011
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
platform: custom linux
3+
device: vt-m2m-qk
4+
language: python
5+
---
6+
7+
Run a simple PYTHON sample on VT-M2M-QK device running Custom Linux
8+
===
9+
---
10+
11+
# Table of Contents
12+
13+
- [Introduction](#Introduction)
14+
- [Step 1: Prerequisites](#Prerequisites)
15+
- [Step 2: Prepare your Device](#PrepareDevice)
16+
- [Step 3: Build and Run the Sample](#Build)
17+
18+
<a name="Introduction"></a>
19+
# Introduction
20+
21+
**About this document**
22+
23+
This document describes how to connect VT-M2M-QK device running Custom Linux with Azure IoT SDK. This multi-step process includes:
24+
- Configuring Azure IoT Hub
25+
- Registering your IoT device
26+
- Build and deploy Azure IoT SDK on device
27+
28+
<a name="Prerequisites"></a>
29+
# Step 1: Prerequisites
30+
31+
You should have the following items ready before beginning the process:
32+
33+
- [Prepare your development environment][setup-devbox-python]
34+
- [Setup your IoT hub][lnk-setup-iot-hub]
35+
- [Provision your device and get its credentials][lnk-manage-iot-hub]
36+
- VT-M2M-QK device
37+
38+
<a name="PrepareDevice"></a>
39+
# Step 2: Prepare your Device
40+
41+
The URL for the device is <http://vantrontech.com/hardwares/VT-M2M-QK.htm>
42+
43+
The Python module builds on the Azure IoT device SDK for C. Please make sure you can build the C samples as described in [setup-devbox] before you continue in this section.
44+
45+
The Python iothub_client supports python versions 2.7.x, 3.4.x or 3.5.x. Know the appropriate version you would like to build the library with for the following instructions.
46+
47+
1. Ensure that the desired Python version (2.7.x, 3.4 or 3.5.x) is installed and active. Run `python --version` or `python3 --version` at the command line to check the version.
48+
2. Open a shell and navigate to the folder **python/build_all/linux** in your local copy of the repository.
49+
3. Run the `./setup.sh` script to install the prerequisite packages and the dependent libraries.
50+
* Setup will default to python 2.7
51+
* To setup dependencies for python 3.4 or 3.5, run `./setup.sh --python-version 3.4` or `./setup.sh --python-version 3.5` respectively
52+
4. Run the `./build.sh` script.
53+
* Build will default to python 2.7
54+
* To build with python 3.4 or 3.5, run `./build.sh --build-python 3.4` or `./build.sh --build-python 3.5` respectively
55+
56+
57+
<a name="Build"></a>
58+
# Step 3: Build and Run the sample
59+
## 3.1 Build SDK and sample
60+
61+
- Open a XShell session and connect to the device.
62+
63+
- Install the prerequisite packages for the Microsoft Azure IoT Device SDK for Python by issuing the following commands from the command line on your board:
64+
65+
sudo apt-get update
66+
67+
sudo apt-get install -y curl libcurl4-openssl-dev build-essential cmake git python2.7-dev libboost-python-dev
68+
69+
- Download the Microsoft Azure IoT Device SDK to the board by issuing the following command on the board::
70+
71+
git clone --recursive https://github.com/Azure/azure-iot-sdks.git
72+
73+
- Run following commands to build the SDK:
74+
75+
cd python/build_all/linux
76+
sudo ./build.sh
77+
78+
- After a successful build, the `iothub_client.so` Python extension module is copied to the **python/device/samples** folder.
79+
80+
- Navigate to samples folder by executing following command:
81+
82+
cd azure-iot-sdks/python/device/samples/
83+
84+
- Edit the following file using any text editor of your choice:
85+
86+
nano iothub_client_sample.py
87+
88+
- Find the following place holder for device connection string:
89+
90+
connection_string = "[device connection string]"
91+
92+
- Replace the above placeholder with device connection string you obtained in [Step 1](#Prerequisites) and save the changes.
93+
94+
## 3.2 Send Device Events to IoT Hub:
95+
96+
- Run the sample application using the following command:
97+
98+
python iothub_client_sample.py -p mqtt
99+
100+
- See [Manage IoT Hub][lnk-manage-iot-hub] to learn how to observe the messages IoT Hub receives from the application.
101+
102+
## 3.3 Receive messages from IoT Hub
103+
104+
- See [Manage IoT Hub][lnk-manage-iot-hub] to learn how to send cloud-to-device messages to the application.
105+
106+
[setup-devbox-python]: https://github.com/Azure/azure-iot-sdks/blob/master/doc/get_started/python-devbox-setup.md
107+
[lnk-setup-iot-hub]: ../../setup_iothub.md
108+
[lnk-manage-iot-hub]: ../../manage_iot_hub.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
platform: ubuntu
3+
device: infoplc gateway
4+
language: python
5+
---
6+
7+
Run a simple PYTHON sample on InfoPLC Gateway device running Ubuntu
8+
===
9+
---
10+
11+
# Table of Contents
12+
13+
- [Introduction](#Introduction)
14+
- [Step 1: Prerequisites](#Prerequisites)
15+
- [Step 2: Prepare your Device](#PrepareDevice)
16+
- [Step 3: Build and Run the Sample](#Build)
17+
18+
<a name="Introduction"></a>
19+
# Introduction
20+
21+
**About this document**
22+
23+
This document describes how to connect **InfoPLC Gateway** device running **Ubuntu** with Azure IoT SDK. This multi-step process includes:
24+
- Configuring Azure IoT Hub
25+
- Registering your IoT device
26+
- Build and deploy Azure IoT SDK on device
27+
28+
<a name="Prerequisites"></a>
29+
# Step 1: Prerequisites
30+
31+
You should have the following items ready before beginning the process:
32+
33+
- [Setup your IoT hub][lnk-setup-iot-hub]
34+
- [Provision your device and get its credentials][lnk-manage-iot-hub]
35+
- InfoPLC Gateway device.
36+
37+
38+
<a name="PrepareDevice"></a>
39+
# Step 2: Prepare your Device
40+
- Connect InfoPLC Gateway to network.
41+
42+
<a name="Build"></a>
43+
# Step 3: Build and Run the sample
44+
45+
<a name="Load"></a>
46+
## 3.1 Build SDK and sample
47+
48+
- Open a PuTTY session and connect to the device.
49+
50+
- Download the Microsoft Azure IoT Device SDK to the board by issuing the following command on the board::
51+
52+
git clone --recursive https://github.com/Azure/azure-iot-sdks.git
53+
54+
- Run following commands to build the SDK:
55+
56+
cd azure-iot-sdks/python/build_all/linux
57+
./setup.sh --python-version 3.5
58+
sudo ./build.sh --build-python 3.5
59+
60+
- After a successful build, the `iothub_client.so` Python extension module is copied to the **python/device/samples** folder.
61+
62+
- Navigate to samples folder by executing following command:
63+
64+
cd azure-iot-sdks/python/device/samples/
65+
66+
- Edit the following file using any text editor of your choice:
67+
68+
nano iothub_client_sample.py
69+
70+
- Find the following place holder for device connection string:
71+
72+
connectionString = "[device connection string]"
73+
74+
- Replace the above placeholder with device connection string you obtained in [Step 1](#Prerequisites) and save the changes.
75+
76+
## 3.2 Send Device Events to IoT Hub:
77+
78+
- Run the sample application using the following command:
79+
80+
**For AMQP protocol:**
81+
82+
python3 iothub_client_sample.py -p amqp
83+
84+
**For HTTP protocol:**
85+
86+
python3 iothub_client_sample.py -p http
87+
88+
**For MQTT protocol:**
89+
90+
python3 iothub_client_sample.py -p mqtt
91+
92+
- See [Manage IoT Hub][lnk-manage-iot-hub] to learn how to observe the messages IoT Hub receives from the application.
93+
94+
## 3.3 Receive messages from IoT Hub
95+
96+
- See [Manage IoT Hub][lnk-manage-iot-hub] to learn how to send cloud-to-device messages to the application.
97+
98+
[setup-devbox-python]: https://github.com/Azure/azure-iot-sdks/blob/master/doc/get_started/python-devbox-setup.md
99+
[lnk-setup-iot-hub]: ../../setup_iothub.md
100+
[lnk-manage-iot-hub]: ../../manage_iot_hub.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
platform: wince 7.0
3+
device: wise-5231m-3gwa
4+
language: csharp
5+
---
6+
7+
Run a simple Csharp sample on WISE-5231M-3GWA device running WinCE 7.0
8+
===
9+
---
10+
11+
# Table of Contents
12+
13+
- [Introduction](#Introduction)
14+
- [Step 1: Prerequisites](#Step-1-Prerequisites)
15+
- [Step 2: Prepare your Device](#Step-2-PrepareDevice)
16+
- [Step 3: Build and Run the Sample](#Step-3-Build)
17+
18+
<a name="Introduction"></a>
19+
# Introduction
20+
21+
**About this document**
22+
23+
This document describes how to connect WISE-5231M-3GWA device to Azure IoT Hub.
24+
25+
This multi-step process includes:
26+
- Configuring Azure IoT Hub
27+
- Registering your IoT device
28+
- Build and deploy Azure IoT SDK on device
29+
30+
<a name="Step-1-Prerequisites"></a>
31+
# Step 1: Prerequisites
32+
33+
- [Setup your IoT hub][lnk-setup-iot-hub]
34+
- [Provision your device and get its credentials][lnk-manage-iot-hub]
35+
- WISE-5231M-3GWA device.
36+
- Computer with a browser.
37+
38+
39+
<a name="Step-2-PrepareDevice"></a>
40+
# Step 2: Prepare your Device
41+
42+
- Follow the instruction described in this [Quick Start](http://wise.icpdas.com/downloads/manual/WISE-52xx_quick%20start_v1.0.3.pdf) to Connect to the Web interface of WISE-5231M-3GWA.
43+
44+
45+
<a name="Step-3-Build"></a>
46+
# Step 3: Run the sample
47+
48+
- Connect to WISE-5231M-3GWA webpage server via Web browser, login with the default password "Admin".
49+
50+
![wise5231\_step1](media/wise5231-1.png)
51+
52+
- Go to the "Microsoft Azure Setting" page.
53+
54+
![wise5231\_step2](media/wise5231-2.png)
55+
56+
- Input the SAS Token generated by Device Explorer.
57+
58+
![wise5231\_step3](media/wise5231-3.png)
59+
60+
- Edit the Message to send.
61+
62+
![wise5231\_step4](media/wise5231-4.png)
63+
64+
- Click the Save button and write the settings to WISE-5231M-3GWA.
65+
66+
![wise5231\_step5](media/wise5231-5.png)
67+
68+
- Use the DeviceExplorer utility to observe the messages IoT Hub receives from WISE-5231M-3GWA.
69+
70+
![wise5231\_step6](media/wise5231-6.png)
71+
72+
- Use the DeviceExplorer utility to send the messages to WISE-5231M-3GWA.
73+
74+
![wise5231\_step7](media/wise5231-7.png)
75+
76+
77+
[lnk-setup-iot-hub]: ../setup_iothub.md
78+
[lnk-manage-iot-hub]: ../manage_iot_hub.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
platform: Windows 10
3+
device: nanocom-sku
4+
language: csharp
5+
---
6+
7+
Run a simple Csharp sample on NanoCOM-SKU device running Windows 10
8+
===
9+
---
10+
11+
# Table of Contents
12+
13+
- [Introduction](#Introduction)
14+
- [Step 1: Prerequisites](#Prerequisites)
15+
- [Step 2: Prepare your Device](#PrepareDevice)
16+
- [Step 3: Build and Run the Sample](#Build)
17+
18+
<a name="Introduction"></a>
19+
# Introduction
20+
21+
**About this document**
22+
23+
This document describes how to connect NanoCOM-SKU device running Windows 10 with Azure IoT SDK. This multi-step process includes:
24+
- Configuring Azure IoT Hub
25+
- Registering your IoT device
26+
- Build and deploy Azure IoT SDK on device
27+
28+
<a name="Prerequisites"></a>
29+
# Step 1: Prerequisites
30+
31+
You should have the following items ready before beginning the process:
32+
33+
- [Prepare your development environment][setup-devbox-windows]
34+
- [Setup your IoT hub][lnk-setup-iot-hub]
35+
- [Provision your device and get its credentials][lnk-manage-iot-hub]
36+
- NanoCOM-SKU device.
37+
38+
<a name="PrepareDevice"></a>
39+
# Step 2: Prepare your Device
40+
41+
- Enter NanoCOM-SKU product page(http://www.aaeon.com/en/p/com-express-modules-nanocom-sku) download manual and start PICO-BT01 follow the instructions and install the Windows 10 operating system.
42+
43+
<a name="Build"></a>
44+
# Step 3: Build and Run the sample
45+
46+
- Download the [Azure IoT SDK](https://github.com/Azure/azure-iot-sdks) and the sample programs and save them to your local repository.
47+
- Start a new instance of Visual Studio 2015.
48+
- Open the **iothub_csharp_client.sln** solution in the `csharp\device` folder in your local copy of the repository.
49+
- In Visual Studio, from Solution Explorer, navigate to the **samples** folder.
50+
- In the **DeviceClientAmqpSample** project, open the ***Program.cs*** file.
51+
- Locate the following code in the file:
52+
53+
private const string DeviceConnectionString = "<replace>";
54+
55+
- Replace `<replace>` with the connection string for your device.
56+
- In **Solution Explorer**, right-click the **DeviceClientAmqpSample** project, click **Debug**, and then click **Start new instance** to build and run the sample. The console displays messages as the application sends device-to-cloud messages to IoT Hub.
57+
- Use the **DeviceExplorer** utility to observe the messages IoT Hub receives from the **Device Client AMQP Sample** application.
58+
- Refer "Monitor device-to-cloud events" in [DeviceExplorer Usage document](https://github.com/Azure/azure-iot-sdks/blob/master/tools/DeviceExplorer/doc/how_to_use_device_explorer.md) to see the data your device is sending.
59+
- Refer "Send cloud-to-device messages" in [DeviceExplorer Usage document](https://github.com/Azure/azure-iot-sdks/blob/master/tools/DeviceExplorer/doc/how_to_use_device_explorer.md) for instructions on sending messages to device.
60+
61+
[setup-devbox-windows]: https://github.com/Azure/azure-iot-sdks/blob/master/c/doc/devbox_setup.md
62+
[lnk-setup-iot-hub]: ../../setup_iothub.md
63+
[lnk-manage-iot-hub]: ../../manage_iot_hub.md

0 commit comments

Comments
 (0)