Info | ||
---|---|---|
|
Table of Contents |
---|
Overview of Node-Red
Node-RED is fun tool from IBM Research to "wire up the IoT". It's a little program you launch of your computer, which allows you link inputs (sensors, etc.) to outputs (actuators, files, Twitter feeds etc) through a web-based graphical interface.
...
Info | ||
---|---|---|
| ||
To replicate this tutorial, you need to have:
We assume the motes are running the default firmware, in Master mode. We assume the manager is connected your computer over USB, and that all the motes are switched on and have joined the network. We assume you have downloaded the SmartMesh SDK, and are comfortable enough with it that you can launch different applications. |
Installing Node-RED
The first step is to install Node-RED.
...
Tip |
---|
Following the excellent Getting Started guide if you want to learn more about Node-RED. |
Receiving temperature data on Node-RED
Our first Node-RED "flow" (the connections between inputs and outputs, in Node-RED parlance) is to receive temperature data generated by SmartMesh IP motes directly in Node-RED. We will use for that the PublishToWeb sample application of the SmartMesh SDK.
Gliffy | |||
---|---|---|---|
|
...
|
Start the PublishToWeb
SmartMesh SDK sample application
Tip |
---|
The PublishToWeb sample application is part of the SmartMeshSDK. |
...
You will see a line print each time the application receives a temperature reading from one of the motes.
Creating the Node-RED flow
Drag and drop the following "nodes" to build the following flow:
...
Tip | ||
---|---|---|
The following code is the textual representation of the Node-RED flow above. You can simply paste this in the "Import > Clipboard" utility in Node-RED:
|
Blinking LEDs from Node-RED
The goal of this Node-RED flow is to toggle the mote's LED by click on the Node-RED interface:
Gliffy | ||
---|---|---|
|
Start the JsonServer
SmartMesh SDK sample application
Tip |
---|
The JsonServer sample application is part of the SmartMeshSDK. |
Code Block |
---|
JsonServer - SmartMesh SDK 1.0.8.142 (c) Dust Networks serial port of SmartMesh IP Manager (e.g. COM15): COM31 ok. connected to manager at COM31 ok. JSON server started on port 8080 |
Create the Node-RED flow
Drag and drop the following "nodes" to build the following flow:
...
Tip | ||
---|---|---|
The following code is the textual representation of the Node-RED flow above. You can simply paste this in the "Import > Clipboard" utility in Node-RED:
|
Where next?
This tutorial has shown you how to send data from your SmartMesh IP network into Node-RED, and from Node-RED into your SmartMesh IP network.
...