Skip to content

Commit

Permalink
Merge pull request #772 from neeraj-khanna/master
Browse files Browse the repository at this point in the history
Device-specific documents
  • Loading branch information
tameraw authored Aug 17, 2016
2 parents d80d720 + 1494375 commit fc5dd94
Show file tree
Hide file tree
Showing 4 changed files with 330 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
platform: dotnet microframework
device: iot.net field gateway
language: csharp
---

Run a simple Csharp sample on IoT.NET Field Gateway device running .Net Microframework
===
---

# Table of Contents

- [Introduction](#Introduction)
- [Step 1: Prerequisites](#Prerequisites)
- [Step 2: Prepare your Device](#PrepareDevice)
- [Step 3: Build and Run the Sample](#Build)

<a name="Introduction"></a>
# Introduction

**About this document**

This document describes how to connect IoT.NET Field Gateway device running .Net Microframework 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

<a name="Prerequisites"></a>
# Step 1: Prerequisites

You should have the following items ready before beginning the process:

- Computer with Git client installed and access to the
[azure-iot-sdks](https://github.com/Azure/azure-iot-sdks) GitHub public repository.
- [Setup your IoT hub][lnk-setup-iot-hub]
- [Provision your device and get its credentials][lnk-manage-iot-hub]
- Innovactive IoT.NET Field Gateway device.

#### Install Visual Studio 2015 and Tools

- To create Windows .NET Micro Framework solutions, you will need to install [Visual Studio 2015](https://www.visualstudio.com/en-us/products/vs-2015-product-editions.aspx). You can install any edition of Visual Studio, including the free Community edition.

After installing Visual Studio, goto Tools option in the menu bar and click on *Extensions and Updates*. Search for 'netmf' and install .NET Micro Framework SDK.

- Depending on specific hardware revision of Innovactive IoT.NET Field Gateway, GHI SDK could be needed in order to build and run provided sample. You can find GHI SDK <a href="https://www.ghielectronics.com/support/netmf">here</a>:

<a name="PrepareDevice"></a>
# Step 2: Prepare your Device

- Provide a power supply for device, either through USB device socket or using provided external terminal connector (12V DC, 0.5 A).

<a name="Build"></a>
# Step 3: Build and Run the Sample

<a name="Step_3_1_Connect"></a>
## 3.1 Connect the Device

- Connect the board to your network using an Ethernet cable. This step is required, as the sample depends on internet access.

- Plug the device into your computer using a micro-USB cable.

<a name="Step_3_2_Build"></a>
## 3.2 Build the Samples

- Start a new instance of Visual Studio 2015. Open the **iothub_csharp_netmf_client.sln** solution (/azure-iot-sdks/csharp) from your local copy of the repository.

- Download pre-configured project <a href="https://dl.dropboxusercontent.com/u/7414592/IoTCert/NetMFDeviceClientHttpSample_43_Innovactive_IoT.NET_Azure_Certified_for_IoT.zip">here</a>

- In Visual Studio, from **Solution Explorer**, navigate to the **NetMFDeviceClientHttpSample_43 version>** project.

- Locate the following code in the **Program.cs** file:

public const string DeviceConnectionString = "<replace>";

- Replace the above placeholder with device connection string you obtained in [Step 1](#Prerequisites) and save the changes.

- To build and deploy the binaries on your device, right-click on the project in the **Solution Explorer**, select **Properties** and navigate to the **.NET Micro Framework** tab.

Select the **Transport** and **Device** which you have connected.

- Build the solution.

<a name="Step_3_3_Run"></a>
## 3.3 Run and Validate the Samples

### 3.3.1 Send Device Events to IoT Hub

- In Visual Studio, from **Solution Explorer**, right-click the sample project, click **Debug &minus;&gt; Start new instance** to build and run the sample.

- See [Manage IoT Hub][lnk-manage-iot-hub] to learn how to observe the messages IoT Hub receives from the application.

### 3.3.2 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.

[lnk-setup-iot-hub]: ../../setup_iothub.md
[lnk-manage-iot-hub]: ../../manage_iot_hub.md
103 changes: 103 additions & 0 deletions doc/get_started/linux-vt-m2m-lv-python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
platform: custom linux
device: vt-m2m-lv
language: python
---

Run a simple PYTHON sample on VT-M2M-LV device running Custom Linux
===
---

# Table of Contents

- [Introduction](#Introduction)
- [Step 1: Prerequisites](#Prerequisites)
- [Step 2: Prepare your Device](#PrepareDevice)
- [Step 3: Build and Run the Sample](#Build)

# Introduction

**About this document**

This document describes how to connect VT-M2M-LV device running Custom Linux 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]
- VT-M2M-LV device.

# Step 2: Prepare your Device
the URL for the device is http://vantrontech.com/hardwares/VT-M2M-LV.htm

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.

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.

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.
2. Open a shell and navigate to the folder **python/build_all/linux** in your local copy of the repository.
3. Run the `./setup.sh` script to install the prerequisite packages and the dependent libraries.
* Setup will default to python 2.7
* 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
4. Run the `./build.sh` script.
* Build will default to python 2.7
* To build with python 3.4 or 3.5, run `./build.sh --build-python 3.4` or `./build.sh --build-python 3.5` respectively


# Step 3: Build and Run the sample
## 3.1 Build SDK and sample

- Open a XShell session and connect to the device.

- 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:

sudo apt-get update

sudo apt-get install -y curl libcurl4-openssl-dev build-essential cmake git python2.7-dev libboost-python-dev

- 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 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:

nano iothub_client_sample_mqtt.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](#Prerequisites) and save the changes.

## 3.2 Send Device Events to IoT Hub:

- Run the sample application using the following command:

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.

[setup-devbox-python]: https://github.com/Azure/azure-iot-sdks/blob/master/doc/get_started/python-devbox-setup.md
[lnk-setup-iot-hub]: ../../setup_iothub.md
[lnk-manage-iot-hub]: ../../manage_iot_hub.md
65 changes: 65 additions & 0 deletions doc/get_started/windows10-supermicro-sys-e200-8b-c.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
platform: windows 10
device: supermicro sys-e200-8b
language: c
---

Run a simple C sample on Supermicro SYS-E200-8B device running Windows 10
===
---

# Table of Contents

- [Introduction](#Introduction)
- [Step 1: Prerequisites](#Prerequisites)
- [Step 2: Prepare your Device](#PrepareDevice)
- [Step 3: Build and Run the Sample](#Build)

<a name="Introduction"/>
# Introduction

**About this document**

This document describes how to connect Supermicro SYS-E200-8B device running Windows 10 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

<a name="Prerequisites"></a>
# Step 1: Prerequisites

You should have the following items ready before beginning the process:

- [Prepare your development environment][setup-devbox-windows]
- [Setup your IoT hub][lnk-setup-iot-hub]
- [Provision your device and get its credentials][lnk-manage-iot-hub]
- [Supermicro SYS-E200-8B device][lnk-supermicro-e200-8b]

<a name="PrepareDevice"></a>
# Step 2: Prepare your Device

- Follow the instructions [here][lnk-supermicro-e200-8b]

<a name="Build"></a>
# Step 3: Build SDK and Run the sample

- Start a new instance of Visual Studio 2015. Open the **azure_iot_sdks.sln** solution in the **cmake** folder in your home directory.

- In Visual Studio, in **Solution Explorer**, navigate to **simplesample_amqp** project, open the **simplesample_amqp.c** file.

- Locate the following code in the file:

static const char* connectionString = "[device connection string]";

- Replace the above placeholder with device connection string you obtained in [Step 1](#Step-1:-Prerequisites) and save the changes.

- See [Manage IoT Hub][lnk-manage-iot-hub] to learn how to observe the messages IoT Hub receives from the application.

- In **Solution Explorer**, right-click the **simplesample_amqp** 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.

- See [Manage IoT Hub][lnk-manage-iot-hub] to learn how to send cloud-to-device messages to the application.

[setup-devbox-windows]: https://github.com/Azure/azure-iot-sdks/blob/master/c/doc/devbox_setup.md
[lnk-setup-iot-hub]: ../../setup_iothub.md
[lnk-manage-iot-hub]: ../../manage_iot_hub.md
[lnk-supermicro-e200-8b]: https://www.supermicro.com/products/system/Mini-ITX/SYS-E200-8B.cfm
65 changes: 65 additions & 0 deletions doc/get_started/windows10-supermicro-sys-e200-9b-c.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
platform: windows 10
device: supermicro sys-e200-9b
language: c
---

Run a simple C sample on Supermicro SYS-E200-9B device running Windows 10
===
---

# Table of Contents

- [Introduction](#Introduction)
- [Step 1: Prerequisites](#Prerequisites)
- [Step 2: Prepare your Device](#PrepareDevice)
- [Step 3: Build and Run the Sample](#Build)

<a name="Introduction"/>
# Introduction

**About this document**

This document describes how to connect Supermicro SYS-E200-9B device running Windows 10 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

<a name="Prerequisites"></a>
# Step 1: Prerequisites

You should have the following items ready before beginning the process:

- [Prepare your development environment][setup-devbox-windows]
- [Setup your IoT hub][lnk-setup-iot-hub]
- [Provision your device and get its credentials][lnk-manage-iot-hub]
- [Supermicro SYS-E200-9B device][lnk-supermicro-e200]

<a name="PrepareDevice"></a>
# Step 2: Prepare your Device

- Follow the instructions [here][lnk-supermicro-e200]

<a name="Build"></a>
# Step 3: Build SDK and Run the sample

- Start a new instance of Visual Studio 2015. Open the **azure_iot_sdks.sln** solution in the **cmake** folder in your home directory.

- In Visual Studio, in **Solution Explorer**, navigate to **simplesample_amqp** project, open the **simplesample_amqp.c** file.

- Locate the following code in the file:

static const char* connectionString = "[device connection string]";

- Replace the above placeholder with device connection string you obtained in [Step 1](#Step-1:-Prerequisites) and save the changes.

- See [Manage IoT Hub][lnk-manage-iot-hub] to learn how to observe the messages IoT Hub receives from the application.

- In **Solution Explorer**, right-click the **simplesample_amqp** 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.

- See [Manage IoT Hub][lnk-manage-iot-hub] to learn how to send cloud-to-device messages to the application.

[setup-devbox-windows]: https://github.com/Azure/azure-iot-sdks/blob/master/c/doc/devbox_setup.md
[lnk-setup-iot-hub]: ../../setup_iothub.md
[lnk-manage-iot-hub]: ../../manage_iot_hub.md
[lnk-supermicro-e200]: https://www.supermicro.com/products/system/Mini-ITX/SYS-E200-9B.cfm

0 comments on commit fc5dd94

Please sign in to comment.