Node-RED for Unipi 1.1/Lite

This manual will guide you through the entire process of installing Node-RED into your Unipi 1,1 controller. Before the installation please make sure your controller was delivered undamaged and without any visible defects.

Unipi 1.1

We strongly recommend using industrial SD cards. If you use a laptop, bear in mind most laptops do not feature a microSD card slot and will require a suitable SD or USB adapter. A suitable card can be purchased on the Unipi e-shop.

For a smooth running of Node-RED on Unipi Neuron or Unipi 1.1 controllers, you will need a card with a capacity of at least 4 GB.

The next step is to download the BalenaEtcher utility.

Install BalenaEtcher and launch it. In its main menu, click on Select Image and choose the Mervis OS image.

Upon selecting the image, a disk drive selector will enable. Choose the SD card drive.

Finish the process by clicking on Flash!

Maximum caution is necessary during the deploy. If a wrong drive is selected, it may result in a loss of data.

After finishing the deploy your OS will detect new disk drives. As these drives are set up specifically for Mervis OS, your operating system cannot access them and will request their formatting. Close the formatting prompt by clicking on Cancel.

Windows OS will also notify you about the drive being unaccessible. Ignore this message as well.

If the OS image upload was successful, the card will be detected as boot upon its reinserting into the PC. Before inserting it into the controller you can also perform an additional, optional step → enabling the SSH. The easiest method of doing so is to open the boot card root folder and create a text file named ssh.txt or ssh without suffix here.

At this moment, the Mervis OS is safely flashed onto your SD card. Unplug the card from your PC, remove it from the adapter (if you used one) and insert the card into your Unipi controller.

Insert the card ONLY if the controller's power supply is unplugged!

Insert the card with its back up (eg. golden connectors facing up). Plug the power supply in.

With a new SD card, the controller's startup will take more time than usual - approximately 3 minutes. This is due to the necessary OS configuration.

To detect the PLC's IP address you can use any of the available LAN network scanning tools. You can also gain the IP address from the DHCP server (if you have access to it). For this tutorial, we selected the Advanced IP Scanner program.

Download and install it, or just launch it. The Advanced IP Scanner interface looks like the following:

For automatic network selection, click on the icon to start detection of all available networks on all available adapters of the PLC. The specific range can be adjusted manually.

For network scan click on the button.

Scanning local networks will take a couple of minutes. Please wait until your device is displayed.

Remember the IP address - you will need it later when working with the PLC.

The OS image you just uploaded into your PLC also contains the preinstalled EVOK open-source software - an Unipi-developed application programming interface (API) for direct communication with Unipi hardware.

Also available is a practical demonstration of using the API in the form of a simple web application (Unipi Control Panel) serving as a user interface for all inputs and outputs on the controller. To access this interface, open your web browser and enter the IP address of your PLC with the port number :80. Port number is optional, as it is the default webserver port.

For example:


The application's interface looks like this:

Another software included in the disk image, which is now also uploaded in your PLC, is Node-RED. It is an open-source programming tool for connecting hardware devices, various APIs or online services. In this case, the Node-RED software already contains the EVOK API. This API is represented by a pair of nodes in the left panel, section Unipi - unipi input and unipi output made to control both analog and digital inputs and outputs.

To access the Node-RED programming interface, open a web browser and enter the controller's IP address into the address tab. Don't forget to add the :1800 port number.

For example:

The following interface will appear:

You have probably noticed the interface already contains a project. It is a demonstration project for reading inputs and writing to outputs, which is connected with a web user interface → so-called Dashboard. This project (flow) is available for download at the end of the article.

To access the interface, add /ui suffix behind the address with the port number.

For example:

The following interface will appear:

You now have everything you need to create your projects.

If you did not set up login using the following guide, you expose yourself to a risk of unauthorized access to the Unipi controller. That may lead to potentially dangerous changes resulting in downtimes or limitations. At the worst, unauthorized tampering can damage connected technologies or endanger personnel at installation sites.

That said, it is very important to have your system secured every time you create a new project.

As you will communicate with the PLC using the SSH protocol, you need to know the PLC's IP address and to have an SSH client installed on your PLC. Among the most frequently used programs is the PuTTy application - if you don't have it already, follow this guide.

For transfer files between your PC and the PLC you can use the WinSCP utility. Login is the same as for SSH.

After that, just follow this guide on the official Node-RED webpage.

Node-RED projects are called flows. On the link below you can download a file with a flow for Unipi 1.1/Lite.