A visual tool for wiring the Internet of Things

RED

Node-RED provides a browser-based UI for creating flows of events and deploying them to its light-weight runtime. With built in node.js, it can be run at the edge of the network or in the cloud. The node package manager (npm) ecosystem can be used to easily extend  the palette of nodes available, enabling connections to new devices and services.

node-red-screenshot-sm
http://nodered.org/

What is Node-RED?

At first glance the interface for Node-RED may remind users of Scratch, the MIT-developed graphical tool that allows children to code simple programs by dragging and dropping software commands.

Like Scratch users of Node-RED provides a GUI where users drag-and-drop blocks that represent components of a larger system, in Node-RED’s case usually the devices, software platforms and web services that are to be connected. Further blocks can be placed in between these components to represent software functions that wrangle and transform the data in transit.

Perhaps the best way to understand what Node-RED is is to see it. Below is Node-RED’s representation of a “Hello World” program, commonly used to introduce someone to a new technology or programming language. For those unfamiliar this program is usually a very simple routine that prints the message ‘Hello World’ on the screen.

Image: IBM
The Hello World routine in Node-RED

Here you can see Node-RED’s graphical user interface and how the platform breaks systems down into their constituent parts.

Each of the rounded blocks you can see on the screen is a node, which is a visual representation of a block of JavaScript code designed to carry out a specific task.

To build the ‘Hello World’ program the user drags into the central window an ‘inject node’, a node designed to output a message to other nodes.

This inject node is edited to output the string ‘Hello’.

Next a function node is dragged on and edited to define a JavaScript function that appends the string ‘ World’ to any message it receives.

These two nodes are then wired together. Most nodes have a grey circle on their left edge, which represents their input port, and on their right edge, which represents their output port. Left clicking and dragging the output port of the ‘Hello’ node to the input port of the ‘ World’ node connects the two together.

The final stage is to add a Debug node that prints the message it receives in the Debug window. This Debug node is then wired to the output of the ‘ World’ node.

The process is now ready to run and once deployed will display the string ‘Hello World’ in the Debug box, shown on the right of the screen.

This finished program is an example of what is called a flow in Node-RED.

What’s interesting about Node-RED is it can do much more than spit out a simple message, it can also glue together web services and hardware, and that’s where it starts getting powerful.

Read more on: http://www.techrepublic.com/article/node-red/

Advertisements

One thought on “A visual tool for wiring the Internet of Things

Add yours

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: