Node-RED Tutorial

by May 31, 2020Node-Red

Introduction

One of the most important factors that limit the development of the IoT(Internet of Things) applications is the lack of comfortable means to develop rules for IoT devices interacting with each other. IBM developed an Open-Source tool called Node-RED to solve this problem, which allows you to develop connected objects and many other things with little computer knowledge.

Node-RED is a powerful tool to build the Internet of Things (IoT) applications that use predefined blocks of code, called nodes, to perform tasks. It uses a visual programming approach, which enables developers to link code blocks together.

This solution is convenient as an intermediate to link devices of different types to one another or to an automation system such as DBMS or cloud etc.

Node-RED runs on Node.js and it has been designed to operate on low performance systems such as

  1. Raspberry pi
  2. Arduino
  3. Docker
  4. Android

Installation of Node-RED

As said, Node-RED runs based on Node.js. We need to install Node.js in order to install Node-RED.

Go to the following link here, and download the Node.js.

Incase if your other OS user, check this article for more about Node.js.

After downloading, Install the software as you do in normal software.

Once you finished installation, Open Command prompt (Win+R -> cmd) or Search for Cmd in Search bar.

After opening, Copy and paste following from the below to cmd.

npm install -g --unsafe-perm node-red

Meanwhile you can install modules with the command, followed by module name in the last

npm install <module_name>

Here I’m installing the dashboard module which is very familiar.

npm install node-red-dashboard

To start the Node-RED type “node-red” in the command prompt.

After running, you will find an IP address like the above. Copy paste the IP address to your web browser.

There are four sections in Node-RED, They are

  1. Node Section – Different Nodes.
  2. Flow Area – To drop the blocks in a flow
  3. Deploy Button – To deploy the flow
  4. Debug Tab – Terminal or console of the Node-RED

The menu next to the Deploy button contains some additional tools:

  • View: Show / hide the grid.
  • Import: Allows you to import nodes.
  • Export: You can export to the clipboard to a file
  • Flows: You can add a new flow, rename, delete the current flow

Different Nodes

Common Nodes

There are 7 base input and output nodes enabled. It covers simple communication structures likely to be used by IoT applications. It ranges from lower-level network protocols like UDP and TCP to higher level HTTP and MQTT publish / subscribe.

Function Nodes

This section node contains functional blocks which does simple functions.

Storage Nodes

It is used for the devices like the Raspberry Pi and focuses on file based processing.

Raspberry Pi nodes

Raspberry pi nodes are designed to connect Raspberry pi and its functions.

Node-RED’s Hello World program

Drag and Drop of Nodes

Here, I used the inject node as a input and debug node as output in debug console.

Changing the Inject node payload as String

Here I’m changing the payload of the inject node as String and giving it as ‘Hello World’

Deploying and Running

After Deploying the flow, click the inject node. On the Debug tab, it displays the output.

OK, now lets make something different.

OpenWeather Example

I will make a flow which displays Weather in London using OpenWeather API

Flow of nodes – OpenWeather API

Now double click the HTTP request node to change its operation.

Paste the API and change format

Now Deploy and run, You can see the details in the Debug Console.

Creating a multiplication Skill in Alexa using python

Written By Monisha Macharla

Hi, I'm Monisha. I am a tech blogger and a hobbyist. I am eager to learn and explore tech related stuff! also, I wanted to deliver you the same as much as the simpler way with more informative content. I generally appreciate learning by doing, rather than only learning. Thank you for reading my blog! Happy learning!

RELATED POSTS

How to export and import flows-node-red

How to export and import flows-node-red

Flows are imported and exported from the editor using their JSON format. So,Node-red makes it easy to share flows with others. Exporting flows Step 1: Click on the node that you want to export and press CTRL, the node will be highlighted. Step 2: Go the top right side...

Installing and starting Node-red

Installing and starting Node-red

Node-red is a programming tool for wiring together hardware devices, APIs, and online services in new and interesting ways. Install Node-red  Open the official page for Node.js downloads and download Node-red for Windows by clicking the "Windows Installer" option...

