Over a million developers have joined DZone.

What is Node-RED? How Can It Be Used for the Internet of Things?

· IoT Zone

Access the survey results 'State of Industrial Internet Application Development' to learn about latest challenges, trends and opportunities with Industrial IoT, brought to you in partnership with GE Digital.

When I recently started to work on Bluemix, I was honestly a little confused about what Node-RED is, how it relates to the Node.js Bluemix runtime and how it relates to the Internet of Things service. Since some of my readers might be in the same situation, let me quickly try to explain. 

Node-RED is a visual tool for wiring the Internet of Things, but it can also be used for other types of applications to quickly assemble flows of services. The name is not the most intuitive name. The reason why 'Node' is in the name is because the tool is implemented as Node application but from a consumer point of view that's really only an internal implementation detail. Node-RED is available as open source and has been implemented by the IBM Emerging Technologyorganization. 

Node-RED is included in the Bluemix Internet of Things starter application, but you can also deploy it as Node.js application separately. To use Node-RED for Internet of Things scenarios you need to add the Internet of Things Foundation service to your Bluemix application. The IoT service allows to register and connect different types of devices. After this you can use the incoming and outgoing MQTT nodes in your flows. Take a look at the existing Bluemix Internet of Things samples. Most of them use Node-RED to define flows where either incoming sensor data from 'things' is handled, e.g. stored in databases, or where commands are sent to devices. 

Node-RED can not only be used for Internet of Things applications, but it is a generic event-processing engine. For example you can use it to listen to events from http, websockets, tcp, Twitter and more and store this data in databases without having to program much if at all. You can also use it for example to implement simple REST APIs. Ryan Baxter provided just last week a Node-RED sample that isn't an IoT app. You can find many other sample flows on the Node-RED website. 

There are also several good demos and videos. One demo I especially like is this one from Rodric Yates: 

For a better description what Node-RED is and some of the history check out the article How IBM's Node-RED is hacking together the internet of things from Nick Heath.

The IoT Zone is brought to you in partnership with GE Digital.  Discover how IoT developers are using Predix to disrupt traditional industrial development models.


Published at DZone with permission of Niklas Heidloff, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}