Skip to content

Latest commit

 

History

History
108 lines (79 loc) · 3.52 KB

ubilinux-up-board.md

File metadata and controls

108 lines (79 loc) · 3.52 KB
platform device language
ubilinux 3.0
UP-board
c

Run a simple C sample on the UP-board running ubilinux 3.0


Table of Contents

Introduction

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

Step 1: Prerequisites

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

Step 2: Prepare your Device

  • 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.

Step 3: Build and Run the sample

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 IoT Hub Client Sample HTTP sample application
  • 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.