Node-RED on UniPi Axon Step-by-step guide
Introduction
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.
Powering up
Power the device up and connect it to your computer according to the instruction leaflet included in the package.
Detecting the UniPi Axon IP address
Now, it is necessary to detect the controller's IP address. You can find it by multiple methods. 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.
A screenshot shows the Fing app on a smartphone, displaying a list of network devices. It highlights the 'M505-sn20' device with IP address '192.168.1.15' and MAC address '02:01:13:A1:9A:D4'.
Alternatively, use Windows IP address lookup tools or any other IP address lookup tool.
Enabling the SSH & disabling Mervis
The next step requires the controller to be set into service mode by following these steps:
- 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.
- Power up the controller while holding the button down.
- 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.
- 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:
- 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.
- 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 (AXON device service mode in a web browser):
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).
A screenshot of the PuTTY Configuration window is displayed. The 'Session' category is selected, with fields for 'Host Name (or IP address)' (showing '192.168.1.15') and 'Port' (showing '22'). Connection type is set to 'SSH'. (Running the putty.exe program and entering the IP address).
PuTTY Security Alert
A PuTTY Security Alert window will appear. Select „Yes" option and continue.
A 'PuTTY Security Alert' window appears, warning about the server's host key not being cached. It displays the server's SSH fingerprint and offers options to 'Yes' (Ano), 'No' (Ne), or 'Cancel' (Zrušit). (In the following window, we choose the option "Yes").
After clicking Yes, an SSH terminal command prompt will open.
Note: 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
Note: The password text is written as invisible – if the cursor is not moving during the password insertion, it is not an error!
SSH Login and EVOK Installation
A terminal window shows a successful SSH login to 'unipi@M505-sn20'. It displays system information and the last login details.
With the SSH running, the controller is ready for the upload of remaining parts of the Node-RED setup.
EVOK installation
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 inserted 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.
It is worth noting that 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 insert the IP address of your controller. The EVOK user interface will open.
Node-RED Installation
A web interface labeled 'UniPi Control Panel' is shown, with tabs for 'Inputs', 'Outputs', 'System', and 'Configuration'. Under 'Digital', 'Input 1.01' is displayed as 'Off'. (Example of EVOK in a web browser).
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 performed through the SSH terminal. Insert the first command: sudo apt-get install build-essential
The installation should run without any further input. Upon its completion, insert 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:
- Are you really sure you want to install as root? [y/N]?
- Are you really sure you want to do this? [y/N]?
- Would you like to install the Pi-specific nodes? [y/N]?
A terminal window shows the Node-RED update script running. It prompts for confirmation to install as root and to proceed with the installation, with the user providing 'y' for both. It then lists installation steps with green checkmarks. (Node-RED Installation).
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, node-red
command must be used each time to run Node-RED. In order to make things easier, enter a one additional command to the SSH terminal: sudo systemctl enable nodered.service
. This command will set Node-RED to launch on device startup.
Accessing the Node-RED User Interface
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 Node-RED user interface is displayed in a web browser. It features a palette of nodes on the left (input, output, etc.), a central workspace for flows, and an information panel on the right. (Node-RED Environment).
Preparing the Node-RED
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.
Screenshots show the Node-RED menu being accessed by clicking a 'MENU' button (highlighted). The menu includes options like 'Import', 'Export', and 'Manage palette'. (We click on "MENU" (marked with a red rectangle)).
Next, click on Manage Palette. (We click on "Manage palette").
Installing Nodes
The 'User Settings' window within Node-RED is shown, with the 'Nodes' tab active. A search bar allows filtering nodes. The '@unipitechnology/node-red-contrib-unipi-evok' package is displayed, with an 'Install' button.
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.
The 'User Settings' window shows that two new nodes, 'unipi input' and 'unipi output', have appeared in the list of available nodes.
Now, install the node-red-dashboard
by following the exact same instructions.
Node-RED Demonstration and Import
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.
The 'Import nodes' dialog is shown, with a text area labeled 'Paste nodes here' and options to import to 'current flow' or 'new flow'.
Now just copy and paste the content of the flow pro navod verze 1.0.json
file added to this manual and click on Import.
A web browser address bar shows '192.168.1.15:1880/ui'.
With the import finished, open the user interface webpage by inserting the IP address and adding /ui. as a suffix.
Node-RED Dashboard Demo
The Node-RED dashboard interface displays sections like 'Boiler controller' with temperature settings ('Set temp', 'Act temp') and 'Direct / Software switch' with toggle switches.