Difference between revisions of "WISE-PaaS 2.0 EI-Agent"

From ESS-WIKI
Jump to: navigation, search
(add EI-Agent_Command_Format)
 
(20 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
*Standardization - The communication protocol is based on the [http://mqtt.org/ MQTT protocol] to communicate and exchange data with WISE-PaaS/RMM Server. The IoT sensor data report format is following the [http://www.ipso-alliance.org/ IPSO Spec.] in [http://www.json.org/ JSON format].
 
*Standardization - The communication protocol is based on the [http://mqtt.org/ MQTT protocol] to communicate and exchange data with WISE-PaaS/RMM Server. The IoT sensor data report format is following the [http://www.ipso-alliance.org/ IPSO Spec.] in [http://www.json.org/ JSON format].
 
*Portability - Whole framework is written in C language and follow the [https://en.wikipedia.org/wiki/ANSI_C ANSI C Standard], that C compilers are available for most systems and are often the first compiler provided for a new system.
 
*Portability - Whole framework is written in C language and follow the [https://en.wikipedia.org/wiki/ANSI_C ANSI C Standard], that C compilers are available for most systems and are often the first compiler provided for a new system.
*Scalability - The WISE Agent Framework is functional partitioning into discrete scalable, reusable modules, and plug & playable.
+
*Scalability - The WISE Agent Framework is functional partitioning into discrete scalable, reusable modules, and plug & playable. 
  
  
  
For scalability, Advantech implements several '''Software Modules''' to access sensor data or control target device, we called '''Plugins '''(or Handlers we called before).
+
== Architecture ==
 +
 
 +
The EI-Agent Framework is extracted from '''Agent Client Module''' of '''[[WISE-Agent|WISEAgent Framework]]''' for several purpose:
 +
 
 +
*Lightweight: Extract and implement common handshake protocol to communicate with WISE-PaaS 2.0 Server.
 +
**User can implement a lightweight application to communicate with WISE-PaaS 2.0 Server easily.
 +
*Various Connectivity Protocol: Extract the Connectivity Part as a WISEConnector Module.
 +
**In WISEConnector we can implement various connectivity protocol, such as: MQTT, AMPQ, Web Socket, HTTP, to migrate to different connectivity protocol easily.
 +
**For now, we support the MQTT connectivity protocol.
 +
 
 +
[[File:EI-Agent.png|upright|RTENOTITLE]]
  
Each plugin can be designed to handle specific jobs, such as:
+
=== Lightweight ===
  
*'''Sensor Plugin''': the plugin access sensor data through '''Sensor driver''' or '''3rd party library''', or
+
To porting whole WISE Agent to a resource restricted platform is difficult. So we are trying to extract the core functions from Agent Client to a single library called WISE Core. And we can port this small library into resource restricted platform easier.
*'''Remote Control Plugin''':  the plugin execute remote command on target device.
 
  
Based on those Plugins, Advantech also defined a set of APIs, called '''Plugin (Handler) APIs''', to support custom plugins implementation.
+
[[File:Lightweight.png|685x209px|Lightweight.png]]
  
User can implement their own Handler with these Plugin (Handler) APIs to access their sensor data or control their devices and plugged by WISE Agent to communicate with RMM Server.
+
=== Various Connectivity Protocol ===
  
 +
To support various connectivity protocols, we define the common connectivity APIs for WISE Agent, we called WISE Connector APIs. We can easily connect our WISE Agent to various Cloud Server by changing Connector Module at compile time, If those Connector Module is implemented with WISE Connector APIs. To support Microsoft Azure IoTHub, we need to implement a WISE Connector that integrate the Azure IoT Suite.
  
 +
[[File:WISEConnector.png|736x353px|WISEConnector.png]]
  
== Architecture ==
+
== [[EI-Agent_Command_Format|EI-Agent Handshake Protocol]] ==
  
== [[EI-Agent_Command_Format]] ==
+
Define the MQTT publish/subscribe topics and payload data JSON format.
  
Denfine the MQTT publish/subscribe topics and payload data in JSON format.
+
The topic and message format is defined in "[https://github.com/ADVANTECH-Corp/EI-Agent/blob/master/Include/wisepaas_02_def.h wisepaas_02_def.h]"
  
== EI-Agent Sample Client ==
+
== [[EI-Agent_Sample_Client|EI-Agent_Sample_Client]] ==
  
 
*'''Sample Client - Simple client application example.'''
 
*'''Sample Client - Simple client application example.'''
  
 +
== Source Code ==
 +
 +
*[https://github.com/ADVANTECH-Corp/EI-Agent <big><big>''https://github.com/ADVANTECH-Corp/EI-Agent''</big></big>]
 +
 +
== Connect to WISE-PaaS/EdgeSense ==
 +
 +
[https://portal-rmm.wise-paas.com/main/overview WISE-PaaS 2.0]
 +
 +
=== How to change login account ===
 +
 +
1. Login your WISE-PaaS 2.0 account
 +
 +
2. Copy IoTKey & Credential URL
 +
 +
[[File:Edge-sense1.png|200x300px|Edge-sense1.png]]
  
 +
[[File:Edge-sense2.png|500x600px|Edge-sense2.png]]
  
== EI-Agent Sample Handler ==
+
[[File:Edge-sense3.png|500x600px|Edge-sense3.png]]
  
*'''ModbusSample&nbsp;'''- only support Modbus-TCP and&nbsp;Modbus-RTU.
+
3. Modify IoTKey & Credential URL in /usr/local/AgentService/agent_config.xml
  
'''ModbusSample''' is one of handlers in EI-Agent framework and is used to collect devices’ data based on Modbus TCP or RTU protocol.<br/>The library used in ModbusSample is [http://libmodbus.org/documentation/ libmodbus], which is a 3rd party free library to send/receive data according to the Modbus protocol.<br/>This library is written in C and supports RTU (serial) and TCP (Ethernet) communication. The license of libmodbus is LGPL v2.1v.
+
[[File:Edge-sense4.png|1000x1100px|Edge-sense4.png]]
  
== Source Code ==
+
4. Restart RMM-EI-Agent service
  
*[https://github.com/ADVANTECH-Corp/EI-Agent <big><big>''https://github.com/ADVANTECH-Corp/EI-Agent''</big></big>]
+
/etc/init.d/saagent restart

Latest revision as of 04:55, 18 May 2018

EI-Agent – a software development framework to communicate between device and IoT/EI-PaaS Server.

Advantech provides a software development framework to communicate and exchange information between a device and IoT/EI-PaaS Server, called a EI-Agent framework.
The EI-Agent framework provides a rich set of user-friendly, intelligent and integrated interfaces, which speeds development, enhances security and makes agent application easier and simpler to communicate with IoT/EI-PaaS Server.
The framework has three benefits:

  • Standardization - The communication protocol is based on the MQTT protocol to communicate and exchange data with WISE-PaaS/RMM Server. The IoT sensor data report format is following the IPSO Spec. in JSON format.
  • Portability - Whole framework is written in C language and follow the ANSI C Standard, that C compilers are available for most systems and are often the first compiler provided for a new system.
  • Scalability - The WISE Agent Framework is functional partitioning into discrete scalable, reusable modules, and plug & playable. 


Architecture

The EI-Agent Framework is extracted from Agent Client Module of WISEAgent Framework for several purpose:

  • Lightweight: Extract and implement common handshake protocol to communicate with WISE-PaaS 2.0 Server.
    • User can implement a lightweight application to communicate with WISE-PaaS 2.0 Server easily.
  • Various Connectivity Protocol: Extract the Connectivity Part as a WISEConnector Module.
    • In WISEConnector we can implement various connectivity protocol, such as: MQTT, AMPQ, Web Socket, HTTP, to migrate to different connectivity protocol easily.
    • For now, we support the MQTT connectivity protocol.

RTENOTITLE

Lightweight

To porting whole WISE Agent to a resource restricted platform is difficult. So we are trying to extract the core functions from Agent Client to a single library called WISE Core. And we can port this small library into resource restricted platform easier.

Lightweight.png

Various Connectivity Protocol

To support various connectivity protocols, we define the common connectivity APIs for WISE Agent, we called WISE Connector APIs. We can easily connect our WISE Agent to various Cloud Server by changing Connector Module at compile time, If those Connector Module is implemented with WISE Connector APIs. To support Microsoft Azure IoTHub, we need to implement a WISE Connector that integrate the Azure IoT Suite.

WISEConnector.png

EI-Agent Handshake Protocol

Define the MQTT publish/subscribe topics and payload data JSON format.

The topic and message format is defined in "wisepaas_02_def.h"

EI-Agent_Sample_Client

  • Sample Client - Simple client application example.

Source Code

Connect to WISE-PaaS/EdgeSense

WISE-PaaS 2.0

How to change login account

1. Login your WISE-PaaS 2.0 account

2. Copy IoTKey & Credential URL

Edge-sense1.png

Edge-sense2.png

Edge-sense3.png

3. Modify IoTKey & Credential URL in /usr/local/AgentService/agent_config.xml

Edge-sense4.png

4. Restart RMM-EI-Agent service

/etc/init.d/saagent restart