NodeRED/en

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen

Introduction[Bearbeiten]

Node-RED is a graphical development tool. With Node-RED, use cases for the Internet of Things can be implemented according to a simple modular principle. In Node-RED there are so-called "nodes" which look like as follows. Each node fulfills a certain function e.g. making a HTTP-request.

Node-RED nodes.png

Preparations[Bearbeiten]

  • Use the command line to verify that Nodejs has been installed correctly.
    • To open the command line type "cmd" in the Windows search bar and press the enter key.


Command line.png Opened command line.png


  • After you have opened the command line type "node --version" in.


Check node version.png


  • Also type "npm --version" in the command line.
    • Hint: npm usually comes with Node.js


Check npm version.png


  • Internet connection available?

Installing Node-RED[Bearbeiten]

  • Open command line


Opened command line.png


  • Enter "npm install -g --unsafe-perm node-red" and press the enter key


Install node-red command.png


  • Enter "npm install node-red-node-test-helper node-red --save-dev" and press the enter key


Install node-red-node-test-helper command.png


  • Enter "node-red" and press the enter key to start Node-RED


Start node-red command.png


  • After you have started Node-RED open your browser (Chrome, Firefox, Internet Explorer, ...)
    • Enter "localhost:1880" into the search bar of your browser and press the enter key


Open Node-RED Editor.png


  • Close the browser and the command line now


Node-RED Tutorial - Part 2[Bearbeiten]

This tutorial will show you how to import Nodes from the Node-RED library into expecco

Preconditions[Bearbeiten]

  • Open the testsuite from tutorial - part 1
  • Make sure you did the step Specify necessary paths from the first part of the tutorial before you make this part.

Collect Nodes from the Node-RED library[Bearbeiten]

  • Click on OperationsCollect List of Nodes in Attachment
    • The Node-RED library gets opened in a browser and the names of each node of the library get extracted and saved in the attatchment listOfNodes
    • Hint: Collecting the node names take a few minutes and offers the opportunity for a short coffee break


Navigate to Collect List of Nodes.png


  • Node-RED library


Node-RED library.png


Installing Nodes[Bearbeiten]

  • Click on OperationsInstall Nodes


Install nodes.png


  • A window opens
    • Enter here the node name node-red-contrib-amazon-echo
    • Hint: If you want to install all nodes which contains e.g. smarthome in their names just enter *smarthome*


Enter node name.png


  • The entered node will be installed
    • Information about the installation can be found in the lower left corner of the window


Installation information.png

Finished installation.png^

Importing the Node[Bearbeiten]

  • Click on OperationsImporting Nodes


Importing a Node.png


  • A small window opens
    • Click on the little house icon
    • Navigate to .node-red → node_modules
    • Search in this folder after a folder called node-red-contrib-amazon-echo
    • Select the file index.html, then click OK


Import alexa.png


  • A new folder should have been created
    • Open this folder to see the just generated elementary blocks


Generated nodes.png



Copyright © 2014-2024 eXept Software AG