View on GitHub

project15

Project 15 from Microsoft | Open Platform Repository

Connect IoT devices to the Open Platform

This document walks through :

  1. Provisioning a device to Open Platform
  2. Visualizing data from devices

Requirements

Provisioning a device to Open Platform

In order to consume (e.g. visualize) data from a device, the device must be provisioned. Provisioning device means :

  1. Creating device identity in IoT Hub
  2. Prepare a device
  3. Authenticating the device
  4. Establishing a connection

1 : Creating a device identity in IoT Hub

A device must be known to the solution. Creating a device identity means registering a device entity in IoT Hub.

  1. In Open Platform Portal, click Add Device

    Provision 01

  2. Enter a new device ID

    E.g. MyDevice01

    Provision 02

  3. Make sure the device is added to the list

    Provision 03

2. Preparing a device

Each device firmware/device app has their own way of programming authentication information. For this demo, we will use Raspberry Pi Azure IoT Online Simulator.

  1. Browse to Raspberry Pi Azure IoT Online Simulator with your browser
  2. Select the new device you created above
  3. Click Copy Connection String to copy connection string into clipboard

    Provision 04

  4. Replace [Your IoT hub device connection string] with the connection string

    Provision 04

    [!IMPORTANT]
    Ensure the connection string is inside single quotes ` `

    Correct
    const connectionString = `HostName=P15-IoTHub-jq…….`;

    Incorrect
    const connectionString = HostName=P15-IoTHub-jqs…….;

    Example :

    Provision 06

3. Connecting the simulator to Open Platform

A device with authentication information (Connection String) can connect to IoT Hub.

  1. Click Run button to connect and start sending simulated telemetry to Open Platform.

    Provision 07

  2. Switch to Open Platform portal

    Confirm telemetry and events are pushed to the portal

    Provision 08

Visualizing telemetry

Open Platform pushes raw telemetry data to the web site using SignalR, as well as store them into TSI.

You can visualize telemetry from the device by querying TSI and draw a line chart.

Without IoT Plug and Play support, you must know the name of telemetry data and data type (Double or Long).

To visualize telemetry from Non IoT Plug and Play device, you must specify these information to send query to TSI.

  1. Enter telemetry data name
  2. Select telemetry data type
  3. Click Refresh to show telemetry in a line chart

    Telemetry 02

Next Step

Project 15 from Microsoft - Open Platform