So you have a Raspberry Pi a laptop and an Internet connection.
And you want to update and use NodeRED to aid you with your electronic projects….
Well then you are in luck as this tutorial is going to make this task easier than falling over in the mud on a rainy day.
NodeRED itself is a visual tool that was designed by IBM to aid in the wiring together of hardware, API’s and other services in conjunction with the Internet of things (IOT). If you had an account at a company like Ubidots, who provide a cloud for IOT to connect with, then the sky is the limit for what you can achieve.
Raspberry Pi’s come with the NodeRED software on the Raspian image however its outdated and they also require a screen to be attached to the Pi.
This tutorial will show you how to update the version of NodeRED as well as show you how to use the screen on your PC to interact with the software.
Read through the tutorial, see what you think, and if it looks doable to you then give it a shot.
This tutorial does not deal with every subtle nuance of NodeRED. Its just a cheap and nasty, follow the steps and get it going sort of tutorial. Go to the main site if your looking for a more thorough experience.
Installing NodeRED on Raspberry PiOK so what needs to happen:
- Connect to the raspberry Pi through your computer using SSH
- Find the IP addresses of your Pi
- Install NodeRED through your Raspberry Pi terminal
- Open up a new tab and start up NodeRED
- Some extra notes about running NodeRED
You need the IP address of your Raspberry PI in order to gain access to it through SSH. The IP address will change within your network every time you come in and out of the network unless you go into the router and configure your own IP address. But lets assume you have not done this.
So IP address for your Raspberry Pi. Two recommendations:
1. Download the Fing app on your phone and it will give you all the addresses of the devices connected to the same wifi network. However if you have an apple iPhone don’t bother as the names of the devices were not made available for me. Having a list of IP addresses is pointless as you have no way of distinguishing between them. Unless theres only one device on your network in which case Fing for iPhone will work.
2. Go to this website and download Wireless Network Watcher to your computer. When run it will give you all the details you need.
Note this is only for windows however if you browse the net you will find something that will provide the functionality you need for the system you are on.
Once you have downloaded the application and have it running go through the list of devices that come up and look for one with name that has Raspberry in it. Once you have found it we are set to move onto the next step.
If it does not come up try refreshing the page and look through the listed devices again.
Remote login to your PiNow that you have the IP address its time to remotely log into your Pi through your personal computer.
For this step to work your Pi needs to be powered up and connected to the Internet. I will leave this up to you to figure out.
First you go into Terminal or Command Prompt for Windows etc. For the purposes of this tutorial I will assume you are using Terminal.
From here you type the following command into the window and press enter.
ssh pi@{IP_Address_assigned}
Delete everything after the @ symbol and put in your Pi's IP address. Following this you will be asked for your Raspberry Pi password which is most likely “raspberry”, if like me you have not changed the password and likely never will. Otherwise use the appropriate password you have chosen for your device.
At this point, assuming everything has gone well, you are able to control your Pi through the terminal. As your looking at it you can essentially pretend that you are looking at a terminal window on a screen that is attached to your Pi.
This is the limit of this command though. It only gives you the terminal. The screen on your computer does not become the screen from the Pi.
Installing NodeREDNodeRED comes pre-installed on the full Raspian SD card image and though it is usable its outdated.
The following command when put into Terminal will perform a number of functions all of which will result in you having an installed and updated version of NodeRED. Its a wonderful little nugget really given how much it does.
bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)
If you go to this site you can read up on the command.
Briefly though it essentially removes NodeRED from you Pi and then reinstalls a newer version that is superior to the original.
The images below shows my terminal output as I ran the commands. If you look you can see that it lists all the changes made followed by a green tick where success was achieved.
It took roughly 10 minutes for me though it could take longer as suggested in the window.
Side note before we get into this section.
Now assumption is a hell of a problem when writing these tutorials as I have made assumptions about what the reader does and does not know. However to try and combat this issue I will try and explain the odd thing even though it may slow down those of you who are more in the know as such.
NodeRED is a visual program that is not meant to be used through a program like Terminal. Hence utilizing this program without a screen, if its even possible, is going to be a singular form of torture that we are going to avoid like the plague. This is why Terminal will not suffice as an interface.
Now that we have the desired software installed on your Pi all thats left to do is to load up the program and get the visual representation of the program up and running on your screen.
This will be achieved quite simply with the two commands that have been listed below.
The first one gets punched into Terminal and the second goes into the search bar at the top of whatever Internet browser you are using. Firefox preferably.
node-red-start
http://{your ip address}:1880
The first one gets read from the Terminal window and is actually the command used to start running the program.
Once you have employed the command you should see the following output
At this point the software is running and you are able to bring up an instance of the program on your Internet browser.
Note when putting the command into the Internet do not keep the curly braces. These are not required.
The following image shows what you should see in your search browser before pushing enter. I just used a random IP address for this picture.
Please note that the order with which you employ these two commands does matter. Follow the instructions and you will be fine though.
By putting the second command into your search bar you should see the following screen come up.
Congratulations if you have the above screen showing up in your browser. :)
At this point you have the system up and running and you can start using NodeRED through your PC. How to use NodeRED and work through it will be material for a later tutorial. If however you do not wish to wait for any potential future tutorials go to this link which has a series of NodeRED tutorials that you can read through.
Notes on running NodeREDEvery time you quit out of NoreRED you will have to go through most of the discussed process again to start it back up except the installation step. If you don’t load up the program in Terminal then the Internet browser instance of the program will stop running.
If you put your computer to sleep for the night and turn off your raspberry Pi, when you next turn on your Pi you can go straight back to the tab thats running NodeRED. To get it running you simply need to go into Terminal and load it back up.
I have not got my head around how to save material at this point.
You can stop the program by typing Ctrl + c into terminal. This will stop the program running in Terminal and thus in your browser window.
This tutorial has achieved what it sent out to however if you wish to know more about NodeRED and getting it up and running on you Pi go to this link.
Cheers for reading my tutorial if you managed to get this far. I have struggled with learning this material however this tutorial is a solid point from which to work. I will put up another couple of tutorials and hopefully after a while we can all piece together how to use this beast.
Thanks and good luck :)
Comments
Please log in or sign up to comment.