HowTo: Node Red – Installing Node Red on the Raspberry Pi

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.

After entering your username and password you can enter the first commands.

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.

To start the update of the package management you have to enter the following command.
sudo apt-get update && sudo apt-get upgrade
Depending on how long ago your last update of the package management was, this process can now take a while. The lists that refer to the individual package sources are updated first.
After that, the packages themselves are updated. Since additional memory is occupied, you will be asked again for your consent. You have to confirm this with a "J" and "Enter".
Once the update is complete, you will see a small summary of the duration and scope of the update.

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)
Bevor das Installationsskript dann mit der Installation startet müsst Ihr noch ein mal bestätigen, dass Ihr damit einverstanden seid. Außerdem wird darauf hingewiesen, dass Ihr ggf. ein Backup eurer SD-Karte vornehmen sollt. Falls Ihr damit einverstanden seid bestätigt ihr diese Abfrage mit einem „Y“ und „Enter“.
Bei der letzten Abfrage bevor das Installationsskript dann mit der Installation startet könnt Ihr angeben, ob Ihr auch die „Pi-spezifischen“-Nodes installieren wollt. Diese Nodes greifen auf, für den RaspberryPI typische, Funktionen zu. Zum Beispiel werden dann Nodes installiert mit denen Ihr auf die GPIO-Pins Eures RaspberryPI zugreifen könnt. Falls nicht anders gewünscht kann man diese ruhig mitinstallieren.
The installation then starts...
...and after about five minutes you should have the required software packages installed.

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. 🙂

Buy Me a Coffee at ko-fi.com       

3 comments

Kommentar hinterlassen

Your email address will not be published. Erforderliche Felder sind mit * markiert

This site uses Akismet to reduce spam. Learn how your comment data is processed.