Node-RED on UniPi Axon

The following manual will guide you through the process of powering up your UniPi Axon controller. Before the start, please check the device for any damage that occurred during shipment or any other visible defect.

Probably the easiest and fastest way is to use a smartphone with the Fing app installed (it is possible to use other similar applications). The app is available on Google Play for Android phones or App Store for iOS

Alternatively, you can also use Windows IP address lookup tools or any other IP address lookup tool

The next step requires the controller to be set into service mode by following steps

  1. Hold down the small recessed button on top of the Axon device case using a thin-enough tool. The button can be found next to the USB port labels on the upper side of the device.
  2. Power up the controller while holding the button down.
  3. Wait until the device finishes booting into the UniPi service mode. This is indicated by the two rows of LEDs flashing in an alternating fashion.
  4. Use a device with a web browser to connect to the UniPi Axon via Ethernet LAN or Wi-Fi. The process is slightly different between the two options:
    1. Ethernet LAN: The interface will be accessible on IP address 192.168.200.200. The device will also attempt to acquire an additional dynamic IP address via DHCP, if DHCP is available.
    2. Wi-Fi: The UniPi Axon service mode will create a Wi-Fi access point with SSID “UNIPICONFIG” and password “unipi.technology”. The interface will be accessible on IP addresses 192.168.200.200 and 192.168.201.1

If all steps were done correctly, the following interface will be accessible on Axon's IP address

In this interface, follow these steps

  • click on Enable SSH
  • click on Disable Mervis runtime
  • click on Restart system

The controller will then reboot. After that, you can proceed to the next step

Communication through the SSH using PuTTY

Once the controller’s IP address is found, you can communicate with it through an SSH connection. For this purpose the PuTTY program is needed – while other SSH programs can be used, PuTTY is the most suitable for Windows). The program can be downloaded here.

After the download, install the application following the installer instructions. With the program installed, click on the putty.exe file to launch it (the default path is C:\Program Files\PuTTY.) When launched, the following window is displayed. Enter the controller’s IP address to the Host Name tab, then click on Open.

A PuTTY Security Alert window will appear. Select „Yes“ option and continue.

After clicking Yes, an SSH terminal command prompt will open.

The login has a set timeout, after which the login will not be possible! If the time runs out, restart PuTTY and repeat the login.

Enter the following login:

  • Login: unipi
  • Password: unipi.technology

The password text is written as invisible – if the cursor is not moving during the password insertion, it is not an error! Upon successful login, this screen will appear:

With the SSH running, the controller is ready for the upload of remaining parts of the Node-RED setup.

The EVOK install is described in detail on this link. The link contains a brief description of EVOK and the install guide.

For the purpose of this guide, only several commands will be needed to be entered into the SSH terminal. Bear in mind that it is recommended to paste commands by lines. It is also possible to run several blocks at once, but we strongly recommend to perform the procedure one step at a time. If the UniPian image was used, the EVOK is already contained within it and it is not needed to install it again. It is, however, necessary to check if the latest version is used. All you need to do is to use following commands:

sudo su

apt-get install evok

apt-get update

reboot

If everything was done correctly, you can now open a web browser and enter the IP address of your controller. The EVOK user interface will open.

Now, it is time to install the Node-RED itself. To use Node-RED, the latest EVOK release is required (2.0.7g or higher). The installation is again performer through the SSH terminal. Enter the first command:

sudo apt-get install build-essential

The installation should run without any further input. Upon its completion, enter the following command:

bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

To finish the install, three questions will appear.

  1. Are you really sure you want to install as root? [y/N]?
  2. Are you really sure you want to do this? [y/N]?
  3. Would you like to install the Pi-specific nodes? [y/N]?

Answer them in the following order – Y, Y, N (check the following screenshot for reference)

All steps must be marked with the green tick in order to complete the install. When all steps are marked as completed, the Node-RED is successfully installed.

By default, the node-red command must be used each time to run Node-RED. In order to make things easier, enter one additional command to the SSH terminal: sudo systemctl enable nodered.service

This command will set Node-RED to launch on device startup.

You can now enter the Node-RED user interface. All you need to do is to open a web browser, enter the controller’s IP address and place a: 1880 suffix.

The following user interface will load

With the Node-RED functional, you will need to install nodes required for communication with the controller (nodes are displayed in the left tab). First, click on Menu on the right upper corner of your screen

The following menu will appear

Click on Manage Palette. A following list of nodes will appear. Click on Install.

You can now install new nodes into Node-RED. You will specifically require two packages. The first one is @unipitechnology/node-red-contrib-unipi-evok. Enter unipi search word to find the package. Then click Install

Two new nodes appeared in the list of available nodes:

Now, install the node-red-dashboard by following the exact same instructions.

To understand the connection between UniPi and Node-RED, a demonstration was created. Its import is very easy – click on Menu, hover the cursor over Import and click on Clipboard.

Now just copy and paste the content of the demo_flow.json file added to this manual and click on Import. With the import finished, open the user interface webpage by entering the IP address and adding /ui. as a suffix

When loaded, the page should look like the following screenshot: