Simple Contiki Data Collection on the Tmote Sky

From ContikiWiki

Jump to: navigation, search

This tutorial shows how to collect sensor data using Contiki's built-in data collection algorithm. The Contiki data collection is as simple as it gets if you simply want to collect data without having to do any programming or worry about networking.

This tutorial shows how to run CollectView under Instant Contiki, but CollectView runs under native Windows and Linux too. Download it and try it out!

Contents

[edit] Run Contiki on the Tmote Sky

If you have a few Tmote Skys around, you can quickly use Contiki to collect sensor data from them via the Contiki CollectView program.

[edit] Start the CollectView program

In Instant Contiki, click on the Terminal icon. In the terminal window, enter the command

cd Desktop/contiki-collect-sky-2.5.rc1/

Collect-sky-1.png

In this directory, run the command

java -jar collect-demo.jar

Collect-sky-2.png

This opens the CollectView application. If there are no Tmote Sky motes connected to the PC, a dialog will be displayed. Close this with its OK button.

Collect-sky-3.png

[edit] Upload Contiki to the Tmote Sky motes

Our first step is to upload Contiki onto your Tmote Skys. The CollectView program can upload Contiki in parallel to all motes connected to the PC.

Plug in your Tmote Sky motes into the USB ports of your PC. A USB hub can be used to increase the number of available USB ports.

Next, we need to hook the motes into Instant Contiki. We do this in the VMware Virtual Machine menu:

Collect-sky-4.png

Connect all motes to Instant Contiki.

Now we use CollectView to upload Contiki to all connected motes. Click the "Program Nodes..." button:

Collect-sky-5.png

You will now be asked whether you want to program the nodes. Obviously you do, so click the Yes button:

Collect-sky-6.png

The uploading progress is shown in the window that opens.

Collect-sky-7.png

Click the Close button when programming has finished.

Collect-sky-8.png

If you need to program more motes, repeat the process. When all motes have been programmed, remove all motes except one.

[edit] Start the data collection network

After having programmed all the nodes, we will now connect to the nodes via the serial connection (via the node which is still plugged into your computer). After that we will instruct the network what exactly we want it to do and watch Contiki's magic unfold.


So lets get started. At first, click the Connect to serial button. This will connect your PC to the node and allow you to give commands to the node as well as receive status updates from the node itself. The "Connect" button will change to a "Disconnect" button once successfully connected.

Collect-sky-9.png

Once we have connected to the node, we can click on the "Start collect" button. This will instruct the nodes to form a data collection network, with the mote connected to the USB port as the sink.

Collect-sky-11.png

Click the "Send command to nodes" button. This sends a command to the nodes in the network that will cause them to periodically send sensor data to the sink. This data will be picked up by the CollectView program and displayed.

Collect-sky-12.png

[edit] View the collected data

Your network should now be forming a data collection tree and data should start arriving at the sink. We will now guide you through the information that is being collected, which is nicely displayed in some of the tabs.

After a minute or so, a number of node IDs should have showed up in the leftmost column. These are the nodes that have reported data to the sink, with time all the nodes should be displayed if the radio interference isn't too outrageous (WiFi sometimes overpowers these poor little nodes).

Collect-sky-13.png

Click on the "Network Graph" tab. This shows the structure of the collection network. The nodes are moving around, so it is a good idea to fix the position of the sink node. The sink node cna be identified by looking to what node the arrows are pointing. Right click on the node and select the "Fixed node position" menu item to fix its position. To make it easier to right click on the node, it might be a good idea to uncheck the "Update layout" menu item first, as this will stop the movement of the nodes.

Collect-sky-14.png

The "Node info" tab shows a table with information for each node. Here you can see how many packages have been received, how many hops nodes are away amongst other data.

Collect-sky-18.png

The "Sensors" tab shows the sensor data from the network.

Collect-sky-15.png

The "Power" tab shows the power consumption of the motes.

Collect-sky-16.png

The "Network" tab shows the status of the network.

Collect-sky-17.png

[edit] Summary

Congratulations, if everything went according to plan you will have programmed and deployed your first Contiki network and collected loads of information without even having to start programming. With other systems, this could take many hours to set up. We hope you enjoyed the ride and may have realized how easy Contiki can make life for you. Go and collect wireless data, or have a look at how you can program and adjust the nodes themselves in one of the other tutorials.

Personal tools