Connect sensor output to cloud in Node-Red

Overview

Connecting gateway to HDC

Connecting the gateway to the Wind River® Helix™ Device Cloud to send sensor telemetry data to Device Cloud and retrieve it back from the cloud to display on local dashboard.

Why?

Demonstrate how-to connect the Intel IoT gateway to the Helix Device Cloud to send telemetry data (default CPU temperature) and retrieve data from the HDC server.

Prepare

A) Gateway is connected to Internet
B) Complete Tutorial #1: Setup a Sensor in Node-Red
C) Show info panel using upper-right menu: Toggle Sidebar & click Info tab

Part 1 of 2: Send sensor data to Helix Device Cloud

Step 1

Open Node-Red

Navigate to Sensors then click MANAGE SENSORS to open Node-Red

Step 2

Create a sheet

Click on the [+] tab to create a new sheet.

Double click on the new tab, rename it to Tutorial 2-send then click OK

Step 3

Import HDC Send Flow

From menu on upper-right, select Import > Library > hdc-send-tutorial which import the HDC Send Data Flow.

Left click to place the flow onto the workspace.

Step 4

Add a sensor node

From subflows menu, click & drag the RH-USB sensor node to the Tutorial 2-send sheet.

Step 5

Connect the sensor

Click & drag to connect the output (right) of Collect temperature (Inject) node to the input (left) RH-USB node.

Step 6

Add HDC send node

From subflows menu, click & drag HDC send node to the Tutorial 2-send sheet

Step 7

Connect to HDC send

Connect the RH-USB node to the HDC send node.

Step 8

Add debug

From output menu, click & drag the debug node to Tutorial 2-send sheet and connect the HDC send to the debug node.

Step 9

Deploy application

Click Deploy (upper right) to deploy the flow.

Step 10

Start reading sensor data

Click button to left of Collect temperature node to start collecting temperature.

Click on the debug node to enable debug message. The debug output should display in the debug panel on the right side. (click Debug tab if needed to view contents)

Part 2 of 2: Receive data from Helix Device Cloud to display on local graph

Step 1

Create a sheet

Click on the [+] tab to create a new sheet.

Double click on the new tab, rename it to Tutorial 2-receive then click OK

Step 2

Import HDC Receive Flow

From menu on right side, click Import > Library > hdc-receive-tutorial to import the HDC Receive Flow.

Left click to place the flow onto the workspace.

Step 3

Configure the gateway reads data rate

Double-click on the Inject “Read HDC data every 5sec” node to configure the gateway reading HDC data rate. Change the repeat interval to a desired rate. Click OK when done

Step 4

Deploy application

Click Deploy to deploy the flow.

Step 5

Start reading cloud data

Click button to left of Inject node to start reading HDC data from cloud.

Click on the debug node to enable debug message. Debug values should display under the debug panel on right side.

Step 6

View results on Developer Hub

View the graphs at top of Developer Hub. The temperature and humidity graphs should include real time cloud data.

The cloud data has been sent to HDC then retrieved back from the cloud.