Difference between revisions of "Collect View"

From Contiki
Jump to: navigation, search
Line 1: Line 1:
 +
[[Contiki_tutorials | Back to Contiki Tutorials]]
 +
 +
__TOC__
 +
 
== Introduction ==
 
== Introduction ==
  
Contiki's Collect View App allows a user to see the sensor data from a Sky Mote. This tutorial will give you step-by-step instructions on how to run Collect View using two Sky Motes.  
+
This exercise is to familiarize the user with the collect view app provided in the Contiki OS source code. It basically involves a sink mote and one or more than one source motes. The source motes send their sensor, network, power and node properties to the sink. A java app presents all this compiled data in a graphical manner.
  
 
== You Will Learn ==
 
== You Will Learn ==
  
* How to program motes within Collect View
+
* How to upload an introductory code for UDP source and sink.
* The GUI of Collect View
+
* How to program nodes and collect data through the collect-view GUI.
 +
* Things to see on the collect-view GUI.
  
== Tutorial ==
+
== Relevant Directories ==
 +
 
 +
* /contiki/examples/collect/ - This has the shell code for collect view and the various targets.
 +
* /contiki/examples/ipv6/rpl-collect/ - This has the codes which are to be uploaded to the source and sink motes for UDP communication.
 +
* /contiki/tools/collect-view/ - This contains the java file for the collect view GUI.
 +
* /contiki/apps/collect-view/ - This contains the codes corresponding to the targets mentioned in the examples folder.
 +
 
 +
== Connect the Tmote Sky ==
 +
 
 +
Before continuing with the tutorial, plug 2 Tmote Sky into the computer's USB port, one for the source and the other for the sink.
 +
 
 +
In order to transfer the ownership of the contiki directories use the following command.
 +
 
 +
<code><nowiki> sudo chown :user /dev/ttyUSB0 </nowiki></code>
 +
 
 +
<code><nowiki> sudo chown :user /dev/ttyUSB1 </nowiki></code>
 +
 
 +
== Using the Source Code ==
  
 
=== Step 1 ===
 
=== Step 1 ===
  
Plug two Sky Motes into two USB ports on your computer: ttyUSB0 and ttyUSB1. Within Contiki, you will need to gain administrative access into these motes before you can run Collect View. Type the following code into terminal.  
+
Go to /examples/ipv6/rpl-collect/ directory.
  
sudo chown :user /dev/ttyUSB0
+
=== Step 2 ===
sudo chown :user /dev/ttyUSB1
+
  
Note: This step must be repeated twice for each USB port
+
Now we need to program one mote as the sink and the other as source. We will use a predefined target called z1 to upload the code in the motes.
 +
 
 +
For sink:
 +
 
 +
<code><nowiki> make TARGET=z1 MOTES=/dev/ttyUSB0 udp-sink.upload </nowiki></code>
 +
 
 +
For source:
 +
 
 +
<code><nowiki> make TARGET=z1 MOTES=/dev/ttyUSB1 udp-sender.upload </nowiki></code>
 +
 
 +
=== Step 3 ===
 +
 
 +
Now we would like to see the transfer and depiction of data on the collect-view GUI. For that to happen, go to /tools/collect-view directory and run "ant" to build the collect viewer.
 +
 
 +
<code><nowiki> ant run </nowiki></code>
 +
 
 +
'''Note''' - In order to edit GUI java files go to the /src directory.
 +
 
 +
=== Step 4 ===
 +
 
 +
To view the data collected at the sink, go to the generated /tools/collect-view/dist and run -
 +
 
 +
<code><nowiki> java -jar collect-view-jar /dev/ttyUSB0 </nowiki></code>
 +
 
 +
=== Step 5 ===
 +
 
 +
In the collect window from the Tools menu, select "Run Init script" and in the "Node Control" tab and click on "Start Collect." This will enable the communication between the source and the sender and you will be able to see the received statistics in a graphical manner.
 +
 
 +
== Using the GUI ==
 +
 
 +
=== Step 1 ===
 +
 
 +
Once the motes are connected to the USB ports, go to /tools/collect-view directory and run "ant" to build the collect viewer.
 +
 
 +
<code><nowiki> ant run </nowiki></code>
  
 
=== Step 2 ===
 
=== Step 2 ===
  
Navigate to the Collect View directory (cd contiki/tools/collect-view/) and build the collect viewer with the following command:  
+
Press the "Program Nodes..." button as seen on the GUI.
 +
 
 +
=== Step 3 ===
 +
 
 +
Disconnect all except one node from the USB ports. Press the "Connect to serial" button. The disconnected motes should be connected to independent power sources.
 +
 
 +
=== Step 3 ===
 +
 
 +
Now in order to collect various statistics, press "Send Collect" button.
 +
 
 +
=== Step 4 ===
 +
 
 +
Set the various "Collect Settings" based on how frequently the data is to be collected and then press "Send command to nodes" button.
 +
 
 +
=== Step 5 ===
 +
 
 +
Now go through the other tabs on the GUI to study and analyze the statistics plotted.
 +
 
 +
== Things to See on the GUI ==
 +
 
 +
=== Topological graphs ===
 +
 
 +
* Sensor Map
 +
* Network Graph
 +
 
 +
=== Sensor Related Plots ===
 +
 
 +
These are subject to the availability of a particular type of sensor on the motes.
 +
 
 +
* Temperature Sensor - Average Temperatue and Temperature.
 +
