IoTGateway/Net HAL Simulator

From ESS-WIKI
Revision as of 04:05, 22 February 2016 by Fred.chang (talk | contribs) (File structure and placement)
Jump to: navigation, search

Introduction

It is difficult to allocate abundant sensors to verify IoT system, so this simulator is used to generate many virtual configurable motes(be a mote manager) to detect unknown bugs between gateway and cloud. In some scenarios, we can use it to simulate a developing sensor and analyze the interaction between them to increase our system compatibility or speed up our development progress. We can also release the simulator to help our customer speedup the development.

File structure and placement

Each ini file in wsn directory is a unique senhub to descript internal sensor information, and the file @mote_list.ini is the prototype list of sensor information.

Mote simulator file struct and placement.png

Configure file

Sensor prototype list

This file is placed in execute path and its filename is a static name “@mote_list.ini”. Many kinds of sensors were defined in this file, and those would be used to match the one inside a virtual mote’s ini to get default values and fundamental parameters. The form is shown below.

Sensor_Type="Temperature"
Sensor_Default_Info="n:Temp, u:Cel"
Sensor_Default_Value="v:(##), min:0, max:100"
Sensor_Default_Trigger_Mode=”Edge”
  • The Sensor_Type indicates the kind of sensor.
  • The Sensor_Default_Info has two values, name(n) and unit(u).
  • The Sensor_Default_Value has three values, value(v), minimum(min) and maximum(max). The sign “(##)” means a programmable value which is generated by simulator, and it will be explained in chapter programmable value.
  • The Sensor_Default_Trigger_Mode has an alternative option, Edge or Level. Edge is reported by triggering, and Level is reported per second.

Interface description

This file is placed in a directory named by Communication_Type like “wsn” and filename is fixed to “@interface.ini”. The type of the interface on gateway was defined in it like Wifi, WSN, Zeebig, Bluetooth and so on. Those had some important values like mac or uuid. The form is shown below.

Communication_Type="WSN"

[Interface]
Interface_Number="2"

Interface_Name="WSN0"
Interface_Id="0001852CF4B7B0E8"
Interface_Health="90"

Interface_Name="WSN1"
Interface_Id="0001852CF4B7B0E7"
Interface_Health="0"
  • The Communication_Type indicates the type of interface like Wifi, BT, Zigbee and so on.
  • In the Interface block, it is used to define the number of interface first, and then define other parameter. Each interface has three parameters. The Interface_Name is the name of interface. The Interface_Id is the mac or the uuid of interface. The Interface_Health is the calculated result of health.

Virtual mote description

We can make many description files to simulate motes. Those files are placed in a directory named by Communication_Type like “wsn”, and all files in it will be recognized into the mote description. The mote description file can include many sensors. In other words, a mote means a sensor hub. The example is shown below.

[SensorHub]
Sensor_Product="WISE1020"
Sensor_Id="0001000EC6F0F832"
Sensor_Connect_To="0001000EC6F0F831"

[Sensor]
Sensor_Element_Size="2"

Sensor_Type="CO2"
Sensor_Info="n:Environment CO2"
Sensor_Value="v:25, min:0, max:50"
Sensor_Trigger_Mode=“Edge"

Sensor_Type="Temperature"
Sensor_Info="n:Room Temp"
Sensor_Value="min:0, max:100"
Sensor_Trigger_Mode=“Level@3"
  • Sensor_Product is a user-defined name.
  • Sensor_Id is mac or uuid.
  • Sensor_Connect_To is a list of mac connected to this mote.
  • Sensor_Element_Size indicates the number of sensor.
  • Sensor_Type、Sensor_Info、Sensor_Value are the same as Sensor support list. If the value is not defined in this scope, the default value in Sensor support list will be adopted.
  • Sensor_Trigger_Mode has two choices, Edge and Level. Edge is triggered if value is changed. Level is triggered per custom sec, but it is also triggered by that value is changed.

Programmable value

The sign (##) means it’s a programmable code, there are two methods which is shown below.

Random mode

If there are no other words in the center of the sign like (##), It is the random mode. The value will updated by random value per second.

Programmable mode

The syntax is “(#[second]@[value]- [second]@[value]-…and so on#)” like “(#3@5-7@13-9@1#)”. The meaning of “(#3@5-7@13-9@1#)” is shown below chart. The latest second word like 9+1=10 is the period of the code, and the value of the zero second point is the extension of the latest second.