Installing Node-RED for Unipi

This article covers the installation of Node-RED software on any Unipi unit. For older systems (Debian 12 and older) OS images are available, but it is recommended to use newest Base OS (or Debian) version for security reasons. Older Node-RED OS images can be found under products in sections OS images > Node-RED in Archive tab.


This article presumes Base OS is present on the Unipi unit. This system does not include Node-RED, but it is possible to install Node-RED on it. If Base OS is not present on the unit, it is recommended the newest version is installed to avoid any problems with compatibility.

(!)

Note:
This article contains installation of Node-RED with API Evok. Evok is not a mandatory part of the installation, but it can simplify the access to I/O. Evok can be omitted, if access to I/O is not needed or different way for access is used.

(!)

Note:
To make sure you have the latest version of Base OS, upload the OS according to the Upload/backup OS guide under each product. For example for Unipi Patron the guide is located at Products > Unipi Patron > Upload/backup OS Image with Base OS can be found in OS images section or under products in downloads section.

To introduce Node-RED at least these packages and their dependencies are needed:

  • Evok
  • Node-RED

Connect via SSH

First step is to connect to the unit via SSH. This can be done with terminal emulator for example PuTTy.

Installing Evok

To communicate with I/O in Node-RED we will use the Evok API. Guide how to install Evok can be found here.

Installing Node-RED

Guide how to install Node-RED can be found here. Before running the script, make sure the package list was updated.

sudo apt update

(!)

Attention:
It is very important to have your system secured every time you create a new project.

To secured the Node-RED follow this guide on the official webpage.

After the installation, it is possible to enable automatic Node-RED start after boot. If you enabled this feature, restart the unit to start the Node-RED.

sudo reboot

(!)

Tip:
OS with Node-RED can be saved and copied with backup and upload to another unit. With this you can avoid installation and setup of Node-RED on every unit separately.

(!)

Attention:
If you have problems seeing Node palette or see errors regarding nodejs compatibility, then this might indicate a problem with memory overcommitment.


This problem can be fixed simply by editing file /etc/sysctl.d/80-ram-overcommit.conf and changing line

vm.overcommit_memory = 2

to

vm.overcommit_memory = 0

then restart the unit

sudo reboot

Changing this setting can have impact on system behavior. More information can be found at https://www.kernel.org/doc/Documentation/vm/overcommit-accounting.

To enter the Node-RED programming interface, open a web browser and enter the IP address or mDNS record to the browser's address bar and add :1880 port.

An example:

http://e410-sn1253701234:1880

The following interface will be displayed:

For easier work with system, I/O and other interfaces, it is possible to add existing node to pallet in programming interface. To add nodes into Node-RED pallet from library follow the official guide.

To work with Evok we will add this package: @unipitechnology/node-red-contrib-unipi-evok.

(!)

Attention:
There are multiple versions of nodes in this package. Always use the newest version of node!

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies