Showing posts with label contiki OS. Show all posts
Showing posts with label contiki OS. Show all posts

Monday, September 3, 2012

Installing Contiki 2.6 and Cooja Simulator in Ubuntu 12.04


Are you working with WSN or IoT? Probably you have heard about Contiki. Since a while I'm interested in using Contiki like operative system for a wireless sensor network. In this post I'm going to explain you how to install it in Ubuntu. Please read more about in the contiki page project http://www.contiki-os.org. In that page you can download "Instant Contiki", which is an virtual image disk where is ubuntu installed and all the contiki related things (cooja,contiki os, eclipse IDE for programming) configured, ready to use. But if you'd rather install it by your own, follow the next steps

1) Download contiki source from here.

2) Unzip the contiki-2.6.zip file

3) Try if Contiki works running an example from directory "examples". To compile the hello-world example,


cd contiki-2.6/examples/hello-world 
make TARGET=native
./hello-world.native

You should see the following output

Contiki 2.6 started
Rime started with address 2.1
MAC nullmac RDC nullrdc NETWORK Rime
Hello, world


After testing that hello world example you can clean the temporary files created during the compilation,

make clean


4) Procede installing java, because the cooja is a java based simulator,

sudo apt-get install openjdk-6-jdk

5) To compile cooja, install ant which is a compile tool,

sudo apt-get install ant


6) To compile and start cooja I gave the commands,cd tools/cooja

ant run

To remove all the temporary files created during the compilation, use ant clean 

7) If you're a begginer with Contiki OS I strongly recommend you to read the Getting started section step 3 for running Contiki on Cooja simulator.

Enjoy it!! :)