Node Red

Node-Red: E1 Installation & Overview

What is Node Red? –Node red is a Open Source flow based tool and IOT platform and Dashboard developed by IBM and written in Node.js.

Node-red lets you easily applications by joining together black box functions (nodes) using a web interface and requires very little, if any, programming knowledge.

Because of its flexibility and ease of use node-red is ideally suited for building IOT and Home control dashboards and automations.

Here is a the official introductory video from the node-red team:

Requirements

Before we can start we’ll gather all the requirements for Episode 1 in this series.
As we’ll only be introducing Node-Red in this Episode you’ll only need following items.

  • 1x Raspberry Pi
    • version doesn’t matter but if you have to buy a new one get the 4B 2Gb.
  • 1x Raspberry Pi power supply
  • 1x Raspberry Pi Case
    • thought the case is optional it is highly recommended, it’ll prevent you from making shorts on the board itself.
  • 1x SD card, 8Gb or above with at least the Raspberry Pi Lite OS installed

Installing Node-Red

Installing Node-Red on a raspberry pi isn’t had. 1 line of code and you are good to go so lets get started.

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
Installing Node Red

The installer will ask you several times to type ‘y’ and enter.
Do this so that all required software will be installed.

Installing Node Red

After that it’s waiting for the installer script to complete. Once done we’ll check if we have the latest version of NPM.

npm -v

If this returns version lower then 6.0.0 you’ll need to manually update using following command sequence.

curl https://www.npmjs.com/install.sh | sudo sh

This sequence will get the installer script from the NPMjs website and install the downloaded script afterwards. Afterwards you should have the latest version installed.

Node-Red overview

Starting Node-Red

Before we can use Node-Red, we’ll need to start it. There are 3 ways of starting node red.

  • Using the GUI
  • Using the Node-Red command
  • Using the Node-Red Deamon

We’ll be using the latter 2 so pick either of following command to get node red started.

node-red
node-red-start

The node-red command will run it in your terminal. This means that your terminal will be useless while you are running node-red.
If you need your terminal while using node-red you’re better of using the last command shown here.

Gui overview

Node Red GUI

Looking at the Web GUI. In the center we can find our work space.
On the left of it we see all available nodes, here you find all nodes that have been installed including subflows (more on subflows in a later episode).

On the right hand side we see the info panel, this panel gives us more info on the selected item. This item can be either a flow or a node. This window also gives us access to the debug info (can you see the bug icon?).

There is of course more to Node-Red then this, but we’ll get to that when that’s required.

Your first flow

Before we end this episode we’ll make our first flow.
In this flow we’ll use the inject node and the debug node. You can drag them into the working area.

First used nodes
First flow

Once you dragged the nodes onto the working space, you can connect the output of the inject node to the input of the debug node.

Once done we press the Deploy button on the top.
When a flow or project is deployed we can use it. In this case we press the square in front of the inject button and we’ll see the output in de debug window (remember that bug button we talked about?).

Debug window

Conclusion

In this Episode we saw how to correctly install and run Node-Red on Raspberry Pi.
We build and ran our first node too.
Did this peak your interest? Then don’t wait and head to Episode 2

Leave a reply:

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.