Node-RED in Bluemix for IBM Internet of Things Foundation

Node-RED in Bluemix

A visual tool for wiring the Internet of Things

IBM Internet of Things Foundation

Node-RED provides a browser-based editor that makes it easy to wire together flows that can be deployed to the runtime in a single click.

The version running here has been customized for the IBM Internet of Things Foundation.

We strongly suggest you secure your Node-RED flow editor with a username and password, as otherwise anyone who can guess the URL of this application will be able to launch the flow editor and access your IoT device data.

To do this, follow the instructions that you find here.

Using Node-RED with the IBM Internet of Things Foundation QuickStart

Use Node-RED to build an application using the data from any device that you have connected to the IBM Internet of Things Foundation.


Sample application

The sample has a ready-made flow that processes temperature readings from a simulated device. The flow checks these readings against a threshold, then tells you whether the temperature is safe. Imagine that we're monitoring a CPU temperature from a real device.

To work through the sample application, follow the IoTF starter application documentation.


Use your own device data

Use the MAC address of any device that you have already connected to the IBM Internet of Things Foundation.There are recipes available for Raspberry Pi, ARM mbed, Intel Galileo and TI BeagleBone & SensorTag.

To view the complete list of IBM Internet of Things Foundation recipes go to the IBM IoT developerWorks site.


Check your device connection

If your device is connected you can visualize your data on the IBM Internet of Things Foundation QuickStart.

Enter your MAC address here:

Customising your instance of Node-RED

This template instance of Node-RED is enough to get you started creating flows.

You may want to customise it for your needs, for example replacing this introduction page with your own, adding http authentication to the flow editor or adding new nodes to the palette.

To start customising your instance of Node-RED, you can either download the application locally or use IBM DevOps Services to edit and deploy your changes.

Using IBM DevOps Services

  1. Within ACE, open the overview page for the application.
  2. Click the link to Add Git Integration and follow the guide to import the application into IBM DevOps Services.
  3. Once complete, click the Edit Code link to open it in IBM DevOps Services.
  4. Customise the application following the guide below, commit your changes and push them back to Bluemix.

Downloading the application locally

  1. Within ACE, open the overview page for the application.
  2. Click on the Start Coding in the sidebar
  3. Follow the instructions there for downloading, editing and pushing back into Bluemix

Password protect the flow editor

By default, the editor is open for anyone to access and modify flows. To password-protect the editor:

  1. In the Bluemix dashboard, select the 'Environment Variables' page for your application
  2. Add the following user-defined variables:
    • NODE_RED_USERNAME - the username to secure the editor with
    • NODE_RED_PASSWORD - the password to secure the editor with
  3. Click Save.

Adding new nodes to the palette

  1. There is a growing collection of additional nodes that can be added to the Node-RED editor. You can search for available nodes in the Node-RED library.
  2. Edit the file package.json and add the required node package to the dependencies section. The format is:
    "node-red-node-package-name":"x.x.x"
    Where x.x.x is the desired version number.

Changing the static web content

  1. The page you are reading now is served as static content from the application. This can be replaced with whatever content you want in the public directory.

Remove static web content and serve the flow editor from the root path

  1. In the file bluemix-settings.js, delete the httpStatic and httpAdminRoot entries.