Node-RED: Difference between revisions

From Axel Public Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 6: Line 6:


These nodes interact with LogicLab and their aim is to, respectively, read/write a value for a requested symbol target.
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.


Please be aware that this documentation page is intended for Raspberry Pi[[File:Raspi.png|30px]]only.  
Please be aware that this documentation page is intended for Raspberry Pi[[File:Raspi.png|30px]]only.  
Line 11: Line 13:
'''If you downloaded our preconfigured Raspbian image, you don't have to follow this guide since Node-RED is already installed and set up to auto-start on boot.'''
'''If you downloaded our preconfigured Raspbian image, you don't have to follow this guide since Node-RED is already installed and set up to auto-start on boot.'''


After the installation, these nodes will appear into the function tab of the palette.


__TOC__
__TOC__

Revision as of 14:09, 25 June 2018

This wiki document explains how to manually install on a virgin Raspbian image 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.

After the installation, these nodes will appear into the function tab of the palette.

Please be aware that this documentation page is intended for Raspberry PiRaspi.pngonly.

If you downloaded our preconfigured Raspbian image, you don't have to follow this guide since Node-RED is already installed and set up to auto-start on boot.



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.

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 for further details.


Install Node-RED

You can install Node-RED using the following npm command:

 sudo npm install -g --unsafe-perm node-red

Ignore any error regarding the module node-pre-gyp.

Further information can be found here.


Install the package

Download LLSymbols_Node-RED-raspberry.zip from here.

Once you downloaded LLSymbols_Node-RED-raspberry.zip, move 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-raspberry.zip -d .
cd /usr/lib/node_modules/node-red
sudo npm install /home/pi/LLSymbols_Node-RED

Now you are ready to start Node-RED.


Start Node-RED manually

node-red start


Configure Node-RED to auto-start on boot

In order to make Node-RED auto-start on boot, please execute the following commands:

sudo wget -O /tmp/download https://gist.github.com/bigmonkeyboy/9962293/download 
sudo unzip /tmp/download -d /etc/init.d
sudo chmod 755 /etc/init.d/nodered
sudo update-rc.d nodered defaults

You can check further information from here.


Enable the projects feature

It is highly recommended to enable the projects feature. You have to edit the settings.js file into your Node-RED installation folder and add the following option within the module.exports block:

 editorTheme: {
       projects: {
           enabled: true
       }
 },


Node-red.png