Difference between revisions of "WISE-PaaS 2.0 NodeRed"

From ESS-WIKI
Jump to: navigation, search
 
(12 intermediate revisions by one other user not shown)
Line 3: Line 3:
 
[http://nodered.org/ Node-RED] is a visual wiring tool for the Internet of Things and is provided by [https://www.ibm.com/blogs/emerging-technology/ IBM Emerging Technologies]. [http://nodered.org/ Node-Red] has several features, including browser-based flow editing, built on [https://nodejs.org/en/ Node.js] and social development. Because of browser-based, the user can use it more easily. [http://nodered.org/ Node-Red] is based on [https://nodejs.org/en/ Node.js], so user can use its nodes by using JavaScript. [http://nodered.org/ 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.
 
[http://nodered.org/ Node-RED] is a visual wiring tool for the Internet of Things and is provided by [https://www.ibm.com/blogs/emerging-technology/ IBM Emerging Technologies]. [http://nodered.org/ Node-Red] has several features, including browser-based flow editing, built on [https://nodejs.org/en/ Node.js] and social development. Because of browser-based, the user can use it more easily. [http://nodered.org/ Node-Red] is based on [https://nodejs.org/en/ Node.js], so user can use its nodes by using JavaScript. [http://nodered.org/ 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.
+
According to the restful API of WISE-PaaS 2.0, we created several nodes.
  
 
[[File:Nodered01.png|RTENOTITLE]]
 
[[File:Nodered01.png|RTENOTITLE]]
  
 
+
= How to install Node-Red Plug-ins for WISE-PaaS 2.0 =
 
 
= How to install NodeRed Plug-ins for RMM =
 
  
 
*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]
  
Line 44: Line 42:
 
     node red.js
 
     node red.js
  
 
+
= Node-Red Plug-ins Categories =
 
 
 
 
 
 
= NodeRed Plug-ins Catogries =
 
  
 
{| border="1" cellspacing="1" cellpadding="1" style="width: 1065px;"
 
{| border="1" cellspacing="1" cellpadding="1" style="width: 1065px;"
Line 63: Line 57:
 
|-
 
|-
 
| style="width: 80px; text-align: center;" | Common
 
| style="width: 80px; text-align: center;" | Common
| style="width: 812px;" | Query the history data and the information of devices, plugins and sensors
+
| style="width: 812px;" | Query the data and the information of devices, plugins and sensors
 
| style="width: 150px;" |  
 
| style="width: 150px;" |  
 
#DevicesQuery
 
#DevicesQuery
Line 72: Line 66:
 
|}
 
|}
  
 
+
= Node-Red Plug-ins Description =
 
 
= NodeRed Plug-ins Description =
 
  
 
{| border="1" cellspacing="1" cellpadding="1" style="width: 1348px;"
 
{| border="1" cellspacing="1" cellpadding="1" style="width: 1348px;"
Line 84: Line 76:
 
|-
 
|-
 
| style="text-align: center;" | ServerConfig
 
| style="text-align: center;" | ServerConfig
| style="width: 551px;" | ''Set url, port, username and password for '''WISE PaaS 2.0''' server. The node provides '''Basic '''type and '''SSO '''type.''<br/>
+
| style="width: 551px;" | ''Set url, port, username and password for '''WISE-PaaS 2.0''' server. The node provides '''Basic '''type and '''SSO '''type.''<br/>
| style="width: 214px;" | ''A timestamp trigger or button trgger.''<br/>
+
| style="width: 214px;" | ''A timestamp trigger or button trigger.''<br/>
 
| style="width: 439px;" | ''msg.url, msg.port, msg.encodestr.''<br/>
 
| style="width: 439px;" | ''msg.url, msg.port, msg.encodestr.''<br/>
 
|-
 
|-
 
| style="text-align: center;" | DevicesQuery<br/>
 
| style="text-align: center;" | DevicesQuery<br/>
 
| style="width: 551px;" | ''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.''<br/>
 
| style="width: 551px;" | ''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.''<br/>
| style="width: 214px;" | '''''ServerSetting'''''<i>Node.</i><br/>
+
| style="width: 214px;" | '''''ServerConfig&nbsp;'''''<i>Node.</i><br/>
 
| style="width: 439px;" | '''''Devices '''information list.''<br/>
 
| style="width: 439px;" | '''''Devices '''information list.''<br/>
 
|-
 
|-
 
| style="text-align: center;" | PluginsQuery<br/>
 
| style="text-align: center;" | PluginsQuery<br/>
| style="width: 551px;" | ''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.''<br/>
+
| style="width: 551px;" | ''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.''<br/>
| style="width: 214px;" | '''''ServerSetting'''''<i>Node.</i><br/>
+
| style="width: 214px;" | '''''ServerConfig&nbsp;'''''<i>Node.</i><br/>
| style="width: 439px;" | '''''Plugin '''Information list.''<br/>
+
| style="width: 439px;" | '''''Plugins&nbsp;'''Information list.''<br/>
 
|-
 
|-
 
| style="text-align: center;" | SensorsQuery<br/>
 
| style="text-align: center;" | SensorsQuery<br/>
| style="width: 551px;" | ''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&nbsp; sensor here. Ex: device id, agent id, begin timestamp, end timestamp, amount and type.''<br/>
+
| style="width: 551px;" | ''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, Plugin Name, begin timestamp, end timestamp, amount and type.''<br/>
| style="width: 214px;" | '''''ServerSetting'''''<i>Node.</i><br/>
+
| style="width: 214px;" | '''''ServerConfig&nbsp;'''''<i>Node.</i><br/>
| style="width: 439px;" | '''''Sensor '''Information list.''<br/>
+
| style="width: 439px;" | '''''Sensors&nbsp;'''Information list.''<br/>
 
|-
 
|-
 
| style="text-align: center;" | DataQuery<br/>
 
| style="text-align: center;" | DataQuery<br/>
| style="width: 551px;" | ''Retrieve data from '''WISE PaaS 2.0''' server. The node provides three types, they are '''history''', '''latest''' and '''statistic'''''<br/>
+
| style="width: 551px;" | ''Retrieve data from '''WISE-PaaS 2.0''' server. The node provides three types, they are '''history''', '''latest''' and '''statistic'''''<br/>
| style="width: 214px;" | '''''ServerSetting'''''<i>Node.</i><br/>
+
| style="width: 214px;" | '''''ServerConfig&nbsp;'''''<i>Node.</i><br/>
| style="width: 439px;" | ''The '''history '''data or '''statistic '''data&nbsp;by specific device Id within a time range.''<br/>
+
| style="width: 439px;" | ''The&nbsp;data of'''history''', '''statistic '''or'''latest'''&nbsp;by specific device Id within a time range.''<br/>
 
|}
 
|}
 
 
  
 
= Document =
 
= Document =
  
[http://ess-wiki.advantech.com.tw/view/File:NodeRed_for_wisepaas_v2.pdf NodeRed Plug-ins User Menual Doc for WISE-PaaS 2.0]
+
[http://ess-wiki.advantech.com.tw/wiki/images/2/23/NodeRed_for_WISE-PaaS.pdf Node-Red Plug-ins User Menual Doc for WISE-PaaS 2.0]

Latest revision as of 11:11, 8 January 2018

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.

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

RTENOTITLE

How to install Node-Red 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

Node-Red Plug-ins Categories

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 data and the information of devices, plugins and sensors
  1. DevicesQuery
  2. PluginsQuery
  3. SensorsQuery
  4. DataQuery

Node-Red 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 trigger.
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.
ServerConfig Node.
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.
ServerConfig Node.
Plugins 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, Plugin Name, begin timestamp, end timestamp, amount and type.
ServerConfig Node.
Sensors Information list.
DataQuery
Retrieve data from WISE-PaaS 2.0 server. The node provides three types, they are history, latest and statistic
ServerConfig Node.
The data ofhistory, statistic orlatest by specific device Id within a time range.

Document

Node-Red Plug-ins User Menual Doc for WISE-PaaS 2.0