Difference between revisions of "EnOcean Link Solution"

From ESS-WIKI
Jump to: navigation, search
Line 623: Line 623:
 
== <span style="font-size:x-large;">Gateway Configuration:</span> ==
 
== <span style="font-size:x-large;">Gateway Configuration:</span> ==
  
<span style="font-size:medium;">1. Download RMM EI Agent 1.0.12 from [https://portal-rmm.wise-paas.com/main/system https://portal-rmm.wise-paas.com/main/system] and install it to the Gateway.</span><br/><span style="font-size:medium;">2. Stop services EI-AgentService and SAWatchdog from Task Manager.</span><br/><span style="font-size:medium;">3. Download CAgent_Patch_for_WSN-v1-2018-04-09.zip from [https://www.dropbox.com/s/icyhvbfqbs1sw2s/CAgent_Patch_for_WSN-v1-2018-04-09.zip?dl=0 https://www.dropbox.com/s/icyhvbfqbs1sw2s/CAgent_Patch_for_WSN-v1-2018-04-09.zip?dl=0], unzip and copy the files into the folder which RMM EI Agent installed, ex: C:\Program Files (x86)\Advantech\RMM EI Agent</span><br/><span style="font-size:medium;">4. Restart services EI-AgentService and SAWatchdog from Task Manager.</span>
+
<span style="font-size:larger;">1. Download RMM EI Agent 1.0.12 from [https://portal-rmm.wise-paas.com/main/system https://portal-rmm.wise-paas.com/main/system] and install it to the Gateway.<br/>2. Stop services EI-AgentService and SAWatchdog from Task Manager.<br/>3. Download CAgent_Patch_for_WSN-v1-2018-04-09.zip from [https://www.dropbox.com/s/icyhvbfqbs1sw2s/CAgent_Patch_for_WSN-v1-2018-04-09.zip?dl=0 https://www.dropbox.com/s/icyhvbfqbs1sw2s/CAgent_Patch_for_WSN-v1-2018-04-09.zip?dl=0], unzip and copy the files into the folder which RMM EI Agent installed, ex: C:\Program Files (x86)\Advantech\RMM EI Agent<br/>4. Restart services EI-AgentService and SAWatchdog from Task Manager.</span>
  
  
Line 635: Line 635:
 
<span style="font-size:larger;">&nbsp; &nbsp; Note. You can get your "Credential URL" and "IoTKey" from&nbsp; Agent Credential screen&nbsp;in the WISE-PaaS portal: [https://portal-rmm.wise-paas.com/main/system https://portal-rmm.wise-paas.com/main/system]</span>
 
<span style="font-size:larger;">&nbsp; &nbsp; Note. You can get your "Credential URL" and "IoTKey" from&nbsp; Agent Credential screen&nbsp;in the WISE-PaaS portal: [https://portal-rmm.wise-paas.com/main/system https://portal-rmm.wise-paas.com/main/system]</span>
  
<br/><span style="font-size:medium;">6. Download MQTTBroker 1.0.3 from [https://www.dropbox.com/s/wyt3gnenyf7xv3d/MQTTBrokerSetup_1.0.3.exe?dl=0 https://www.dropbox.com/s/wyt3gnenyf7xv3d/MQTTBrokerSetup_1.0.3.exe?dl=0] and install it to the Gateway.</span><br/><span style="font-size:medium;">7. Download NodeRed Server IoTGateway v2.0.1 from [https://www.dropbox.com/s/qvthwy4a5aeo2yx/NodeRed%20Server%20IoTGateway_v2.0.1.exe?dl=0 https://www.dropbox.com/s/qvthwy4a5aeo2yx/NodeRed%20Server%20IoTGateway_v2.0.1.exe?dl=0] and install it to the Gateway.</span>
+
<span style="font-size:larger;"><br/>6. Download MQTTBroker 1.0.3 from [https://www.dropbox.com/s/wyt3gnenyf7xv3d/MQTTBrokerSetup_1.0.3.exe?dl=0 https://www.dropbox.com/s/wyt3gnenyf7xv3d/MQTTBrokerSetup_1.0.3.exe?dl=0] and install it to the Gateway.<br/>7. Download NodeRed Server IoTGateway v2.0.1 from [https://www.dropbox.com/s/qvthwy4a5aeo2yx/NodeRed%20Server%20IoTGateway_v2.0.1.exe?dl=0 https://www.dropbox.com/s/qvthwy4a5aeo2yx/NodeRed%20Server%20IoTGateway_v2.0.1.exe?dl=0] and install it to the Gateway.</span>
  
<span style="font-size:medium;">8. Download USB receiver driver from [https://www.dropbox.com/s/6bguuh4nfynuekn/CDM21228_Setup.zip?dl=0 https://www.dropbox.com/s/6bguuh4nfynuekn/CDM21228_Setup.zip?dl=0]&nbsp;and install it to the Gateway.</span><br/><span style="font-size:medium;">9. Download EoLinkManager 1.0.2&nbsp;from [https://www.dropbox.com/s/2ggh18mijhj2fm8/EoLinkManagerSetup_1.0.2.exe?dl=0 https://www.dropbox.com/s/2ggh18mijhj2fm8/EoLinkManagerSetup_1.0.2.exe?dl=0]&nbsp;and install it to the Gateway.</span>
+
<span style="font-size:larger;">8. Download USB receiver driver from [https://www.dropbox.com/s/6bguuh4nfynuekn/CDM21228_Setup.zip?dl=0 https://www.dropbox.com/s/6bguuh4nfynuekn/CDM21228_Setup.zip?dl=0]&nbsp;and install it to the Gateway.<br/>9. Download EoLinkManager 1.0.2&nbsp;from [https://www.dropbox.com/s/2ggh18mijhj2fm8/EoLinkManagerSetup_1.0.2.exe?dl=0 https://www.dropbox.com/s/2ggh18mijhj2fm8/EoLinkManagerSetup_1.0.2.exe?dl=0]&nbsp;and install it to the Gateway.</span>
  
<span style="font-size:medium;">10. Open EoLinkManager.ini and set the configurations:<br/>&nbsp; &nbsp;> notepad C:\Program Files (x86)\Advantech\EoLinkManager\EoLinkManager.ini</span>
+
<span style="font-size:larger;">10. Open EoLinkManager.ini and set the configurations:<br/>&nbsp; &nbsp;> notepad C:\Program Files (x86)\Advantech\EoLinkManager\EoLinkManager.ini</span>
  
<span style="font-size:medium;">&nbsp; &nbsp;------------------------------------------</span>
+
<span style="font-size:larger;">&nbsp; &nbsp;------------------------------------------</span>
  
<span style="font-size:medium;">&nbsp; &nbsp;[Platform]<br/>&nbsp; &nbsp;InterfaceName=EoLinkReceiver<br/>&nbsp; &nbsp;ServerURL=127.0.0.1<br/>&nbsp; &nbsp;ModuleName=EoLinkManager<br/>&nbsp; &nbsp;SensorName=LightSensor<br/>&nbsp; &nbsp;SerialPort=COM3<br/>&nbsp; &nbsp;ServerPort=1883<br/>&nbsp; &nbsp;Interval=1<br/>&nbsp; &nbsp;#Interval: The time delay between data access round in second.&nbsp;</span>
+
<span style="font-size:larger;">&nbsp; &nbsp;[Platform]<br/>&nbsp; &nbsp;InterfaceName=EoLinkReceiver<br/>&nbsp; &nbsp;ServerURL=127.0.0.1<br/>&nbsp; &nbsp;ModuleName=EoLinkManager<br/>&nbsp; &nbsp;SensorName=LightSensor<br/>&nbsp; &nbsp;SerialPort=COM3<br/>&nbsp; &nbsp;ServerPort=1883<br/>&nbsp; &nbsp;Interval=1<br/>&nbsp; &nbsp;#Interval: The time delay between data access round in second.&nbsp;</span>
  
  
  
<span style="font-size:medium;">&nbsp; &nbsp;[Sensors]<br/>&nbsp; &nbsp;NumberOfSensors=2<br/>&nbsp; &nbsp;Sensor0=04016943<br/>&nbsp; &nbsp;Sensor1=0400E889<br/>&nbsp; &nbsp;------------------------------------------</span>
+
<span style="font-size:larger;">&nbsp; &nbsp;[Sensors]<br/>&nbsp; &nbsp;NumberOfSensors=2<br/>&nbsp; &nbsp;Sensor0=04016943<br/>&nbsp; &nbsp;Sensor1=0400E889<br/>&nbsp; &nbsp;------------------------------------------</span>
  
  
  
<span style="font-size:medium;">11. Reboot Gateway,&nbsp;the program&nbsp;APIGateway and&nbsp;EoLinkManager will auto startup, in case of these two programs are closed, you can restart them manually:</span>
+
<span style="font-size:larger;">11. Reboot Gateway,&nbsp;the program&nbsp;APIGateway and&nbsp;EoLinkManager will auto startup, in case of these two programs are closed, you can restart them manually:</span>
  
<span style="font-size:medium;">11.1. Run APIGateway manually:<br/>&nbsp; &nbsp; > cd C:\APIGateway<br/>&nbsp; &nbsp; > node app.js</span><br/><span style="font-size:medium;">&nbsp; &nbsp;(Tips: You can also double click APIGateway icon on the Gateway's Desktop to run it)<br/>11.2. Run EoLinkManager manually:<br/>&nbsp; &nbsp; > cd C:\Program Files (x86)\Advantech\EoLinkManager<br/>&nbsp; &nbsp; > EoLinkManager.exe&nbsp;<br/>&nbsp; &nbsp;(Tips: You can also double click EoLinkManager icon on the Gateway's Desktop to run it)<br/>&nbsp; &nbsp;<br/>12. Open [https://portal-rmm.wise-paas.com/main/device https://portal-rmm.wise-paas.com/main/device] and add your device.</span>
+
<span style="font-size:larger;">11.1. Run APIGateway manually:<br/>&nbsp; &nbsp; > cd C:\APIGateway<br/>&nbsp; &nbsp; > node app.js<br/>&nbsp; &nbsp;(Tips: You can also double click APIGateway icon on the Gateway's Desktop to run it)<br/>11.2. Run EoLinkManager manually:<br/>&nbsp; &nbsp; > cd C:\Program Files (x86)\Advantech\EoLinkManager<br/>&nbsp; &nbsp; > EoLinkManager.exe&nbsp;<br/>&nbsp; &nbsp;(Tips: You can also double click EoLinkManager icon on the Gateway's Desktop to run it)<br/>&nbsp; &nbsp;<br/>12. Open [https://portal-rmm.wise-paas.com/main/device https://portal-rmm.wise-paas.com/main/device] and add your device.</span>
  
<span style="font-size:medium;">13. Open [https://dashboard-grafana-eiot.wise-paas.com https://dashboard-grafana-eiot.wise-paas.com] to check Tower Light UI.</span>
+
<span style="font-size:larger;">13. Open [https://dashboard-grafana-eiot.wise-paas.com https://dashboard-grafana-eiot.wise-paas.com] to check Tower Light UI.</span>
 
[[Category:Editor]]
 
[[Category:Editor]]

Revision as of 08:00, 4 May 2018

System Architecture:

Rohm light tower sensor demokit 01.png
















EnOcean Sensor and Light Tower (chip & demo kit vendor: ROHM)

EnOcean light sensor 01.png













Sensor Communication Protocol:

EnOcean light sensor 03.png





Tower Light Data Format:

EnOcean light sensor 02.png












EnOcean Sample Program:

EnOcean light sensor 04.png









Data type and Data Format:

Agent ID (Sensor ID): String

Sensor Data: Unsigned Integer number

Data Capability in JSON:

{
   "susiCommData":{
      "infoSpec":{
         "SenHub":{
            "SenData":{
               "e":[
                  {
                     "n":"Header",
                     "u":"",
                     "v":0,
                     "min":0,
                     "max":255,
                     "asm":"r",
                     "type":"d",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  },
                  {
                     "n":"ExtendedTelegramType",
                     "u":"",
                     "v":0,
                     "min":0,
                     "max":255,
                     "asm":"r",
                     "type":"d",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  },
                  {
                     "n":"OriginatorID",
                     "u":"",
                     "sv":"",
                     "min":0,
                     "max":0,
                     "asm":"r",
                     "type":"s",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  },
                  {
                     "n":"FwVersion",
                     "u":"",
                     "v":0,
                     "min":0,
                     "max":255,
                     "asm":"r",
                     "type":"d",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  },
                  {
                     "n":"PacketType",
                     "u":"",
                     "v":0,
                     "min":0,
                     "max":15,
                     "asm":"r",
                     "type":"d",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  },
                  {
                     "n":"ActionMode",
                     "u":"",
                     "v":0,
                     "min":0,
                     "max":15,
                     "asm":"r",
                     "type":"d",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  },
                  {
                     "n":"PacketIndex",
                     "u":"",
                     "v":0,
                     "min":0,
                     "max":255,
                     "asm":"r",
                     "type":"d",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  },
                  {
                     "n":"TxType",
                     "u":"",
                     "v":0,
                     "min":0,
                     "max":15,
                     "asm":"r",
                     "type":"d",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  },
                  {
                     "n":"BatteryVoltage",
                     "u":"",
                     "v":0,
                     "min":0,
                     "max":15,
                     "asm":"r",
                     "type":"d",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  },
                  {
                     "n":"Light1",
                     "u":"State",
                     "v":0,
                     "min":0,
                     "max":4,
                     "asm":"r",
                     "type":"d",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  },
                  {
                     "n":"Light2",
                     "u":"State",
                     "v":0,
                     "min":0,
                     "max":4,
                     "asm":"r",
                     "type":"d",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  },
                  {
                     "n":"Light3",
                     "u":"State",
                     "v":0,
                     "min":0,
                     "max":4,
                     "asm":"r",
                     "type":"d",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  },
                  {
                     "n":"Light4",
                     "u":"State",
                     "v":0,
                     "min":0,
                     "max":4,
                     "asm":"r",
                     "type":"d",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  },
                  {
                     "n":"SignalStrength",
                     "u":"dBm",
                     "v":0,
                     "min":0,
                     "max":255,
                     "asm":"r",
                     "type":"d",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  }
               ],
               "bn":"SenData"
            },
            "Info":{
               "e":[
                  {
                     "n":"Name",
                     "u":"",
                     "sv":"LightSensor",
                     "min":0,
                     "max":0,
                     "asm":"r",
                     "type":"s",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  },
                  {
                     "n":"sw",
                     "u":"",
                     "sv":"1.0.00",
                     "min":0,
                     "max":0,
                     "asm":"r",
                     "type":"s",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  }
               ],
               "bn":"Info"
            },
            "Net":{
               "e":[
                  {
                     "n":"sw",
                     "u":"",
                     "sv":"2.0.0.0",
                     "min":0,
                     "max":0,
                     "asm":"r",
                     "type":"s",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  },
                  {
                     "n":"Neighbor",
                     "u":"",
                     "sv":"",
                     "min":0,
                     "max":0,
                     "asm":"r",
                     "type":"s",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  },
                  {
                     "n":"Health",
                     "u":"",
                     "v":100,
                     "min":0,
                     "max":0,
                     "asm":"r",
                     "type":"d",
                     "rt":"",
                     "st":"ipso",
                     "exten":""
                  }
               ],
               "bn":"Net"
            },
            "Action":{
               "e":[

               ],
               "bn":"Action"
            },
            "ver":1
         }
      },
      "commCmd":2052,
      "requestID":2001,
      "agentID":"0017000004016943",
      "handlerName":"general",
      "sendTS":160081024
   }
}

Data Upload Format in JSON:

{
   "susiCommData":{
      "data":{
         "SenHub":{
            "SenData":{
               "e":[
                  {
                     "n":"Header",
                     "v":47
                  },
                  {
                     "n":"ExtendedTelegramType",
                     "v":7
                  },
                  {
                     "n":"OriginatorID",
                     "sv":"000004016943"
                  },
                  {
                     "n":"FwVersion",
                     "v":1
                  },
                  {
                     "n":"PacketType",
                     "v":0
                  },
                  {
                     "n":"ActionMode",
                     "v":0
                  },
                  {
                     "n":"PacketIndex",
                     "v":195
                  },
                  {
                     "n":"TxType",
                     "v":1
                  },
                  {
                     "n":"BatteryVoltage",
                     "v":15
                  },
                  {
                     "n":"Light1",
                     "v":0
                  },
                  {
                     "n":"Light2",
                     "v":0
                  },
                  {
                     "n":"Light3",
                     "v":0
                  },
                  {
                     "n":"Light4",
                     "v":0
                  },
                  {
                     "n":"SignalStrength",
                     "v":54
                  }
               ],
               "bn":"SenData"
            },
            "ver":1
         }
      },
      "commCmd":2055,
      "requestID":2001,
      "agentID":"0017000004016943",
      "handlerName":"general",
      "sendTS":160081115
   }
}

Protocol Specification:

http://ess-wiki.advantech.com.tw/wiki/images/d/d9/Advantech_EnOcean_light_tower_2018.03.18.pdf


Dashboard Configuration:

1. Sign in WISE-PaaS Dashboard using your User ID and Password:

    https://dashboard-grafana-eiot.wise-paas.com

Tower Light 03-1.png






2. Drop down “Home” and select Tower Light Board.

    Board name: Advantech EIoT DTOS Tower Light Monitoring


Tower Light 04-1.png




Tower Light 05-1.png



3. You will see the board is showed like this when all lights off:

Tower Light 01 .png






4. You will see the board is showed like this when all lights on:

Tower Light 02 .png








5. Drop down “Tower Light” and select “Edit” to edit the widget’s HTML:

Tower Light 06-2.png





6. Define Tower Light Sensor ID in the widget’s HTML:

Tower Light 10.png






7. RESTful API and HTML request content:

Tower Light 08-1.png






RESTful API:      

https://portal-rmm.wise-paas.com/rmm/v1/grafana/simplejson/query

 

Example:

cache: false

url: 'https://portal-rmm.wise-paas.com/rmm/v1/grafana/simplejson/query'

type: "post",

contentType: 'application/json'

dataType: 'json'

data: '{"timezone":"browser","panelId":2,"range":{"from":"2018-04-09T05:46:51.357Z","to":"2018-04-09T09:46:51.357Z","raw":{"from":"now-6h","to":"now"}},"rangeRaw":{"from":"now-6h","to":"now"},"interval":"20s","intervalMs":20000,"targets":[{"target":"00000001-0000-0000-0017-000004016940|SenHub|/SenData/Light1","device":"00000001-0000-0000-0017-000004016940","plugin":"SenHub","sensor":"/SenData/Light1","refId":"A","type":"table"}],"maxDataPoints":960,"scopedVars":{"__interval":{"text":"20s","value":"20s"},"__interval_ms":{"text":20000,"value":20000}}}'

xhrFields: {withCredentials: true}



8. Lights blinking status for the Tower Light:

Tower Light 09.png




Gateway Configuration:

1. Download RMM EI Agent 1.0.12 from https://portal-rmm.wise-paas.com/main/system and install it to the Gateway.
2. Stop services EI-AgentService and SAWatchdog from Task Manager.
3. Download CAgent_Patch_for_WSN-v1-2018-04-09.zip from https://www.dropbox.com/s/icyhvbfqbs1sw2s/CAgent_Patch_for_WSN-v1-2018-04-09.zip?dl=0, unzip and copy the files into the folder which RMM EI Agent installed, ex: C:\Program Files (x86)\Advantech\RMM EI Agent
4. Restart services EI-AgentService and SAWatchdog from Task Manager.


5. Double click "ServerSettings" icon on Gateway's desktop.

    5.1 Input Password for the Password Authentications dialog and press [Confirm] button to close the dialog. 

    5.2 Input Credential URL and IoTKey for the Server Setting dialog. Press [Save] to close the dialog.

    Note. You can get your "Credential URL" and "IoTKey" from  Agent Credential screen in the WISE-PaaS portal: https://portal-rmm.wise-paas.com/main/system


6. Download MQTTBroker 1.0.3 from https://www.dropbox.com/s/wyt3gnenyf7xv3d/MQTTBrokerSetup_1.0.3.exe?dl=0 and install it to the Gateway.
7. Download NodeRed Server IoTGateway v2.0.1 from https://www.dropbox.com/s/qvthwy4a5aeo2yx/NodeRed%20Server%20IoTGateway_v2.0.1.exe?dl=0 and install it to the Gateway.

8. Download USB receiver driver from https://www.dropbox.com/s/6bguuh4nfynuekn/CDM21228_Setup.zip?dl=0 and install it to the Gateway.
9. Download EoLinkManager 1.0.2 from https://www.dropbox.com/s/2ggh18mijhj2fm8/EoLinkManagerSetup_1.0.2.exe?dl=0 and install it to the Gateway.

10. Open EoLinkManager.ini and set the configurations:
   > notepad C:\Program Files (x86)\Advantech\EoLinkManager\EoLinkManager.ini

   ------------------------------------------

   [Platform]
   InterfaceName=EoLinkReceiver
   ServerURL=127.0.0.1
   ModuleName=EoLinkManager
   SensorName=LightSensor
   SerialPort=COM3
   ServerPort=1883
   Interval=1
   #Interval: The time delay between data access round in second. 


   [Sensors]
   NumberOfSensors=2
   Sensor0=04016943
   Sensor1=0400E889
   ------------------------------------------


11. Reboot Gateway, the program APIGateway and EoLinkManager will auto startup, in case of these two programs are closed, you can restart them manually:

11.1. Run APIGateway manually:
    > cd C:\APIGateway
    > node app.js
   (Tips: You can also double click APIGateway icon on the Gateway's Desktop to run it)
11.2. Run EoLinkManager manually:
    > cd C:\Program Files (x86)\Advantech\EoLinkManager
    > EoLinkManager.exe 
   (Tips: You can also double click EoLinkManager icon on the Gateway's Desktop to run it)
   
12. Open https://portal-rmm.wise-paas.com/main/device and add your device.

13. Open https://dashboard-grafana-eiot.wise-paas.com to check Tower Light UI.