30 | | This is the structure of the content of the EMR software package: |
31 | | * Node \\ Contains the functionalities of the nodes in the network |
32 | | * EMRAPPc.nc\\ Contains |
33 | | * EMRCHC.nc\\ Contains |
34 | | * EMRClusteringC.nc\\ Contains |
35 | | * EMRInitC.nc\\ Contains |
36 | | * EMRLib.nc\\ Contains |
37 | | * EMRMemberC.nc\\Contains |
38 | | * EMRRouting.nc\\ Contains |
39 | | * interface\\ Contains |
| 30 | There are two type of nodes in the network, the normal sensor nodes and the sink, where data packets from the normal nodes are periodically collected by the sink after some basic processing at the CH, e.g. data aggregation. This is the structure of the content of the EMR software package: |
| 31 | * Node \\ |
| 32 | * EMRAPPc.nc\\ Contains the configuration files and includes wiring between interfaces |
| 33 | * EMRCHC.nc\\ Contains all relevant actions and behavior of the ClusterHead (CH), e.g. collecting the informaiton of the member nodes, receiving the data packets from the member nodes, and forwarding the summary packet of the cluster towards the sink |
| 34 | * EMRClusteringC.nc\\ Contains the procedure about how the clusters are formed |
| 35 | * EMRInitC.nc\\ Contains all initializations of each round across the network operation, and how to process the received message |
| 36 | * EMRLib.nc\\ Contains general functionalities that could be used by other modules, e.g. the energy consumption model |
| 37 | * EMRMemberC.nc\\Contains all recelvant actions and behavior of the member nodes, e.g. to determine which CH it belongs to, and to send data to the CH |
| 38 | * EMRRouting.nc\\ Contains the process about how to determine the routing towards the sink in multi-hop scenario |
| 39 | * Interface\\ Contains the defination of all involved interfaces |
| 40 | * include\\ Contains all header files |
| 51 | |
| 52 | * First of all, install * [http://docs.tinyos.net/index.php/Getting_started TinyOS-2.x] |
| 53 | |
| 54 | * Then copy the {{{build}}} folder and the {{{Makefile}}} into a new folder under the tinyOS directory for normal node |
| 55 | |
| 56 | {{{ |
| 57 | /opt/tinyOS2.x/emr/node/ |
| 58 | |
| 59 | }}} |
| 60 | |
| 61 | * Thirdly, copy the source code into a new folder for sink node |
| 62 | |
| 63 | {{{ |
| 64 | e.g. /opt/tinyOS2.x/emr/sink/ |
| 65 | |
| 66 | }}} |
| 67 | |
| 68 | |
| 69 | * Now, you can load the binary code into normal nodes by |
| 70 | |
| 71 | {{{ |
| 72 | # make telosb reinstall.<node ID> bsl,/dev/ttyUSB* |
| 73 | |
| 74 | }}} |
| 75 | |
| 76 | * And then compile and load the binary code into sink nodes by |
| 77 | |
| 78 | {{{ |
| 79 | # make telosb install.100 bsl,/dev/ttyUSB* |
| 80 | }}} |
| 81 | |
| 82 | |
| 85 | |
| 86 | The following describes about how to run EMR step by step. |
| 87 | |
| 88 | *Operation |
| 89 | |
| 90 | * First, turn on all normal nodes. the nodes should have the red led on and wait for clustering indication from the sink node. |
| 91 | |
| 92 | * Then, turn on the Sink node. |
| 93 | |
| 94 | * When the sink node is on, the network starts operation, e.g. to cluster the nodes and to collect the data from the member ndoes by the CHs. |
| 95 | |
| 96 | * You could see that the different leds are on on the nodes, where bue led means a CH and green led means a member node. |
| 97 | |
| 98 | * The status of the nodes are changing from time to time, e.g. a node may change its led colour meaning its role in the new round. |
| 99 | |
| 100 | |
| 101 | *Monitor the debug messages |
| 102 | |
| 103 | Use the serial output to watch the debug messages: |
| 104 | |
| 105 | {{{ |
| 106 | # java net.tinyos.tools.PrintfClient -comm serial@/dev/ttyUSB*:telosb |
| 107 | }}} |
| 108 | |
| 109 | |
| 110 | * Change parameters |
| 111 | You could change the parameters, e.g. {{{control_packet_size}}}, {{{data_packet_size}}} freely in the funciton {{{send_parameter()}}} in the file {{{EMRSinkC.nc}}} |