Introduction
In this post, we are going to learn how to install and upgrade Node-RED onto our Raspberry Pi devices, like PLC (or Programmable Logic Controller) and Panel PC.
With the same command provided by Node-red's website, we will be able to install Node-RED and upgrade an existing install when a new release is available.
Finally, we will learn how to run Node-RED as a service, autostart on boot, and finally, open the Node-RED editor for creating amazing flows!
Index
Requirements
Install Node-red
In order to install Node-RED, follow these steps:
1. Update & upgrade the package manager.
sudo apt update && sudo apt upgrade
2. Ensure npm is able to fetch and build any binary modules.
sudo apt install build-essential git curl
3. Install Node.js, npm and Node-RED. This script will work on any Debian-based operating system, including Ubuntu and Diet-Pi.
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
If you add --help at the end of the line, you will see more parameters so that you can use them if you need them:
For more information, please visit:Â nodered.org >>>Â
Run Node-red without internet
If you want to install Node-RED locally without Internet, please go to
Run Node-red as a service
By default, the provided script from step 3 above, also sets it up to run as a service, which means that it can run in the background.
The following commands allow you to work with the service:
- node-red-start
- node-red-stop
- node-red-restart
- node-red-log
Autostart Node-red on boot
Enable the service to autostart by running the following command:
sudo systemctl enable nodered.service
To disable the service, run the command:
sudo systemctl disable nodered.service
Open Node-red editor
Once Node-RED is running, you can access the editor in any browser: recommended Chromium, Chrome or Firefox-ESR.
Find the hostname of the Pi by running:
hostname -I
Use the hostname or IP-address of the Pi:
http://<hostname>:1880
Once running, start developing your own Node-RED applications!
How to Install Node-RED onto a Raspberry Pi PLC / Panel PC