platform | device | language |
---|---|---|
ubilinux 3.0 |
UP-board |
c |
- Introduction
- Step 1: Prerequisites
- Step 2: Prepare your Device
- Step 3: Build and Run the Sample
- Tips
About this document
This document describes the process of setting up an UP-board device to connect to an Azure IoT hub. This multi-step process includes:
- Configuring Azure IoT Hub
- Registering your IoT device
- Build and deploy Azure IoT SDK on the UP-board
You should have the following items ready before beginning the process:
- UP-board with access to the azure-iot-sdks GitHub public repository.
- USB keyboard
- USB mouse
- HDMI cable
- TV/ Monitor that supports HDMI
- Ethernet cable or Wi-Fi dongle
- Prepare your development environment
- Setup your IoT hub
- Provision your device and get its credentials
- Download the latest version of ubilinux 3.0 following this link
- Install ubilinx 3.0 by following the Getting started guide
- Login to your system using user ubilinux and same password and open a terminal.
Run the following commands in the terminal.
-
Download the Azure IoT device SDK:
git clone --recursive https://github.com/Azure/azure-iot-sdks.git
-
Confirm that you now have a copy of the SDK under the directory ./azure-iot-sdks. Then cd to the directory:
cd azure-iot-sdks
-
Prepare your environment by running. Answer y when you are prompted to install the additional components needed to run the samples:
sudo c/build_all/linux/setup.sh
-
Edit the file ./c/iothub_client/samples/iothub_client_sample_http/iothub_client_sample_http.c and replace connection string placeholder with the connection string you obtained in the step above. (You can use the console-based text editor vim to edit the file):
static const char* connectionString = "[device connection string]";
Note: You can skip this step if you only want to build the samples without running them.
-
Finally, build the SDK and sample applications:
./c/build_all/linux/build.sh
-
Run the iothub_client_sample_http sample:
sudo ~/cmake/iothub_client/samples/iothub_client_sample_http/iothub_client_sample_http
This sample application sends simulated sensor data to your IoT Hub.
- 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.