Modifications

Sauter à la navigation Sauter à la recherche
2 400 octets ajoutés ,  2 avril 2017 à 09:35
aucun résumé de modification
Ligne 2 : Ligne 2 :     
{{traduction}}
 
{{traduction}}
 +
Now that we have node we can then jump in to downloading Node-Red. There is a tutorial on their git for the Pi which can be found [https://github.com/node-red/node-red/wiki/ReadMe-Raspberry-Pi---Advanced here]. But as always I want to take a different route as I want to use git to ensure that we always stay up to date with any new commits to the node-red repository.
 +
 +
We will now install Git. This allows us to clone git hub repositories. If you have never heard of git hub it is definitely something you should [https://github.com/ look into]. In essence though it is a good way of adding some version control and open source collaboration to your projects.
 +
 +
To install Git carry out the following command.
 +
 +
<syntaxhighlight lang="bash">
 +
sudo apt-get install git-core
 +
</syntaxhighlight>
 +
 +
Once Git has installed along with all of its dependencies we want to navigate to our home directory where we will install Node-Red.
 +
 +
<syntaxhighlight lang="bash">
 +
cd ~
 +
</syntaxhighlight>
 +
 +
We will then clone in our Node-Red repository (repo) to the directory with the following command.
 +
 +
<syntaxhighlight lang="bash">
 +
git clone https://github.com/node-red/node-red.git
 +
</syntaxhighlight>
 +
 +
You will then find that you have a folder cloned into the directory called “node-red”. We will now install everything using “npm” which is known as the Node Package Manager.
 +
 +
<syntaxhighlight lang="bash">
 +
cd node-red
 +
sudo npm install
 +
</syntaxhighlight>
 +
 +
After a while everything should run through and install for you. Next we can get Node-Red running, we still have some bits to do but its worth testing first. Make sure you are still in the /home/pi/node-red directory for this one.
 +
 +
<syntaxhighlight lang="bash">
 +
sudo node red.js
 +
</syntaxhighlight>
 +
 +
You will see a lot of information print out on to the screen, errors about missing packages and all of the good stuff. However the one line you are looking for is related to Node-Red being available on the default 1880 port.
 +
 +
So next you need to navigate to your Pi’s IP address and port to see Node-Red in all of its glory.
 +
 +
<syntaxhighlight lang="bash">
 +
http://Pi-IP-Address:1880
 +
</syntaxhighlight>
 +
 +
You should be welcomed to a blank canvas with all of the “nodes” available on the left hand of the screen. You can drag and drop these to start wiring things together. We will next be discussing how to create your first "flow" using these nodes.
    
{{Rasp-Node-Red-TRAILER}}
 
{{Rasp-Node-Red-TRAILER}}
29 918

modifications

Menu de navigation