Node-Red(NR) is Flow-based programming for the Internet of Things
This post isn't made as a complete install guide, there are several, just some links to the best information I have found.
The best thing is that even if you don't are a skilled programmer, but like logic flows, you can make really advanced things. It's pre-installed on some Raspberry Pi(RPi) distributions.
Running Node-Red with multiple instances ?
Another good, but old, Youtube tutorial with a twist of MQTT is found here.
The "bricks" of NR is Nodes. Nodes is black-boxes with a certain function with, almost always, an input and output.
Nodes connected together make a flow, and as usual with "Open source" software many people have contributed. In NR there is several prebuilt Nodes and flows.
Installation
In my case NR is installed on a RPi, start with "sudo apt update", but it could be installed on several other hardware platforms.
If you use RPi and have used a distribution without NR preinstalled I really recommend the installation script which is used both in a new install and for an update.
It does a lot of things and can be run again to keep your NR installation updated. In later versions the install will also run sudo node-red admin init to add the settings. Check an example setup below.
node-red-log
http://your_host:1880/
The GUI URL, if node-red-dashboard is installed, is
If you would like to start up NR with something simple and useful I have written a post where your Internet speed is measured in selected interval. Or check out how the RPi is running.
Other NR posts
Here you find the other NR posts on this site.
Node-RED Settings File initialisation
Running Node-RED update for user pi at /home/pi on debian
This can take 20-30 minutes on the slower Pi versions - please wait.
Stop Node-RED ✔
Remove old version of Node-RED ✔
Remove old version of Node.js ✔
Install Node 20.18.0-1nodesource1 ✔ v20.18.0 Npm 10.8.2
Clean npm cache ✔
Install Node-RED core ✔ 4.0.5
Move global nodes to local -
Npm rebuild existing nodes ✔
Install extra Pi nodes -
Add shortcut commands ✔
Update systemd script ✔
Any errors will be logged to /var/log/nodered-install.log
All done.
You can now start Node-RED with the command node-red-start
or using the icon under Menu / Programming / Node-RED
Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880
Started : Mon 11 Nov 16:18:22 CET 2024
Finished: Mon 11 Nov 16:22:18 CET 2024
**********************************************************************************
### WARNING ###
DO NOT EXPOSE NODE-RED TO THE OPEN INTERNET WITHOUT SECURING IT FIRST
Even if your Node-RED doesn't have anything valuable, (automated) attacks will
happen and could provide a foothold in your local network
Follow the guide at https://nodered.org/docs/user-guide/runtime/securing-node-red
to setup security.
### ADDITIONAL RECOMMENDATIONS ###
- Remove the /etc/sudoers.d/010_pi-nopasswd file to require entering your password
when performing any sudo/root commands:
sudo rm -f /etc/sudoers.d/010_pi-nopasswd
- You can customise the initial settings by running:
node-red admin init
- After running Node-RED for the first time, change the ownership of the settings
file to 'root' to prevent unauthorised changes:
sudo chown root:root ~/.node-red/settings.js
**********************************************************************************
Node-RED Settings File initialisation
=====================================
This tool will help you create a Node-RED settings file.
✔ Settings file · /home/pi/.node-red/settings.js
User Security
=============
✔ Do you want to setup user security? · No
Projects
========
The Projects feature allows you to version control your flow using a local git repository.
✔ Do you want to enable the Projects feature? · No
Flow File settings
==================
✔ Enter a name for your flows file · flows.json
✔ Provide a passphrase to encrypt your credentials file ·
Editor settings
===============
✔ Select a theme for the editor. To use any theme other than "default", you will need to install @node-red-contrib-themes/theme-collection in your Node-RED user directory. · default
✔ Select the text editor component to use in the Node-RED Editor · monaco (default)
Node settings
=============
✔ Allow Function nodes to load external modules? (functionExternalModules) · Yes
Settings file written to /home/pi/.node-red/settings.js
No comments:
Post a Comment
Feel free to leave a comment ! ... but due to a lot of spam comments I have to moderate them. Will reply ASAP !