Difference between revisions of "WISE-Agent"
(→Introduction) |
|||
(65 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | + | '''WISE Agent – a software development framework to communicate between device and RMM Server.'''<br/>Advantech provides a software development framework to communicate and exchange information between a device and RMM Server, called a WISE Agent framework.<br/>The WISE 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 RMM Server.<br/>The framework has three benefits: | |
− | |||
− | |||
+ | *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. | ||
+ | *Scalability - The WISE Agent Framework is functional partitioning into discrete scalable, reusable modules, and plug & playable. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | ==Document== | + | For scalability, Advantech implements several '''Software Modules''' to access sensor data or control target device, we called '''Plugins '''(or Handlers we called before). |
− | *[[Media:WISE-PaaS_RMM_3.1_WISE-Agent_DG_V1.3.pdf | + | |
− | *[[Media:WISE-PaaS_RMM_3.1_WISE- | + | Each plugin can be designed to handle specific jobs, such as: |
− | *[[Media:WISE-PaaS_RMM_3.1_WISE-Agent_Command_Format_DG_V1.2.pdf | + | |
+ | *'''Sensor Plugin''': the plugin access sensor data through '''Sensor driver''' or '''3rd party library'''. | ||
+ | *'''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. | ||
+ | |||
+ | 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. | ||
+ | |||
+ | == Architecture == | ||
+ | |||
+ | In '''WISE Agent Framework''', it includes two parts: '''WISE Agent''' and '''Handlers'''. | ||
+ | |||
+ | *In '''Provisioning & Communication''' block, There are defined two structures: | ||
+ | |||
+ | #'''Platform Profiler''' structure describe the target platform, include: OS version, SN, Device Name, MAC address, … | ||
+ | #'''Configuration''' structure describe how to connect to RMM server, such as Server IP, Listen Port, TLS/SSL setting, … | ||
+ | |||
+ | And the '''Agent Client''' is the main library of WISE Agent to communicate with RMM Server, based on MQTT protocol. | ||
+ | |||
+ | |||
+ | |||
+ | *In '''Core Management''' block, | ||
+ | |||
+ | #The '''Core Manager''' integrates and manages the WISE Agent resources and keeps them alive. | ||
+ | #The '''Handler Loader''' is responsible to load and manage the handlers, that indicated in module_config.xml file. | ||
+ | #The '''RMM Command''' is responsible to handle the commands that control the Agent, such as: Agent Rename or Agent Update. | ||
+ | |||
+ | | ||
+ | |||
+ | *The '''Handlers''' part includes the handlers we implement for RMM Agent, such as SUSI Control, Power On/Off. And any other custom handlers that implemented follow our Handler APIs. | ||
+ | |||
+ | [[File:WISEAgentArchitecture.png|760x600px|WISEAgent SW Architecture]] | ||
+ | |||
+ | == [[WISE-Agent_Sample_Client|WISE-Agent Sample Client]] == | ||
+ | |||
+ | *'''Sample Client - Simple client application example.''' | ||
+ | |||
+ | == RMM Plugins == | ||
+ | |||
+ | In RMM Agent, Advantech provide several Plugins (Handlers) and can be classified in three different categories: | ||
+ | |||
+ | *Monitoring Plugins - sensor data monitoring and control. | ||
+ | |||
+ | Such as: Hard-disk Monitor, SUSI Control, Network Monitor, Process Monitor, IoT Gateway and Modbus. | ||
+ | |||
+ | *Control Plugins - remote control target device. | ||
+ | |||
+ | Such as: Power On/Off, Remote KVM, Screenshot, Terminal, Protection and Recovery. | ||
+ | |||
+ | *Agent Improvement Plugins - to increase the agent reliability or functionality. | ||
+ | |||
+ | Such as: Server Redundancy. | ||
+ | |||
+ | [[File:HandlerTable.png|585x456px|RTENOTITLE]] | ||
+ | |||
+ | == [[WISE-Agent_Sample_Handler|WISE-Agent Sample Handler]] == | ||
+ | |||
+ | *'''Modbus Handler''' - version 2.0 only support Modbus-TCP, Modbus-RTU supported since version 3.0. | ||
+ | |||
+ | '''Modbus handler''' is one of handlers in WISE Agent framework and is used to collect devices’ data based on Modbus TCP protocol.<br/>The library used in Modbus handler 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.1. | ||
+ | |||
+ | The flow of WISE Agent communicating with a device based on Modbus by Modbus handler is described as follows.<br/>The WISE Agent uses the Modbus handler as the interface to handle all the communication with the device based on Modbus protocol. | ||
+ | |||
+ | *'''Steps of Modbus Handler:''' | ||
+ | **'''Step1''' Modbus handler reads in INI file and is ready to set up connection with device according to the configuration in the INI file. | ||
+ | **'''Step2''' Modbus handler establishes a Modbus connection | ||
+ | **'''Step3''' WISE Agent communicates with the device. | ||
+ | **'''Step4''' If you no more need the communication, WISE Agent can disconnect with the device. | ||
+ | |||
+ | [[File:Modbus-Step.png|760x600px|Steps of Modbus handler]] | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | *'''GPS Handler''' - version 1.0 only support [https://en.wikipedia.org/wiki/NMEA_0183 NMEA 0183] format with serial port. | ||
+ | |||
+ | '''GPS Handler''' is used to parse the GPS stream in NMEA 0183 format and report current position to server continuously. | ||
+ | |||
+ | The report information include: Serial Port Name, Mode, Timestamp, Latitude, Longitude and Altitude. | ||
+ | |||
+ | Mode 2 means the GPS device only support two-dimensional information without Altitude. | ||
+ | |||
+ | Mode 3 means the GPS support three-dimensional information with Altitude. | ||
+ | |||
+ | [[File:GPS Reader.png|RTENOTITLE]] | ||
+ | |||
+ | The GPS Handler config file is only need to define the serial port attribute, include: Serial Port and Baud Rate. | ||
+ | |||
+ | The default GPSHandler.ini is read stream from com 1, and the baud rate is 9200. | ||
+ | |||
+ | {| border="1" cellspacing="1" cellpadding="1" style="width:500px;" | ||
+ | |- | ||
+ | | [Platform]<br/>SerialPortNum=1<br/>Baud=9200<br/> | ||
+ | |} | ||
+ | |||
+ | |||
+ | |||
+ | *'''RFID Handler - '''version 1.0 only support [http://www.favite.com/index.asp FAVITE] low level command protocol. | ||
+ | |||
+ | RFID Handler is interacted with FAVITE RFID Reader with low level command protocol through serial port. | ||
+ | |||
+ | The report information include: Serial Port, Baud Rate, Parity Mode, Stop Bits, Byte Size, Manufacturer Name, Product Name, Serial Number and EPC Code. | ||
+ | |||
+ | [[File:RFID.png|RTENOTITLE]] | ||
+ | |||
+ | The RFID Handler config file is only need to define the serial port attribute, include: Serial Port and Baud Rate. | ||
+ | |||
+ | The default RFIDHandler.ini define the serial port with read stream form com1, baud rate is 115200, stop bits is 1, parity mode is none and byte size is 8. | ||
+ | |||
+ | And enable the debounce with set the toggle target to disable and query command inventory session flag to 1. | ||
+ | |||
+ | {| border="1" cellspacing="1" cellpadding="1" style="width:500px;" | ||
+ | |- | ||
+ | | [Platform]<br/>SerialPortNum=1<br/>Baud=115200<br/>StopBits=1<br/>Parity=0<br/>ByteSize=8<br/># Toggle 0:disable, 1:enable.<br/># Inventory Session 0:s0, 1:s1, 2:s2, 3:s3<br/># Set toggle:0 with Session:0~4 in different trigger rule to support debounce.<br/>Toggle=0<br/>Session=1<br/> | ||
+ | |} | ||
+ | |||
+ | == [[WISE-Agent_Verification_Tool|WISE-Agent Verification Tool]] == | ||
+ | |||
+ | <span style="font-size:larger;">'''AgentTester – a software tool for testing all sorts of functions and modules of the Agent.'''</span> | ||
+ | |||
+ | == Source Code == | ||
+ | |||
+ | *[https://github.com/ADVANTECH-Corp/WISEAgent <big><big>''https://github.com/ADVANTECH-Corp/WISEAgent''</big></big>] | ||
+ | |||
+ | == Document == | ||
+ | |||
+ | *[[Media:WISE-PaaS_RMM_3.1_WISE-Agent_DG_V1.3.pdf|<big><big>''RMM 3.1 WISE-Agent Developer Guide''</big></big>]] | ||
+ | *[[Media:WISE-PaaS_RMM_3.1_WISE-Agent_Modbus_Handler_DG_V3.2.pdf|<big><big>''RMM 3.1 WISE-Agent Modbus Handler Developer Guide''</big></big>]] | ||
+ | *[[Media:WISE-PaaS_RMM_3.1_WISE-Agent_Command_Format_DG_V1.2.pdf|<big><big>''RMM 3.1 WISE-Agent Command Format Developer Guide''</big></big>]] | ||
+ | *[[Media:WISE-PaaS_RMM_3.2_AgentTester_UM_V1.0.pdf|<big><big>''RMM 3.2 WISE-Agent AgentTester User Manual''</big></big>]] | ||
+ | *[[Media:WISE-PaaS_RMM_3.2_WISE-Agent_DG_V1.0_20160930.pdf|<big><big>''RMM 3.2 WISE-Agent Developer Guide''</big></big>]] | ||
+ | *[[Media:WISE-PaaS_RMM_3.3_WISE-Agent_Command_Format_DG_V1.4.pdf|<big><big>''RMM 3.3 WISE-Agent Command Format Developer Guide''</big></big>]] | ||
+ | *[[Media:WISE-PaaS_RMM_3.3_WISE-Agent_DG_V1.4.pdf|<big><big>''RMM 3.3 WISE-Agent Developer Guide''</big></big>]] |
Latest revision as of 07:58, 28 September 2017
WISE Agent – a software development framework to communicate between device and RMM Server.
Advantech provides a software development framework to communicate and exchange information between a device and RMM Server, called a WISE Agent framework.
The WISE 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 RMM 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.
For scalability, Advantech implements several Software Modules to access sensor data or control target device, we called Plugins (or Handlers we called before).
Each plugin can be designed to handle specific jobs, such as:
- Sensor Plugin: the plugin access sensor data through Sensor driver or 3rd party library.
- 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.
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.
Contents
Architecture
In WISE Agent Framework, it includes two parts: WISE Agent and Handlers.
- In Provisioning & Communication block, There are defined two structures:
- Platform Profiler structure describe the target platform, include: OS version, SN, Device Name, MAC address, …
- Configuration structure describe how to connect to RMM server, such as Server IP, Listen Port, TLS/SSL setting, …
And the Agent Client is the main library of WISE Agent to communicate with RMM Server, based on MQTT protocol.
- In Core Management block,
- The Core Manager integrates and manages the WISE Agent resources and keeps them alive.
- The Handler Loader is responsible to load and manage the handlers, that indicated in module_config.xml file.
- The RMM Command is responsible to handle the commands that control the Agent, such as: Agent Rename or Agent Update.
- The Handlers part includes the handlers we implement for RMM Agent, such as SUSI Control, Power On/Off. And any other custom handlers that implemented follow our Handler APIs.
WISE-Agent Sample Client
- Sample Client - Simple client application example.
RMM Plugins
In RMM Agent, Advantech provide several Plugins (Handlers) and can be classified in three different categories:
- Monitoring Plugins - sensor data monitoring and control.
Such as: Hard-disk Monitor, SUSI Control, Network Monitor, Process Monitor, IoT Gateway and Modbus.
- Control Plugins - remote control target device.
Such as: Power On/Off, Remote KVM, Screenshot, Terminal, Protection and Recovery.
- Agent Improvement Plugins - to increase the agent reliability or functionality.
Such as: Server Redundancy.
WISE-Agent Sample Handler
- Modbus Handler - version 2.0 only support Modbus-TCP, Modbus-RTU supported since version 3.0.
Modbus handler is one of handlers in WISE Agent framework and is used to collect devices’ data based on Modbus TCP protocol.
The library used in Modbus handler is libmodbus, which is a 3rd party free library to send/receive data according to the Modbus protocol.
This library is written in C and supports RTU (serial) and TCP (Ethernet) communication. The license of libmodbus is LGPL v2.1.
The flow of WISE Agent communicating with a device based on Modbus by Modbus handler is described as follows.
The WISE Agent uses the Modbus handler as the interface to handle all the communication with the device based on Modbus protocol.
- Steps of Modbus Handler:
- Step1 Modbus handler reads in INI file and is ready to set up connection with device according to the configuration in the INI file.
- Step2 Modbus handler establishes a Modbus connection
- Step3 WISE Agent communicates with the device.
- Step4 If you no more need the communication, WISE Agent can disconnect with the device.
- GPS Handler - version 1.0 only support NMEA 0183 format with serial port.
GPS Handler is used to parse the GPS stream in NMEA 0183 format and report current position to server continuously.
The report information include: Serial Port Name, Mode, Timestamp, Latitude, Longitude and Altitude.
Mode 2 means the GPS device only support two-dimensional information without Altitude.
Mode 3 means the GPS support three-dimensional information with Altitude.
The GPS Handler config file is only need to define the serial port attribute, include: Serial Port and Baud Rate.
The default GPSHandler.ini is read stream from com 1, and the baud rate is 9200.
[Platform] SerialPortNum=1 Baud=9200 |
- RFID Handler - version 1.0 only support FAVITE low level command protocol.
RFID Handler is interacted with FAVITE RFID Reader with low level command protocol through serial port.
The report information include: Serial Port, Baud Rate, Parity Mode, Stop Bits, Byte Size, Manufacturer Name, Product Name, Serial Number and EPC Code.
The RFID Handler config file is only need to define the serial port attribute, include: Serial Port and Baud Rate.
The default RFIDHandler.ini define the serial port with read stream form com1, baud rate is 115200, stop bits is 1, parity mode is none and byte size is 8.
And enable the debounce with set the toggle target to disable and query command inventory session flag to 1.
[Platform] SerialPortNum=1 Baud=115200 StopBits=1 Parity=0 ByteSize=8 # Toggle 0:disable, 1:enable. # Inventory Session 0:s0, 1:s1, 2:s2, 3:s3 # Set toggle:0 with Session:0~4 in different trigger rule to support debounce. Toggle=0 Session=1 |
WISE-Agent Verification Tool
AgentTester – a software tool for testing all sorts of functions and modules of the Agent.