How to create flow in Node-RED Admin Basics

How to create flow in Node-RED Admin Basics

You can easily create a flow in Node-RED by simply following the steps given below but before diving into How to create Flow in Node-RED we will first understand about Node and flow in Node-RED. For installation and tutorial of Node-RED click here. What is a Node? A...

How to create a basic Dashboard in Node-RED

How to create a basic Dashboard in Node-RED

You can create a basic Dashboard in Node-RED by following the steps given here. Firstly, the Dashboard is not built-in so you first need to install the Dashboard. Installing Dashboard and Initializing Node-RED Assuming you have already installed Node.js and Node-RED...

What is Node-RED?

What is Node-RED?

In this article, we will learn about Node-RED and its importance to the Internet of Things. It was developed in the year of 2013 by IBM Emerging Technology- Nick O'Leary and Dave Conway-Jones. The Node-RED is a visual tool that provides a web-based flow editor that...

VIDEOS – FOLLOW US ON YOUTUBE

EXPLORE OUR IOT PROJECTS

IoT Smart Gardening System – ESP8266, MQTT, Adafruit IO

Gardening is always a very calming pastime. However, our gardens' plants may not always receive the care they require due to our active lifestyles. What if we could remotely keep an eye on their health and provide them with the attention they require? In this article,...

How to Simulate IoT projects using Cisco Packet Tracer

In this tutorial, let's learn how to simulate the IoT project using the Cisco packet tracer. As an example, we shall build a simple Home Automation project to control and monitor devices. Introduction Firstly, let's quickly look at the overview of the software. Packet...

All you need to know about integrating NodeMCU with Ubidots over MQTT

In this tutorial, let's discuss Integrating NodeMCU and Ubidots IoT platform. As an illustration, we shall interface the DHT11 sensor to monitor temperature and Humidity. Additionally, an led bulb is controlled using the dashboard. Besides, the implementation will be...

All you need to know about integrating NodeMCU with Ubidots over Https

In this tutorial, let's discuss Integrating NodeMCU and Ubidots IoT platform. As an illustration, we shall interface the DHT11 sensor to monitor temperature and Humidity. Additionally, an led bulb is controlled using the dashboard. Besides, the implementation will be...

How to design a Wireless Blind Stick using nRF24L01 Module?

Introduction Let's learn to design a low-cost wireless blind stick using the nRF24L01 transceiver module. So the complete project is divided into the transmitter part and receiver part. Thus, the Transmitter part consists of an Arduino Nano microcontroller, ultrasonic...

Sending Temperature data to ThingSpeak Cloud and Visualize

In this article, we are going to learn “How to send temperature data to ThingSpeak Cloud?”. We can then visualize the temperature data uploaded to ThingSpeak Cloud anywhere in the world. But "What is ThingSpeak?” ThingSpeak is an open-source IoT platform that allows...

Amaze your friend with latest tricks of Raspberry Pi and Firebase

Introduction to our Raspberry Pi and Firebase trick Let me introduce you to the latest trick of Raspberry Pi and Firebase we'll be using to fool them. It begins with a small circuit to connect a temperature sensor and an Infrared sensor with Raspberry Pi. The circuit...

How to implement Machine Learning on IoT based Data?

Introduction The industrial scope for the convergence of the Internet of Things(IoT) and Machine learning(ML) is wide and informative. IoT renders an enormous amount of data from various sensors. On the other hand, ML opens up insight hidden in the acquired data....

Smart Display Board based on IoT and Google Firebase

Introduction In this tutorial, we are going to build a Smart Display Board based on IoT and Google Firebase by using NodeMCU8266 (or you can even use NodeMCU32) and LCD. Generally, in shops, hotels, offices, railway stations, notice/ display boards are used. They are...

Smart Gardening System – GO GREEN Project

Automation of farm activities can transform agricultural domain from being manual into a dynamic field to yield higher production with less human intervention. The project Green is developed to manage farms using modern information and communication technologies....