Connect sensor output to cloud in Node-RED

Overview

Connecting gateway to HDC

Connect 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

Import the Helix Device Cloud Tutorial flow

From menu on upper-right, select Import > Library > HelixDeviceCloudTutorial to import the HDC Send Data Flow.

Left click to place the flow onto the workspace, placing it around the flow from Tutorial 1.

Step 3

Connect the sensor

Click & drag to connect the output (right) of the F to C function node to the input of the HDC send temp exec node.

Step 4

Deploy application

Click Deploy (upper right) to deploy the flow.

Step 5

Debug sensor data (optional)

Left-click and drag a debug node to the right of the HDC send temp exec node. Wire the top output of the HDC send temp exec node to the input of the msg.debug debug node.

Deploy the changes (see Step 4).

Debug output displays in the debug panel on the right side. Click the Debug tab if needed to expose the panel.

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

Step 1

Send Helix Device Cloud data to Charts

Connect the output of the new Temperature chart tag node to the input of the Chart mqtt out node.

This will tag the data received from Helix Device Cloud with the information the charting component needs, then send it to the charts telemetry topic.

Step 2

Deploy application

Click Deploy to deploy the changes.

Step 3

View results on Developer Hub

View the graphs at top of Developer Hub. The temperature charts should now include a line chart showing real-time data from Helix Device Cloud.