In my opinion, NodeRed is one of the most intuitive graphical programming tools in the SmartHome/IoT area.
In NodeRed, program sequences are not (only) programmed with program code but largely with function blocks (nodes) that can be combined and connected with each other.
This reduces the hurdles for beginners and those switching to getting started with NodeRed.
Before you can use NodeRed, you first have to integrate it into your SmartHome system.
How to install NodeRed on a RapsberryPi is described in the following article.
Safety instructions
I know the following notes are always kind of annoying and seem unnecessary. Unfortunately, many people who knew "better" have lost eyes, fingers or other things due to carelessness or injured themselves. Data loss is almost negligible in comparison, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Because even the coolest project is not worth injury or other trouble.
https://www.nerdiy.de/sicherheitshinweise/
Affiliate links/advertising links
The links to online shops listed here are so-called affiliate links. If you click on such an affiliate link and make a purchase via this link, Nerdiy.de will receive a commission from the relevant online shop or provider. The price does not change for you. If you make your purchases via these links, you support Nerdiy.de in being able to offer other useful projects in the future. 🙂
Requirements
Helpful articles:
Before you start with the installation you should prepare the RaspberryPi so that it is accessible via the network and controllable via SSH.
The following three articles describe what needs to be done to prepare the RaspberryPi:
RaspberryPi – setup for nerdiys!
RaspberryPi – The first configuration!
RaspberryPi – Control the RaspberryPi via SSH
Required tool:
-no-
Required material:
In the following list you will find all the parts you need to implement this article.
Log in to the RaspberryPi via SSH
To start, you must first log in to the Rasp Pi with Putty via SSH. How to do this is in the article RaspberryPi - Control the RaspberryPi via SSH described.
Update package management
The package management in Linux is a "central place" through which various software packages can be installed. In order for this to work reliably, the lists and sources of the package management should be updated before each installation of new packages.
sudo apt-get update && sudo apt-get upgrade
Run installation script
Installing NodeRed is child's play thanks to an installation script provided by the developers. It installs and configures the required software packages automatically.
To start the installation script you just need to run the following command.
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
After installation you can start NodeRed. Simply follow the next steps. It is also recommended to set up the NodeRed autostart.
Start NodeRed
NodeRed can be started with the following command:
sudo systemctl start nodered
Stop NodeRed
NodeRed can be stopped with the following command:
sudo systemctl stop nodered
Restart NodeRed
If you need to restart NodeRed, you can do so with the following command:
sudo systemctl restart nodered
Enable NodeRed autostart
In order for NodeRed to start automatically after restarting the RaspberryPI, you must execute the following command. This means that after restarting the Raspberry Pi you no longer have to worry about starting NodeRed manually.
sudo systemctl enable nodered.service
Call up the NodeRed interface
Nach der Installation kann die Konfigrations-Oberfläche von NodeRed unter der IP-Adresse eures RaspberryPI’s und dem Port „1880“ im Webbrowser aufgerufen werden.
To do this, enter the following into the address bar of your browser:
http://IP_EURES_RASPBERRYPI:1880
Natürlich müsst ihr dabei „IP_EURES_RASPBERRYPI“ durch die wirkliche IP-Adresse oder den Hostnamen eures RaspberryPI’s ersetzen.
Security
After installation, your NodeRed installation is unfortunately configured like an open barn door by default. There are no hurdles (as long as you are in the same network as the Raspberry Pi) to execute commands on the Raspberry Pi via NodeRed. You should definitely change this.
You can find tips on this in the articles NodeRed – Set up user login and NodeRed - Encrypt connection.
Further information
Weitere Informationen zum Umgang mit NodeRed und ein paar Beispiele könnt Ihr im in der Kategorie „NodeRed“ auf Nerdiy.de finden. Zur Kategorie gehts this way.
Have fun with the project
I hope everything worked as described for you. If not or you have questions or suggestions please let me know in the comments. I will then add this to the article if necessary.
Ideas for new projects are always welcome. 🙂
PS Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you think it's cool that I share the information with you, I would be happy about a small donation to the coffee fund. 🙂
Attention: the command for installation has changed (12/25/2021):
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered
Thanks for the hint.
Corrected the section. 🙂
Thank you and best regards
Fabian