Difference between revisions of "WISE-PaaS 2.0 NodeRed"

From ESS-WIKI
Jump to: navigation, search
Line 12: Line 12:
  
 
*Install [https://nodejs.org Node.js]
 
*Install [https://nodejs.org Node.js]
*#Download installer from [https://nodejs.org [1]]
+
*#Download installer from [https://nodejs.org Node.js]
 
*#Double-click to install [https://nodejs.org Node.js]
 
*#Double-click to install [https://nodejs.org Node.js]
  

Revision as of 05:16, 1 June 2017

Introduction

Node-RED is a visual wiring tool for the Internet of Things and is provided by IBM Emerging Technologies. Node-Red has several features, including browser-based flow editing, built on Node.js and social development. Because of browser-based, the user can use it more easily. Node-Red is based on Node.js, so user can use its nodes by using JavaScript. Node-Red also have many active communities. If the user finds bugs, he can find a solution and fix it easily. The user can use JSON format string to import or export the created flow easily.

Accroding to the restful API of WISE-PaaS 2.0, we created several nodes.

RTENOTITLE


How to install NodeRed Plug-ins for WISE-PaaS 2.0

Nodejs2.png   Nodejs3.png

  • Clone EI-NodeRed from GitLab
  • Open cmd.exe and navigate to ./EI-NodeRed folder


   cd ./EI-NodeRed
  • Type command line"npm install" to install the node-red dependencies


   npm install
  • Type command line"npm run build" to build the code of Node-Red


   npm run build
  • Type command line"npm start" or "node red.js" to run Node-Red
   npm start

or

   node red.js

NodeRed Plug-ins Catogries

Category
Description
Nodes
General
The settings of IP address, port number, login username/password of WISE-PaaS server. Retrieval of device and sensor information.
  1. ServerConfig
Common Query the history data and the information of devices, plugins and sensors
  1. DevicesQuery
  2. PluginsQuery
  3. SensorsQuery
  4. DataQuery


NodeRed Plug-ins Description

Node Name Description
Input
Output
ServerConfig Set url, port, username and password for WISE PaaS 2.0 server. The node provides Basic type and SSO type.
A timestamp trigger or button trgger.
msg.url, msg.port, msg.encodestr.
DevicesQuery
Retrieve devices information from WISE-PaaS 2.0 server. User can fill a specific device id. The text of DeviceID can be blank if user wants to retrieve all devices.
ServerSettingNode.
Devices information list.
PluginsQuery
Retrieve plugins by device Id within a time range. The maximum number of values is 10000 from WISE-PaaS 2.0 server. User can set the conditions about plugins here. Ex: device id, agent id, begin timestamp, end timestamp, amount and type.
ServerSettingNode.
Plugin Information list.
SensorsQuery
Retrieve sensors by device Id & plugin within a time range. The maximum number of values is 10000 from WISE PaaS 2.0 server. User can set the conditions about  sensor here. Ex: device id, agent id, begin timestamp, end timestamp, amount and type.
ServerSettingNode.
Sensor Information list.
DataQuery
Retrieve data from WISE PaaS 2.0 server. The node provides three types, they are history, latest and statistic
ServerSettingNode.
The history data or statistic data by specific device Id within a time range.


Document

NodeRed Plug-ins User Menual Doc for WISE-PaaS 2.0