Skip to content

Commit fadc93f

Browse files
author
ashokkhurana
authored
Merge pull request Azure#33 from neeraj-khanna/master
Device-specific instructions
2 parents ed9bfe9 + 32e1a8f commit fadc93f

File tree

2 files changed

+183
-0
lines changed

2 files changed

+183
-0
lines changed

get_started/ubuntu-adle3800pc-c.md

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
---
2+
platform: ubuntu
3+
device: adle3800pc
4+
language: c
5+
---
6+
7+
Run a simple C sample on ADLE3800PC 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 ADLE3800PC device running Ubuntu with Azure IoT SDK. This multi-step process includes:
24+
25+
- Configuring Azure IoT Hub
26+
- Registering your IoT device
27+
- Build and deploy Azure IoT SDK on device
28+
29+
<a name="Prerequisites"></a>
30+
# Step 1: Prerequisites
31+
32+
You should have the following items ready before beginning the process:
33+
34+
- [Prepare your development environment][setup-devbox-linux]
35+
- [Setup your IoT hub][lnk-setup-iot-hub]
36+
- [Provision your device and get its credentials][lnk-manage-iot-hub]
37+
- ADLE3800PC device
38+
39+
<a name="PrepareDevice"></a>
40+
# Step 2: Prepare your Device
41+
42+
- Install Ubuntu 14.04 on ADLE3800PC
43+
44+
<a name="Build"></a>
45+
# Step 3: Build and Run the sample
46+
47+
<a name="Load"></a>
48+
## 3.1 Build SDK and sample
49+
50+
- Open a PuTTY session and connect to the device.
51+
52+
- Install the prerequisite packages for the Microsoft Azure IoT Device SDK for C by issuing the following commands from the command line on your board:
53+
54+
sudo apt-get update
55+
56+
sudo apt-get install -y curl libcurl4-openssl-dev uuid-dev uuid g++ make cmake git unzip openjdk-7-jre
57+
58+
- Download the Microsoft Azure IoT Device SDK for C to the board by issuing the following command on the board::
59+
60+
git clone --recursive https://github.com/Azure/azure-iot-sdks.git
61+
62+
- Edit the following file using any text editor of your choice:
63+
64+
**For AMQP protocol:**
65+
66+
azure-iot-sdks/c/iothub_client/samples/iothub_client_sample_amqp/iothub_client_sample_amqp.c
67+
68+
**For HTTPS protocol:**
69+
70+
azure-iot-sdks/c/iothub_client/samples/iothub_client_sample_http/iothub_client_sample_http.c
71+
72+
**For MQTT protocol:**
73+
74+
azure-iot-sdks/c/iothub_client/samples/iothub_client_sample_mqtt/iothub_client_sample_mqtt.c
75+
76+
- Find the following place holder for IoT connection string:
77+
78+
static const char* connectionString = "[device connection string]";
79+
80+
- Replace the above placeholder with device connection string you obtained in [Step 1](#Prerequisites) and save the changes.
81+
82+
- Build the SDK using following command.
83+
84+
sudo ./azure-iot-sdks/c/build_all/linux/build.sh
85+
86+
## 3.2 Send Device Events to IoT Hub:
87+
88+
- Run the sample by issuing following command:
89+
90+
**If using AMQP protocol:**
91+
92+
~/azure-iot-sdks/c/cmake/iotsdk_linux/iothub_client/samples/iothub_client_sample_amqp/iothub_client_sample_amqp
93+
94+
**If using HTTP protocol:**
95+
96+
~/azure-iot-sdks/c/cmake/iotsdk_linux/iothub_client/samples/iothub_client_sample_http/iothub_client_sample_http
97+
98+
**If using MQTT protocol:**
99+
100+
~/azure-iot-sdks/c/cmake/iotsdk_linux/iothub_client/samples/iothub_client_sample_mqtt/iothub_client_sample_mqtt
101+
102+
- See [Manage IoT Hub][lnk-manage-iot-hub] to learn how to observe the messages IoT Hub receives from the application.
103+
104+
## 3.3 Receive messages from IoT Hub
105+
106+
- See [Manage IoT Hub][lnk-manage-iot-hub] to learn how to send cloud-to-device messages to the application.
107+
108+
<a name="tips"></a>
109+
# Tips
110+
111+
- If you just want to build the serializer samples, run the following commands:
112+
113+
```
114+
cd ./c/serializer/build/linux
115+
make -f makefile.linux all
116+
```
117+
118+
[setup-devbox-linux]: https://github.com/Azure/azure-iot-sdk-c/blob/master/doc/devbox_setup.md
119+
[lnk-setup-iot-hub]: ../setup_iothub.md
120+
[lnk-manage-iot-hub]: ../manage_iot_hub.md
+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
platform: windows 10
3+
device: ops-t200
4+
language: csharp
5+
---
6+
7+
Run a simple Csharp sample on OPS-T200 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 OPS-T200 device running Windows 10 with Azure IoT SDK. This multi-step process includes:
24+
25+
- Configuring Azure IoT Hub
26+
- Registering your IoT device
27+
- Build and deploy Azure IoT SDK on device
28+
29+
<a name="Prerequisites"></a>
30+
# Step 1: Prerequisites
31+
32+
You should have the following items ready before beginning the process:
33+
34+
- [Prepare your development environment](https://github.com/Azure/azure-iot-sdk-c/blob/master/doc/devbox_setup.md)
35+
- [Setup your IoT hub](https://github.com/Azure/azure-iot-device-ecosystem/blob/master/setup_iothub.md)
36+
- [Provision your device and get its credentials](https://github.com/Azure/azure-iot-device-ecosystem/blob/master/manage_iot_hub.md)
37+
- OPS-T200 device.
38+
39+
<a name="PrepareDevice"></a>
40+
# Step 2: Prepare your Device
41+
42+
- Follow the instructions from [device website](http://www.weibu.com/Products/Mini_Box/Show/?pid=66)
43+
44+
<a name="Build"></a>
45+
# Step 3: Build and Run the sample
46+
47+
- Download the [Azure IoT SDK](https://github.com/Azure/azure-iot-sdks) and the sample programs and save them to your local repository.
48+
- Start a new instance of Visual Studio 2015.
49+
- Open the **iothub_csharp_client.sln** solution in the `csharp\device` folder in your local copy of the repository.
50+
- In Visual Studio, from Solution Explorer, navigate to the **samples** folder.
51+
- In the **DeviceClientAmqpSample** project, open the ***Program.cs*** file.
52+
- Locate the following code in the file:
53+
54+
private const string DeviceConnectionString = "<replace>";
55+
56+
- Replace `<replace>` with the connection string for your device.
57+
- 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.
58+
- Use the **DeviceExplorer** utility to observe the messages IoT Hub receives from the **Device Client AMQP Sample** application.
59+
60+
61+
[setup-devbox-windows]: https://github.com/Azure/azure-iot-sdk-c/blob/master/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)