JeanCarl's Adventures

Node-RED on Koding using IBM Bluemix services

February 20, 2016 |

Get ready. Get set. Go! The Koding hackathon is underway. You can find more details about the virtual hackathon, but I wanted to share how I got Node-RED running on a Virtual Machine via the Koding service. If you haven’t heard about Node-RED yet, head over to nodered.org.

In short, Node-RED is an awesome graphical interface that lets you connect nodes together to create functionality that runs on top of a Node.js environment. Functions let you extend to your heart’s content by writing JavaScript. I created a connected IoT Teddy Bear with it.

Installing Node-RED on a virtual machine is pretty simple. Open up the terminal on the VM and type the following command:

sudo npm install -g node-red

Photo

To start Node-RED, use the node-red command:

node-red

Photo

This will start up Node-RED and make it available on port 1880. You can launch a browser to:

http://<your-vm-ip>:1880

Photo

Let’s add some additional nodes that can interact with some of the IBM Bluemix services. Stop Node-RED in the terminal to return to the command line. Change directory to ~/.node-red

cd ~/.node-red

First, we’ll install node-red-bluemix-nodes which contains nodes that can be used with IBM Watson.

sudo npm install node-red-bluemix-nodes

Photo

Let’s also install the node-red-node-cf-cloudant package to add nodes to use with IBM’s Cloudant NoSQL database.

sudo npm install node-red-node-cf-cloudant

And finally, the node-red-contrib-scx-ibmiotapp package adds some Internet of Things nodes that are helpful when connecting devices like the Intel Edison or Raspberry PI.

sudo npm install node-red-contrib-scx-ibmiotapp

To start Node-RED, run the node-red command again:

node-red

And launch a browser to:

http://<your-vm-ip>:1880

You’ll notice the additional nodes that have been added to the palette in the left sidebar. Check out the IBM_Watson section where you can use Text to Speech, Personality Insights, and Language Translation nodes, just to name a few.

Photo

What’s next? I have several tutorials on my GitHub account showing how to create Node-RED flows using Text to Speech, Language Translation, and Personality Insights.