Node-RED: Difference between revisions

From Axel Public Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 13: Line 13:
== Requirements ==
== Requirements ==
In order to make this package work, you have to install the JavaScript runtime Node.js, the package manager npm and Node-RED.
In order to make this package work, you have to install the JavaScript runtime Node.js, the package manager npm and Node-RED.


==='''Debian'''===
==='''Debian'''===
Line 20: Line 22:


Otherwise, if you are on Windows you have to implement the following guide.
Otherwise, if you are on Windows you have to implement the following guide.


==='''Windows'''===
==='''Windows'''===
==== Install Node.js ====
==== Install Node.js ====
 
Download and install Node.js from[https://nodejs.org/en/ here].
[https://nodejs.org/en/ Download Node.js]





Revision as of 11:48, 19 June 2018

This wiki document explains how to install the package that contains the following modules:

GetTagValue.png

SetTagValue.png

These nodes interact with LogicLab and their aim is to, respectively, read/write a value for a requested symbol target.


Requirements

In order to make this package work, you have to install the JavaScript runtime Node.js, the package manager npm and Node-RED.


Debian

If you have a version of Raspbian, or other Debian based install, the following script will add all the required dependencies:

bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

Further information can be retrieved here.

Otherwise, if you are on Windows you have to implement the following guide.


Windows

Install Node.js

Download and install Node.js fromhere.


Check the npm version

The package manager npm is usually distributed along with Node.js. You can check both the versions of Node.js and npm you got with:

 node -v
 npm -v

If npm didn't get added with Node.js, you can manually install it with the following command:

 sudo apt-get install npm

After that, follow this link to make sure that the versions you got are still supported by Node-RED. If not, you can manually update npm to its latest version with:

 npm install npm@latest -g

On the other side, if you have an old version of Node.js, you have to install a newer release.

Further information can be found here.

Note: The package has been developed and tested with v8.11.1 of Node.js and v5.6.0 of npm.


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.zip from here and extract the content wherever you want on your device. Open up a terminal and change the directory path to the folder where Node-RED has been installed. After that you can add the package by using the npm command shown below. Be careful to specify the full path that points to the main folder of the downloaded package.

cd /YOUR_PATH_TO/.node-red
sudo npm install YOUR_PATH_TO/LLSymbols_Node-RED


Run Node-RED

Now you can finally use the modules (nodes) of the package by starting Node-RED with the following command:

node-red start


Node-red.png