* Humidity Sensor - Relative Humidity.
 +
* Battery Sensor - Battery Indicator and Battery Voltage.
 +
* Light Sensor - Light 1 and Light 2.
 +
 
 +
=== Network Metrics Related Plots ===
 +
 
 +
* Neighbours
 +
* Beacon Interval
 +
* Network Hops
 +
** Over Time
 +
** Per Node
 +
* Router Metric (Over Time)
 +
** Instantaneous
 +
** Average
 +
* ETX (Over Time)
 +
* Next Hop (Over Time)
 +
* Latency
 +
* Lost Packets (Over Time)
 +
* Received Packets
 +
** Over Time
 +
** Per Node
 +
** Every 5 min
 +
 
 +
=== Power Related Plots ===
 +
 
 +
* Average Power
 +
* Instantaneous Power
 +
* Power History
 +
* Radio Duty Cycle
 +
 
 +
=== Other Tabs ===
 +
 
 +
* Node Info - This gives a summary of all the nodes and their statistics.
 +
* Serial Console - The user can interact directly with the mote, sending commands to read and transmit data.
 +
 
 +
 
 +
'''Primary contributors:''' Bhavna, Deepanker, Nikhil, Rahul
 +
 
 +
[[Contiki_tutorials | Back to Contiki Tutorials]]
 +
 
  
run ant
+
Edited by: Deepanker

Revision as of 18:25, 21 February 2014

Back to Contiki Tutorials

Introduction

This exercise is to familiarize the user with the collect view app provided in the Contiki OS source code. It basically involves a sink mote and one or more than one source motes. The source motes send their sensor, network, power and node properties to the sink. A java app presents all this compiled data in a graphical manner.

You Will Learn

  • How to upload an introductory code for UDP source and sink.
  • How to program nodes and collect data through the collect-view GUI.
  • Things to see on the collect-view GUI.

Relevant Directories

  • /contiki/examples/collect/ - This has the shell code for collect view and the various targets.
  • /contiki/examples/ipv6/rpl-collect/ - This has the codes which are to be uploaded to the source and sink motes for UDP communication.
  • /contiki/tools/collect-view/ - This contains the java file for the collect view GUI.
  • /contiki/apps/collect-view/ - This contains the codes corresponding to the targets mentioned in the examples folder.

Connect the Tmote Sky

Before continuing with the tutorial, plug 2 Tmote Sky into the computer's USB port, one for the source and the other for the sink.

In order to transfer the ownership of the contiki directories use the following command.

sudo chown :user /dev/ttyUSB0

sudo chown :user /dev/ttyUSB1

Using the Source Code

Step 1

Go to /examples/ipv6/rpl-collect/ directory.

Step 2

Now we need to program one mote as the sink and the other as source. We will use a predefined target called z1 to upload the code in the motes.

For sink:

make TARGET=z1 MOTES=/dev/ttyUSB0 udp-sink.upload

For source:

make TARGET=z1 MOTES=/dev/ttyUSB1 udp-sender.upload

Step 3

Now we would like to see the transfer and depiction of data on the collect-view GUI. For that to happen, go to /tools/collect-view directory and run "ant" to build the collect viewer.

ant run

Note - In order to edit GUI java files go to the /src directory.

Step 4

To view the data collected at the sink, go to the generated /tools/collect-view/dist and run -

java -jar collect-view-jar /dev/ttyUSB0

Step 5

In the collect window from the Tools menu, select "Run Init script" and in the "Node Control" tab and click on "Start Collect." This will enable the communication between the source and the sender and you will be able to see the received statistics in a graphical manner.

Using the GUI

Step 1

Once the motes are connected to the USB ports, go to /tools/collect-view directory and run "ant" to build the collect viewer.

ant run

Step 2

Press the "Program Nodes..." button as seen on the GUI.

Step 3

Disconnect all except one node from the USB ports. Press the "Connect to serial" button. The disconnected motes should be connected to independent power sources.

Step 3

Now in order to collect various statistics, press "Send Collect" button.

Step 4

Set the various "Collect Settings" based on how frequently the data is to be collected and then press "Send command to nodes" button.

Step 5

Now go through the other tabs on the GUI to study and analyze the statistics plotted.

Things to See on the GUI

Topological graphs

  • Sensor Map
  • Network Graph

Sensor Related Plots

These are subject to the availability of a particular type of sensor on the motes.

  • Temperature Sensor - Average Temperatue and Temperature.
  • Humidity Sensor - Relative Humidity.
  • Battery Sensor - Battery Indicator and Battery Voltage.
  • Light Sensor - Light 1 and Light 2.

Network Metrics Related Plots

  • Neighbours
  • Beacon Interval
  • Network Hops
    • Over Time
    • Per Node
  • Router Metric (Over Time)
    • Instantaneous
    • Average
  • ETX (Over Time)
  • Next Hop (Over Time)
  • Latency
  • Lost Packets (Over Time)
  • Received Packets
    • Over Time
    • Per Node
    • Every 5 min

Power Related Plots

  • Average Power
  • Instantaneous Power
  • Power History
  • Radio Duty Cycle

Other Tabs

  • Node Info - This gives a summary of all the nodes and their statistics.
  • Serial Console - The user can interact directly with the mote, sending commands to read and transmit data.


Primary contributors: Bhavna, Deepanker, Nikhil, Rahul

Back to Contiki Tutorials


Edited by: Deepanker