Difference between revisions of "WISE-PaaS/2.0 Protocol"
From ESS-WIKI
Eric.liang (talk | contribs) |
Eric.liang (talk | contribs) |
||
Line 10: | Line 10: | ||
*Type: Info | *Type: Info | ||
*Direction: Agent -> Server | *Direction: Agent -> Server | ||
− | *Topic: /wisepaas/device/00000001-0000-0000-0000- | + | *Topic: /wisepaas/device/00000001-0000-0000-0000-001077C25002/agentinfoack |
*QoS: 0 | *QoS: 0 | ||
*Retained: 0 | *Retained: 0 |
Revision as of 08:21, 14 December 2017
Contents
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 ]
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/RMM/00000001-0000-0000-0000-999BAB6F4000/agentactionack
- 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: /cagent/admin/<devID>/agentcallbackreq
- QoS: 0
- Retained: 0
- Payload:
// WISE-PaaS/2.0 { "content": { "catalogID": 4 }, "commCmd": 2051, "agentID": "", "handlerName": "general", "sendTS": { "$date": 1512550184369 } } { "susiCommData":{ "sessionID":"2746E3B65BAB115338B9668CDC5C35C4", "sensorIDList":{ "e":[ { "n":"SenHub/Info/sw" } ] }, "commCmd":523, "requestID":0, "agentID":"", "handlerName":"SenHub", "sendTS":1466057267 } }
- Description: Agent will reply its data value.
- Type: Reply
- Direction: Agent -> Server
- Topic: /cagent/admin/<devID>/agentactionreq
- QoS: 0
- Retained: 0
- Payload:
{ "susiCommData":{ "commCmd":524, "handlerName":"SenHub", "sessionID":"2746E3B65BAB115338B9668CDC5C35C4", "sensorInfoList":{ "e":[ { "n":"/Info/sw", "sv":"1.0.00", "StatusCode":200 } ] } } }
Set Data
- Description: Server can send mqtt message to set sensor data value.
- Type: Request
- Direction: Server -> Agent
- Topic: /cagent/admin/<devID>/agentcallbackreq
- QoS: 0
- Retained: 0
- Payload:
{ "susiCommData":{ "sensorIDList":{ "e":[ { "sv":"SenHub1", "n":"SenHub/Info/Name" } ] }, "sessionID":"4DDF0B6DE2773176095F55E8C930507A", "commCmd":525, "requestID":0, "agentID":"", "handlerName":"SenHub", "sendTS":1466088605 } }
- Description: Agent will reply its result.
- Type: Reply
- Direction: Agent -> Server
- Topic: /cagent/admin/<devID>/agentactionreq
- QoS: 0
- Retained: 0
- Payload:
{ "susiCommData":{ "commCmd":526, "handlerName":"SenHub", "sessionID":"4DDF0B6DE2773176095F55E8C930507A", "sensorInfoList":{ "e":[ { "n":"/Info/Name", "sv":"SenHub1", "StatusCode":200 } ] } } }