Difference between revisions of "WISE-PaaS/2.0 Protocol"

From ESS-WIKI
Jump to: navigation, search
(Protocol)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
= Overview =
 
= Overview =
  
:Introduction for "EI-Agent to WISE-PaaS-2.0 communication protocol". WISEAgent communication protocol is base on standard MQTT protocol. We also define Advantech IoT Topic and message in JSON format. Follow standard to design our [[http://ess-wiki.advantech.com.tw/view/IoTGateway/SDK/WirelessSensorNetworkSDK|Advantech Sensor Format in JSON ]]
+
:Introduction for "EI-Agent to WISE-PaaS-2.0 communication protocol". WISEAgent communication protocol is base on standard MQTT protocol. We also define Advantech IoT Topic and message in JSON format. Follow standard to design our [[http://ess-wiki.advantech.com.tw/view/IoTGateway/SDK/WirelessSensorNetworkSDK|Advantech Sensor Format in JSON ]]    [http://advgitlab.eastasia.cloudapp.azure.com/WISE-PaaS-Documentation/Documentation/blob/master/documents/EI-Connect/handshake-protocol.md EI-Agent Protocol]
 +
 
  
 
= Protocol =
 
= Protocol =
Line 7: Line 8:
 
== Connect ==
 
== Connect ==
  
*Description: Agent Client sends the "Connect Info" to WISE-PaaS-2.0 Server for on-line notification.
+
*Description: Agent Client sends the "Connect Info" to WISE-PaaS-2.0 Server for on-line notification.  
*Type: Info
+
*Type: Info  
*Direction: Agent -> Server
+
*Direction: Agent -> Server  
*Topic: /wisepaas/device/00000001-0000-0000-0000-001077C25002/agentinfoack
+
*Topic: /wisepaas/device/00000001-0000-0000-0000-001077C25002/agentinfoack  
*QoS: 0
+
*QoS: 0  
*Retained: 0
+
*Retained: 0  
*Payload:
+
*Payload:  
 
<pre>{
 
<pre>{
 
&nbsp;&nbsp; &nbsp;"content": {
 
&nbsp;&nbsp; &nbsp;"content": {
Line 40: Line 41:
 
== OS Info ==
 
== OS Info ==
  
*Description: Agent Client sends the OS Info" to RMM Server for device OS information.
+
*Description: Agent Client sends the OS Info" to RMM Server for device OS information.  
*Type: Info
+
*Type: Info  
*Direction: Agent -> Server
+
*Direction: Agent -> Server  
*Topic: /wisepaas/RMM/00000001-0000-0000-0000-999BAB6F4000/agentactionack
+
*Topic: /wisepaas/RMM/00000001-0000-0000-0000-999BAB6F4000/agentactionack  
*QoS: 0
+
*QoS: 0  
*Retained: 0
+
*Retained: 0  
*Payload:
+
*Payload:  
 
<pre>{
 
<pre>{
 
&nbsp;&nbsp; &nbsp;"content": {
 
&nbsp;&nbsp; &nbsp;"content": {
Line 68: Line 69:
 
}</pre>
 
}</pre>
  
 
+
&nbsp;
  
 
== Disconnect ==
 
== Disconnect ==
  
*Description: Agent Client sends the "Disconnect Info" to Server for off-line notification.
+
*Description: Agent Client sends the "Disconnect Info" to Server for off-line notification.  
*Type: Info
+
*Type: Info  
*Direction: Agent -> Server
+
*Direction: Agent -> Server  
*Topic: /wisepaas/device/00000001-0000-0000-0000-001077C25002/agentinfoack
+
*Topic: /wisepaas/device/00000001-0000-0000-0000-001077C25002/agentinfoack  
*QoS: 0
+
*QoS: 0  
*Retained: 0
+
*Retained: 0  
*Payload:
+
*Payload:  
 
<pre>{
 
<pre>{
 
&nbsp;&nbsp; &nbsp;"content": {
 
&nbsp;&nbsp; &nbsp;"content": {
Line 105: Line 106:
 
== Will Message ==
 
== Will Message ==
  
*Description: While Client lost connection or keep-alive timeout, the will message will send to the client that subscribe the topic
+
*Description: While Client lost connection or keep-alive timeout, the will message will send to the client that subscribe the topic  
*Type: Info
+
*Type: Info  
*Direction: Agent -> Broker
+
*Direction: Agent -> Broker  
*Topic: /wisepaas/device/00000001-0000-0000-0000-999BAB6F4000/willmessage
+
*Topic: /wisepaas/device/00000001-0000-0000-0000-999BAB6F4000/willmessage  
*QoS: 0
+
*QoS: 0  
*Retained: 0
+
*Retained: 0  
*Payload:
+
*Payload:  
 
<pre>{
 
<pre>{
 
&nbsp;&nbsp; &nbsp;"content": {
 
&nbsp;&nbsp; &nbsp;"content": {
Line 138: Line 139:
 
== Info or Update Device's Capability ==
 
== Info or Update Device's Capability ==
  
*Description: Agent will send it's capability to Server for description all resource.
+
*Description: Agent will send it's capability to Server for description all resource.  
*Type: Auto update
+
*Type: Auto update  
*Direction: Agent-> Server
+
*Direction: Agent-> Server  
*Topic: /wisepaas/RMM/00000001-0000-0000-0000-999BAB6F4000/agentactionack
+
*Topic: /wisepaas/RMM/00000001-0000-0000-0000-999BAB6F4000/agentactionack  
*QoS: 0
+
*QoS: 0  
*Retained: 0
+
*Retained: 0  
*Payload:&nbsp;
+
*Payload:&nbsp;  
  
 
Example: HDD PMQ&nbsp;Capability
 
Example: HDD PMQ&nbsp;Capability
Line 152: Line 153:
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"info": {
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"info": {
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"bn": "info",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"bn": "info",
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"e": [
+
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"e": [{"n": "type","sv": "PMQ","asm": "r"},{"n": "name","sv": "HDD_PMQ","asm": "r"},{"n": "description","sv": "This service is HDD PMQ Service","asm": "r"},
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{
+
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; {"n": "version","sv": "1.0.2","asm": "r"},{"n": "confidence level","v": 83.12,"asm": "r","u": "%"},{"n": "update","sv": null,"asm": "rw"},
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"n": "type",
+
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; {"n": "eventNotify","bv": true,"asm": "r"}]
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"sv": "PMQ",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"asm": "r"
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"n": "name",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"sv": "HDD_PMQ",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"asm": "r"
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"n": "description",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"sv": "This service is HDD PMQ Service",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"asm": "r"
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"n": "version",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"sv": "1.0.2",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bsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"action": {
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"action": {
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"bn": "action",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"bn": "action",
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"e": [
+
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"e": [{"n": "a1","bv": false,"asm": "r","msg": "Lower system temperature ( < 40 Celsius )."},{"n": "a2","bv": false,"asm": "r","msg": "Backup data to new disk."},
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{
+
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; {"n": "a3","bv": false,"asm": "r","msg": "Check power source."},{"n": "ActionLog","sv": null,"asm": "r"}]
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"n": "a1",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"bv": false,
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"asm": "r",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"msg": "Lower system temperature ( < 40 Celsius )."
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"n": "a2",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"bv": false,
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"asm": "r",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"msg": "Backup data to new disk."
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbs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sp; &nbsp;&nbsp;&nbsp; &nbsp;"sv": null,
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"asm": "r"
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;]
 
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"param": {
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"param": {
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"bn": "param",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"bn": "param",
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"e": [
+
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"e": [{"n": "report interval","v": 60,"max": 3600,"min": 10,"asm": "rw","u": "sec"},{"n": "enable report","bv": true,"asm": "rw"}]
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbs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": "enable report",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"bv": true,
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"asm": "rw"
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;]
 
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"opTS": {
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"opTS": {
Line 248: Line 177:
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"$date": 1510044371815
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"$date": 1510044371815
 
&nbsp;&nbsp; &nbsp;}
 
&nbsp;&nbsp; &nbsp;}
}
+
}</pre>
</pre>
 
  
 
== Auto Update Data Value ==
 
== Auto Update Data Value ==
  
*Description: Agent will update latest value to server.
+
*Description: Agent will update latest value to server.  
*Type: Auto update
+
*Type: Auto update  
*Direction: Agent-> Server
+
*Direction: Agent-> Server  
*Topic: /wisepaas/RMM/00000001-0000-0000-0000-999BAB6F4000/agentactionack
+
*Topic: /wisepaas/device/00000001-0000-0000-0000-999BAB6F4000/devinfoack
*QoS: 0
+
*QoS: 0  
*Retained: 0
+
*Retained: 0  
*Payload:
+
*Payload:  
 
<pre>{
 
<pre>{
 
&nbsp;&nbsp; &nbsp;"content": {
 
&nbsp;&nbsp; &nbsp;"content": {
Line 265: Line 193:
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"info": {
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"info": {
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"bn": "info",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"bn": "info",
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"e": [
+
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"e": [{"n": "version","sv": "1.0.2"},{"n": "confidence level","v": 89.6,"asm": "r","u": "%"}]
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"n": "version",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"sv": "1.0.2"
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;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&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"bn": "param",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"bn": "param",
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"e": [
+
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"e": [{"n": "report interval","v": 30},{"n": "enable report","bv": true}]
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"n": "report interval",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"v": 30
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"n": "enable report",
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"bv": true
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;]
 
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"opTS": {
 
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"opTS": {
Line 306: Line 214:
 
== <span style="background-color:#FF8C00;">Get Sensor Data</span> ==
 
== <span style="background-color:#FF8C00;">Get Sensor Data</span> ==
  
*Description: Server can send mqtt message to get sensor data value.
+
*Description: Server can send mqtt message to get sensor data value.  
*Type: Request
+
*Type: Request  
*Direction: Server -> Agent
+
*Direction: Server -> Agent  
*Topic: /cagent/admin/&lt;devID&gt;/agentcallbackreq
+
*Topic: /wisepaas/RMM/00000001-0000-0000-0000-000babbb7ef3/agentactionreq
*QoS: 0
+
*QoS: 0  
*Retained: 0
+
*Retained: 0  
*Payload:
+
*Payload:  
 
<pre>{
 
<pre>{
 
&nbsp; &nbsp; "agentId": "00000001-0000-0000-0000-000babbb7ef3",
 
&nbsp; &nbsp; "agentId": "00000001-0000-0000-0000-000babbb7ef3",
Line 320: Line 228:
 
&nbsp; &nbsp; &nbsp; &nbsp; "sessionID": "2A1FBCA22A64C2E27341DB5FA7E83FBF",
 
&nbsp; &nbsp; &nbsp; &nbsp; "sessionID": "2A1FBCA22A64C2E27341DB5FA7E83FBF",
 
&nbsp; &nbsp; &nbsp; &nbsp; "sensorIDList": {
 
&nbsp; &nbsp; &nbsp; &nbsp; "sensorIDList": {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "e": [
+
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "e": [{"n": "custom/custom_data2"}]
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {"n": "custom/custom_data2"}
 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]
 
 
&nbsp; &nbsp; &nbsp; &nbsp; }
 
&nbsp; &nbsp; &nbsp; &nbsp; }
 
&nbsp; &nbsp; }
 
&nbsp; &nbsp; }
}
+
}</pre>
</pre>
 
  
*Description: Agent will reply its data value.
+
*Description: Agent will reply its data value.  
*Type: Reply
+
*Type: Reply  
*Direction: Agent -> Server
+
*Direction: Agent -> Server  
*Topic: /wisepaas/device/00000001-0000-0000-0000-000babbb7ef3/agentactionack
+
*Topic: /wisepaas/RMM/00000001-0000-0000-0000-000babbb7ef3/agentactionack  
*QoS: 0
+
*QoS: 0  
*Retained: 0
+
*Retained: 0  
*Payload:
+
*Payload:  
 
<pre>{
 
<pre>{
 
&nbsp; &nbsp; "agentID": "00000001-0000-0000-0000-000babbb7ef3",
 
&nbsp; &nbsp; "agentID": "00000001-0000-0000-0000-000babbb7ef3",
Line 342: Line 247:
 
&nbsp; &nbsp; &nbsp; &nbsp; "sessionID": "2A1FBCA22A64C2E27341DB5FA7E83FBF",
 
&nbsp; &nbsp; &nbsp; &nbsp; "sessionID": "2A1FBCA22A64C2E27341DB5FA7E83FBF",
 
&nbsp; &nbsp; &nbsp; &nbsp; "sensorInfoList": {
 
&nbsp; &nbsp; &nbsp; &nbsp; "sensorInfoList": {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "e": [
+
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "e": [{"n": "custom/custom_data2","v": 123,"StatusCode": 200}]
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "n": "custom/custom_data2",
 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "v": 123,
 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "StatusCode": 200
 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]
 
 
&nbsp; &nbsp; &nbsp; &nbsp; }
 
&nbsp; &nbsp; &nbsp; &nbsp; }
 
&nbsp; &nbsp; },
 
&nbsp; &nbsp; },
 
&nbsp; &nbsp; "sendTS": {"$date": 1499328934471}
 
&nbsp; &nbsp; "sendTS": {"$date": 1499328934471}
}
+
}</pre>
</pre>
+
 
  
 
== <span style="background-color:#FF8C00;">Set Data</span> ==
 
== <span style="background-color:#FF8C00;">Set Data</span> ==
  
*Description: Server can send mqtt message to set sensor data value.
+
*Description: Server can send mqtt message to set sensor data value.  
*Type: Request
+
*Type: Request  
*Direction: Server -> Agent
+
*Direction: Server -> Agent  
*Topic:/wisepaas/RMM/00000001-0000-0000-0000-000babbb7ef3/agentactionreq
+
*Topic:/wisepaas/RMM/00000001-0000-0000-0000-000babbb7ef3/agentactionreq  
*QoS: 0
+
*QoS: 0  
*Retained: 0
+
*Retained: 0  
*Payload:
+
*Payload:  
 
<pre>{
 
<pre>{
        "agentId": "00000001-0000-0000-0000-000babbb7ef3",
+
&nbsp; &nbsp; "agentId": "00000001-0000-0000-0000-000babbb7ef3",
        "handlerName": "SenHub",
+
&nbsp; &nbsp; "handlerName": "custom",
        "commCmd": 525,
+
&nbsp; &nbsp; "commCmd": 525,
        "sessionID": "B303E3DE2C062B8C148DAEF2D3F6C723",
+
&nbsp; &nbsp; "content": {
        "content": {
+
&nbsp; &nbsp; &nbsp; &nbsp; "sessionID": "B303E3DE2C062B8C148DAEF2D3F6C723",
                "sensorIDList": {
+
&nbsp; &nbsp; &nbsp; &nbsp; "sensorIDList": {
                        "e": [{"n": "SenHub/Action/image-update","sv":"<BASE64>"}]
+
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "e": [{"v": 12,"n": "custom/custom_data2"}]
                }
+
&nbsp; &nbsp; &nbsp; &nbsp; }
        }
+
&nbsp; &nbsp; }
 
}</pre>
 
}</pre>
  
*Description: Agent will reply its result. There are have two status 1. status code: 202 -> device receive this command, 2. code: 200 -> succesful to set, code: is not 200 => Fail to set
+
*Description: Agent will reply its result. There are have two status 1. status code: 202 -> device receive this command, 2. code: 200 -> succesful to set, code: is not 200 => Fail to set  
*Type: Reply
+
*Type: Reply  
*Direction: Agent -> Server
+
*Direction: Agent -> Server  
*Topic: /wisepaas/RMM/00000001-0000-0000-0000-000babbb7ef3/agentactionreq
+
*Topic: /wisepaas/RMM/00000001-0000-0000-0000-000babbb7ef3/agentactionack
*QoS: 0
+
*QoS: 0  
*Retained: 0
+
*Retained: 0  
*Payload:
+
*Payload:  
  
 
Accept&nbsp;1:
 
Accept&nbsp;1:
<pre>{ "susiCommData":{ "commCmd":526, "handlerName":"SenHub", "sessionID":"B303E3DE2C062B8C148DAEF2D3F6C723", "sensorInfoList":{ "e":[ { "n":"Accept", "StatusCode":202} ] } } }</pre>
+
<pre>{
 +
&nbsp; &nbsp; "agentID": "00000001-0000-0000-0000-000babbb7ef3",
 +
&nbsp; &nbsp; "commCmd": 526,
 +
&nbsp; &nbsp; "handlerName": "custom",
 +
&nbsp; &nbsp; "content": {
 +
&nbsp; &nbsp; &nbsp; &nbsp; "sessionID": "B303E3DE2C062B8C148DAEF2D3F6C723",
 +
&nbsp; &nbsp; &nbsp; &nbsp; "sensorInfoList":{
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "e": [
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "n": "custom/custom_data2",
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "sv": "Accept",
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "StatusCode": 202
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]
 +
&nbsp; &nbsp; &nbsp; &nbsp; },
 +
&nbsp; &nbsp; },
 +
&nbsp; &nbsp; "sendTS": {"$date": 1499329284038}
 +
}</pre>
  
 
Success:
 
Success:
<pre>{
+
<pre>{
  "susiCommData":
+
&nbsp; &nbsp; "agentID": "00000001-0000-0000-0000-000babbb7ef3",
    "commCmd":526,
+
&nbsp; &nbsp; "commCmd": 526,
    "handlerName":"SenHub",
+
&nbsp; &nbsp; "handlerName": "custom",
    "sessionID":"B303E3DE2C062B8C148DAEF2D3F6C723",
+
&nbsp; &nbsp; "content": {
    "sensorInfoList":{
+
&nbsp; &nbsp; &nbsp; &nbsp; "sessionID": "B303E3DE2C062B8C148DAEF2D3F6C723",
        "e":[
+
&nbsp; &nbsp; &nbsp; &nbsp; "sensorInfoList":{
          {
+
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "e": [
              "n":"SenHub/Action/image-update",
+
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
              "StatusCode":200
+
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "n": "custom/custom_data2",
          }
+
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "sv": "Success",
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "StatusCode": 200
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]
 +
&nbsp; &nbsp; &nbsp; &nbsp; },
 +
&nbsp; &nbsp; },
 +
&nbsp; &nbsp; "sendTS": {"$date": 1499329284038}
 +
}
 +
</pre>
 +
 
 +
== Event Notify ==
 +
Description: Agent send event notify to Server
 +
Type: Auto Report
 +
Direction: Server -> Agent
 +
Topic:/wisepaas/RMM/00000001-0000-0000-0000-000babbb7ef3/eventnotify
 +
QoS: 0
 +
Retained: 0
 +
<pre>
 +
{
 +
  "commCmd":2059,
 +
  "agentID":"00000001-0000-0000-0000-305A3A77B1DA",
 +
  "handlerName":"general",
 +
  "content":{
 +
    "eventnotify":{
 +
      "subtype":"ACTION_TRIGGER_INFO",
 +
      "msg":"Action "00000001-0000-0000-0000-305A3A77B1DA/SUSIControl/Hardware Monitor/GPIO/DI0" triggered by 00000001-0000-0000-0000-305A3A77B1DA/HDDMonitor/hddSmartInfoList/Disk0/TotalLBAsWritten/value:1",
 +
      "extMsg": {
 +
        "rules":[
 +
          {
 +
            "n": "00000001-0000-0000-0000-305A3A77B1DA/HDDMonitor/hddSmartInfoList/Disk0/TotalLBAsWritten/value",
 +
            "v":1,
 +
            "action":"00000001-0000-0000-0000-305A3A77B1DA/SUSIControl/Hardware Monitor/GPIO/DI0",
 +
            "param":true,
 +
            "status":"trigger"
 +
          }
 
         ]
 
         ]
    }
+
      }
   }
+
    },
 +
    "opTS":{"$date":1494308768000}
 +
  },
 +
   "sendTS":{"$date":1522457629328}
 
}
 
}
 
</pre>
 
</pre>

Latest revision as of 06:57, 17 February 2023

Overview

Introduction for "EI-Agent to WISE-PaaS-2.0 communication protocol". WISEAgent communication protocol is base on standard MQTT protocol. We also define Advantech IoT Topic and message in JSON format. Follow standard to design our [Sensor Format in JSON ]    EI-Agent Protocol


Protocol

Connect

  • Description: Agent Client sends the "Connect Info" to WISE-PaaS-2.0 Server for on-line notification.
  • Type: Info
  • Direction: Agent -> Server
  • Topic: /wisepaas/device/00000001-0000-0000-0000-001077C25002/agentinfoack
  • QoS: 0
  • Retained: 0
  • Payload:
{
    "content": {
        "parentID": "00000001-0000-0000-8888-0034115521a4",
        "hostname": "ESL-Tag-5002",
        "sn": "0000001077C25002",
        "mac": "0000001077C25002",
        "version": "1.0.7.252316989",
        "type": "SenHub",
        "product": "ESL-Tag",
        "manufacture": "",
        "account": "",
        "passwd": "",
        "status": 1,
        "tag": "ESL"
    },
    "commCmd": 1,
    "agentID": "00000001-0000-0000-0000-001077C25002",
    "handlerName": "SenHub",
    "sendTS": {
        "$date": 1513232002117
    }
}

OS Info

  • Description: Agent Client sends the OS Info" to RMM Server for device OS information.
  • Type: Info
  • Direction: Agent -> Server
  • Topic: /wisepaas/RMM/00000001-0000-0000-0000-999BAB6F4000/agentactionack
  • QoS: 0
  • Retained: 0
  • Payload:
{
    "content": {
        "cagentVersion": "1.0.6.0",
        "cagentType": "IPC",
        "osVersion": "Windows Embedded Standard",
        "biosVersion": "V1.10",
        "platformName": "ARK-DS762",
        "processorName": "Intel(R) Core(TM) i7-3610QE CPU @ 2.30GHz",
        "osArch": "X64",
        "totalPhysMemKB": 1973544,
        "macs": "00:0B:AB:6F:37:52",
        "IP": "172.22.12.84"
    },
    "commCmd": 116,
    "agentID": "00000001-0000-0000-0000-999BAB6F4000",
    "handlerName": "general",
    "sendTS": {
        "$date": 1510044371812
    }
}

 

Disconnect

  • Description: Agent Client sends the "Disconnect Info" to Server for off-line notification.
  • Type: Info
  • Direction: Agent -> Server
  • Topic: /wisepaas/device/00000001-0000-0000-0000-001077C25002/agentinfoack
  • QoS: 0
  • Retained: 0
  • Payload:
{
    "content": {
        "parentID": "00000001-0000-0000-8888-0034115521a4",
        "hostname": "ESL-Tag-5002",
        "sn": "0000001077C25002",
        "mac": "0000001077C25002",
        "version": "1.0.7.252316989",
        "type": "SenHub",
        "product": "ESL-Tag",
        "manufacture": "",
        "account": "",
        "passwd": "",
        "status": 0,
        "tag": "ESL"
    },
    "commCmd": 1,
    "agentID": "00000001-0000-0000-0000-001077C25002",
    "handlerName": "SenHub",
    "sendTS": {
        "$date": 1513232002117
    }
}

Will Message

  • Description: While Client lost connection or keep-alive timeout, the will message will send to the client that subscribe the topic
  • Type: Info
  • Direction: Agent -> Broker
  • Topic: /wisepaas/device/00000001-0000-0000-0000-999BAB6F4000/willmessage
  • QoS: 0
  • Retained: 0
  • Payload:
{
    "content": {
        "parentID": "",
        "hostname": "chihyu-PC",
        "sn": "000BAB578433",
        "mac": "000BAB6F3752",
        "version": "1.0.6.0",
        "type": "IPC",
        "product": "",
        "manufacture": "",
        "account": "",
        "passwd": "",
        "status": 0,
        "tag": "RMM"
    },
    "commCmd": 1,
    "agentID": "00000001-0000-0000-0000-999BAB6F4000",
    "handlerName": "general",
    "sendTS": {
        "$date": 1510044370561
    }
}

Info or Update Device's Capability

  • Description: Agent will send it's capability to Server for description all resource.
  • Type: Auto update
  • Direction: Agent-> Server
  • Topic: /wisepaas/RMM/00000001-0000-0000-0000-999BAB6F4000/agentactionack
  • QoS: 0
  • Retained: 0
  • Payload: 

Example: HDD PMQ Capability

{
    "content": {
        "HDD_PMQ": {
            "info": {
                "bn": "info",
                "e": [{"n": "type","sv": "PMQ","asm": "r"},{"n": "name","sv": "HDD_PMQ","asm": "r"},{"n": "description","sv": "This service is HDD PMQ Service","asm": "r"},
                      {"n": "version","sv": "1.0.2","asm": "r"},{"n": "confidence level","v": 83.12,"asm": "r","u": "%"},{"n": "update","sv": null,"asm": "rw"},
                      {"n": "eventNotify","bv": true,"asm": "r"}]
            },
            "action": {
                "bn": "action",
                "e": [{"n": "a1","bv": false,"asm": "r","msg": "Lower system temperature ( < 40 Celsius )."},{"n": "a2","bv": false,"asm": "r","msg": "Backup data to new disk."},
                      {"n": "a3","bv": false,"asm": "r","msg": "Check power source."},{"n": "ActionLog","sv": null,"asm": "r"}]
            },
            "param": {
                "bn": "param",
                "e": [{"n": "report interval","v": 60,"max": 3600,"min": 10,"asm": "rw","u": "sec"},{"n": "enable report","bv": true,"asm": "rw"}]
            },
            "opTS": {
                "$date": 1510044371815
            }
        }
    },
    "commCmd": 2052,
    "agentID": "00000001-0000-0000-0000-999BAB6F4000",
    "handlerName": "general",
    "sendTS": {
        "$date": 1510044371815
    }
}

Auto Update Data Value

  • Description: Agent will update latest value to server.
  • Type: Auto update
  • Direction: Agent-> Server
  • Topic: /wisepaas/device/00000001-0000-0000-0000-999BAB6F4000/devinfoack
  • QoS: 0
  • Retained: 0
  • Payload:
{
    "content": {
        "HDD_PMQ": {
            "info": {
                "bn": "info",
                "e": [{"n": "version","sv": "1.0.2"},{"n": "confidence level","v": 89.6,"asm": "r","u": "%"}]
            },
            "param": {
                "bn": "param",
                "e": [{"n": "report interval","v": 30},{"n": "enable report","bv": true}]
            },
            "opTS": {
                "$date": 1510044371815
            }
        }
    },
    "commCmd": 2055,
    "agentID": "00000001-0000-0000-0000-999BAB6F4000",
    "handlerName": "general",
    "sendTS": {
        "$date": 1510044371815
    }
}

Get Sensor Data

  • Description: Server can send mqtt message to get sensor data value.
  • Type: Request
  • Direction: Server -> Agent
  • Topic: /wisepaas/RMM/00000001-0000-0000-0000-000babbb7ef3/agentactionreq
  • QoS: 0
  • Retained: 0
  • Payload:
{
    "agentId": "00000001-0000-0000-0000-000babbb7ef3",
    "handlerName": "custom",
    "commCmd": 523,
    "content": {
        "sessionID": "2A1FBCA22A64C2E27341DB5FA7E83FBF",
        "sensorIDList": {
            "e": [{"n": "custom/custom_data2"}]
        }
    }
}
  • Description: Agent will reply its data value.
  • Type: Reply
  • Direction: Agent -> Server
  • Topic: /wisepaas/RMM/00000001-0000-0000-0000-000babbb7ef3/agentactionack
  • QoS: 0
  • Retained: 0
  • Payload:
{
    "agentID": "00000001-0000-0000-0000-000babbb7ef3",
    "commCmd": 524,
    "handlerName": "custom",
    "content": {
        "sessionID": "2A1FBCA22A64C2E27341DB5FA7E83FBF",
        "sensorInfoList": {
            "e": [{"n": "custom/custom_data2","v": 123,"StatusCode": 200}]
        }
    },
    "sendTS": {"$date": 1499328934471}
}


Set Data

  • Description: Server can send mqtt message to set sensor data value.
  • Type: Request
  • Direction: Server -> Agent
  • Topic:/wisepaas/RMM/00000001-0000-0000-0000-000babbb7ef3/agentactionreq
  • QoS: 0
  • Retained: 0
  • Payload:
{
    "agentId": "00000001-0000-0000-0000-000babbb7ef3",
    "handlerName": "custom",
    "commCmd": 525,
    "content": {
        "sessionID": "B303E3DE2C062B8C148DAEF2D3F6C723",
        "sensorIDList": {
            "e": [{"v": 12,"n": "custom/custom_data2"}]
        }
    }
}
  • Description: Agent will reply its result. There are have two status 1. status code: 202 -> device receive this command, 2. code: 200 -> succesful to set, code: is not 200 => Fail to set
  • Type: Reply
  • Direction: Agent -> Server
  • Topic: /wisepaas/RMM/00000001-0000-0000-0000-000babbb7ef3/agentactionack
  • QoS: 0
  • Retained: 0
  • Payload:

Accept 1:

{
    "agentID": "00000001-0000-0000-0000-000babbb7ef3",
    "commCmd": 526,
    "handlerName": "custom",
    "content": {
        "sessionID": "B303E3DE2C062B8C148DAEF2D3F6C723",
        "sensorInfoList":{
            "e": [
                {
                    "n": "custom/custom_data2",
                    "sv": "Accept",
                    "StatusCode": 202
                }
            ]
        },
    },
    "sendTS": {"$date": 1499329284038}
}

Success:

{
    "agentID": "00000001-0000-0000-0000-000babbb7ef3",
    "commCmd": 526,
    "handlerName": "custom",
    "content": {
        "sessionID": "B303E3DE2C062B8C148DAEF2D3F6C723",
        "sensorInfoList":{
            "e": [
                {
                    "n": "custom/custom_data2",
                    "sv": "Success",
                    "StatusCode": 200
                }
            ]
        },
    },
    "sendTS": {"$date": 1499329284038}
}

Event Notify

Description: Agent send event notify to Server Type: Auto Report Direction: Server -> Agent Topic:/wisepaas/RMM/00000001-0000-0000-0000-000babbb7ef3/eventnotify QoS: 0 Retained: 0

{
  "commCmd":2059,
  "agentID":"00000001-0000-0000-0000-305A3A77B1DA",
  "handlerName":"general",
  "content":{
    "eventnotify":{
      "subtype":"ACTION_TRIGGER_INFO",
      "msg":"Action "00000001-0000-0000-0000-305A3A77B1DA/SUSIControl/Hardware Monitor/GPIO/DI0" triggered by 00000001-0000-0000-0000-305A3A77B1DA/HDDMonitor/hddSmartInfoList/Disk0/TotalLBAsWritten/value:1",
      "extMsg": {
        "rules":[
          {
            "n": "00000001-0000-0000-0000-305A3A77B1DA/HDDMonitor/hddSmartInfoList/Disk0/TotalLBAsWritten/value",
            "v":1,
            "action":"00000001-0000-0000-0000-305A3A77B1DA/SUSIControl/Hardware Monitor/GPIO/DI0",
            "param":true,
            "status":"trigger"
          }
        ]
      }
    },
    "opTS":{"$date":1494308768000}
  },
  "sendTS":{"$date":1522457629328}
}