Node-RED: Difference between revisions
No edit summary |
No edit summary |
||
Line 37: | Line 37: | ||
</pre> | </pre> | ||
Look [https://www.w3schools.com/nodejs/nodejs_raspberrypi.asp here] and [https://nodered.org/docs/hardware/raspberrypi here] for further details. | |||
Otherwise, if you are on Windows you have to follow the guide below. | Otherwise, if you are on Windows you have to follow the guide below. |
Revision as of 17:05, 20 June 2018
This wiki document explains how to install the package that contains the following modules:
These nodes interact with LogicLab and their aim is to, respectively, read/write a value for a requested symbol target.
After the installation, these nodes will appear into the function tab of the palette.
Requirements
In order to make this package work, you have to install the JavaScript runtime Node.js, the package manager npm and Node-RED.
Note: The package has been developed and tested with v8.11.1 of Node.js and v5.6.0 of npm.
Install Node.js and npm
The package manager npm is provided along with the Node.js installation package.
Raspberry
Open up a terminal and execute the following commands:
sudo apt-get update sudo apt-get dist-upgrade curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs
Now you can check that both Node.js and npm have been installed with:
node -v npm -v
Look here and here for further details.
Otherwise, if you are on Windows you have to follow the guide below.
Windows
Download the Node.js installation package from here.
Further information can be found here.
Install Node-RED
You can install Node-RED using the following npm command:
sudo npm install -g --unsafe-perm node-red
Further information can be found here.
Install the package
Download LLSymbols_Node-RED-raspberry.zip or LLSymbols_Node-RED-windows.zip from here.
Raspberry
Once you downloaded LLSymbols_Node-RED-raspberry.zip, please save it to the following path:
/home/pi
Now open up a terminal, unzip the file and change the directory path to the folder where Node-RED had been installed. After that you can add the package by using the appropriate npm command.
The following commands summarize these steps:
cd /home/pi unzip LLSymbols_Node-RED-debian.zip -d . cd .node-red npm install /home/pi/LLSymbols_Node-RED
Now you are ready to start Node-RED.
Windows
Extract the folder LLSymbols_Node-RED from LLSymbols_Node-RED-windows.zip (for instance on your Desktop) and then follow these steps:
cd .node-red npm install C:\Users\USER_NAME\Desktop\LLSymbols_Node-RED
Now you are ready to start Node-RED.
Run Node-RED
Raspberry
node-red-start
Important: if you just started Node-RED but still don't see the nodes into the function tab, stop it with
node-red-stop
and then start it again.
Windows
node-red