• No results found

5. Wireless Sensor Networks Data Collection and Management System

5.3 Centralized network control and management

5.3.7 Network control panel

With the previous discussion, the Network Control panel is designed as shown in Figure 5.9. It has two parts: the Status panel displays the node configuration and status, and the Command panel is used for control or management.

The Status panel connects to the node database to retrieve the related information for display. The content includes the configuration and status from PHY layer to Application layer. Whenever the node database is updated by any parameters, the content of this panel is also updated correspondingly.

The Command panel contains a set of commands which can be chosen to control the network. The selection of node(s) can be carried out in the Topology panel. Table 5.1 shows commands which are supported by WiSeCoMaSys.

Figure 5.9: Network Control.

Table 5.1: Commands are supported in WiSeCoMaSys.

Layer Command Reply

APP

SET_SENSOR_AVAILABLE_REQ no

SET_MODE_AUTO_REQ no

SET_MODE_QUERY_REQ no

SET_MODE_CONTEXT_AWARE_REQ no

SET_DATA_PERIOD_REQ no

SET_SLEEP_REQ no

SET_WAKEUP_REQ no

SET_CONTEXT_AWARE_RULE_REQ

LOAD_CONTEXT_RULE_FILE_REQ no

5.3 Centralized network control and management 83

PHY SET_DATA_POWER_REQ no

SET_BEACON_POWER_REQ no

SET_RADIO_CHANNEL_REQ no

GET_DATA_POWER_REQ yes

GET_BEACON_POWER_REQ yes

GET_RADIO_CHANNEL_REQ yes

In addition, some commands such as power control, sampling rate, which are used more frequently, are designed in a Request panel (shown in the left of Figure 5.9) for convenient use.

5.3.7.1 Command dissemination

Reconfiguration of the network requires sending information from the gateway to nodes inside the sensor network. The configuration is put in a specific command for dissemination. In order to send a command from WiSeCoMaSys to the network, the request packet class is used to carry a command from the operator’s side to a specific node using this dissemination protocol [LT10] [LL08]. This class is generated from the format of request packet mentioned in Chapter 4 by MIG.

The dissemination protocol which can interact with WiSeCoMaSys uses the Trickle algorithm [LPC+04] to establish eventual consistency across the entire network on shared variables and applications are notified when these variables change. Using this protocol, WiSeCoMaSys shares a Request ID in request packets to communicate with sensor nodes. Hence, nodes in the network are able to receive commands from WiSeCoMaSys for its configuration or operation. Then in each node, the command is recognized by the field Request ID in the request packet header and processed accordingly.

5.3.7.2 Localization setting

For the localization, WiSeCoMaSys supports the LWCL mentioned in Chapter 4 in two environments: free-space and log-distance. Besides, the basic CL algorithm is also supported by WiSeCoMaSys.

In order to run the localization in nodes properly, users have to configure the type of node for each sensor node. A node can be a beacon node, anchor node or localized node. Then, for the beacon node and anchor node, their positions have to be provided.

Finally, the localization algorithm is selected so that nodes can start the position estimation process. All of the settings above are carried out by commands in WiSeCoMaSys.

There are two ways of setting the node type and positions of anchor nodes:

Sending commands to specific node(s) using the GUI (Graphic User Interface).

Using the location script file.

The location script file is supported to reduce the manual settings by commands, especially in experiments with the same settings. The location file includes many lines.

Each line describes the node type and the location of a specific node. The format of a line is as following:

Node_Id, Node_Type, X_Coordinate, Y_Coordinate, Z_Coordinate in which:

Node_Id is the address of the node to which the setting is applied .

5.3 Centralized network control and management 85

Node_Type can have one of three values: BEACON, ANCHOR, and LOCALIZED.

With the LOCALIZED value, the coordinates will not be taken into account. This is used in case users want to change a node from an anchor or beacon node to a localized node.

X_Coordinate, Y_Coordinate, Z_Coordinate are the coordinates of the node Figure 5.10 shows an example of the location script file.

0, BEACON, 0, 0, 0 1, ANCHOR, 200, 0, 0 2, ANCHOR, 0, 200, 0 3, ANCHOR, 200, 200, 0 4, LOCALIZED, 0, 0, 0

Figure 5.10: Location script file.

5.3.7.3 Context-aware rule setting

By default, the sensor nodes are in the operation mode of automatic data report. If they are required to run in context-aware mode, users have to configure the context-aware parameters.

With the manual command setting shown in Figure 5.11, users can create rules describing the context by using WiSeCoMaSys.

Figure 5.11: Context-aware rule setting.

However, when there are many contexts with many rules, the setting method above takes a lot of time. Therefore, for convenience, WiSeCoMaSys also supports context description file with the following format of each line:

Node_Id, Rule_Id, Rule description

In which, the Node_Id is the address of a specific node or broadcast address (0xFFFF) if this rule is sent to all nodes in the network. In Figure 5.12, the context description file is shown as an example.

0, 0, IF TEMPERATURE GREATER 45 THEN SEND 1 1, 1, IF LIGHT BETWEEN 10 100 THEN SEND 2 1, 2, IF GW_DISCONNECTED THEN STORE 3

4, 3, IF HUMIDITY LESS 20 THEN TRIGGER_ALARM 4

65535, 4, IF TEMPERATURE OUT_OF 0 4 THEN ACTIVATE_HVAC 5 Figure 5.12: Context description file.

The context interpreter integrated in WiSeCoMaSys translates each line in the context file to an appropriate rule and sends this rule to the network. For example, the first line in Figure 5.12 means that rule 0 of node 0 is configured by the rule If temperature is greater than 45 C then send the packet, and then jump to the rule 1.