Wednesday 5 November 2014

Contki and Cooja Installation in Ubuntu


        Contki is a Wireless Sensor Device  OS  is  to build  small  nodes  in Wireless Sensor Network. It is  very easy to port on any embedded resource constrained devices. If you are  working on Internet of Things  like application , this OS  is very  much  suitable  for build a Sensor node  application  on it.How  to  install contki OS  and its simulator  in Ubuntu Machine to  develop  Sensor Application  is  given below. ?.. try  it..

1.Install  the  following  packages  through  the apt  command

  sudo apt-get install build-essential binutils-msp430 gcc-msp430  msp430-libc binutils-avr gcc-avr gdb-avr avr-libc  avrdude openjdk-7-jdk openjdk-7-jre ant libncurses5-dev  doxygen git 
 
2.Clone  the development  packages  of  the contiki.
 
        git clone git://github.com/contiki-os/contiki.git contiki
 
3.Got  to  contiki directory  and  run make  command  and  run output  file. 
cd contiki-2.6/examples/hello-world 
make TARGET=native
./hello-world.native
4. How  to run contiki OS on micaz  mote.? Usually  micaz  mote  with  Tiny OS, but here  we  can possible to  port  the  contiki  OS  in  micaz  mote.

 make TARGET=micaz savetarget
 make hello-world.upload
 make TARGET=micaz hello-world.upload PORT=/dev/ttyUSB0


4.Running Network  Simulator  Cooja.

     Start  Cooja  ,  Its  a network simulator  for  testing  the  sensor network and  its  running  parameter.  Its  very  suitable  for build a  small  sensor  network  simulator.

cd   contki/toola/cooja
ant  run

 If  you  got  any error  while  run  the  ant  command  juts  update  the  git  clone by using  the  following   command.

git submodule update --init

5.Cooja  Network  Simulator  Window  Appears.
Cooja Open  Window
Create a Simulation
New  Simulation Window
Choose  Mote
Select  a  mote  from the  list
Compile  the  mote
Select  the  no  of motes one

One  mote  is  added  to  window
Again  Select 20  node on elliptical  topology
20  nodes are  added  to window
Start the simulation
Show its  range  and  connection  paradigm
Simulation Pattern





Simulation of  mote  ant  random    with  100  motes
Cooja Wireless  Sensor  network simulator help  to  know the sensor  motes  operator  and  its Radio  channel  allocation  and  power trace.  But  it  have  some  limitation while  implementing  large  no  of  sensor  network.

26 comments:

  1. Hi! thank you for this effort.
    Here I have a problem, as I am a beginner with Linux. when I clone the development packages of the contiki, I get this error:

    fatal: unable to access 'https://': Failed to connect to proxy.server.com port 8080: Connection refused

    what shall I do? please help me!

    ReplyDelete
    Replies
    1. If you cant use the git... just go to the contiky website and download the contiki package......

      Delete
  2. Check if you've got git http.proxy or https.proxy configuration set, and unset both. See pull command error : Failed connect to github.com:8080

    ReplyDelete
    Replies
    1. the problem now is: when I do " make hello-world.upload" I get this error : " make: *** [obj_micaz/watchdog.o] Error 1" .
      Can you help me please ?

      Delete
    2. hey friend...Some of the programs were showing this error due to some library issues while compiling...don't worry try an another program..If that program also showing the same error .. let me know......

      Delete
    3. thank you! I've tried another program without error.

      Delete
    4. Hi People,

      I just wanted to know if Cooja supports Thread stack ?

      Delete
  3. Bonjour,
    Je veux faire une simulation d'un réseau de capteurs sans fil avec le simulateur Cooja sous le système Contiki. Je doit implimenter le protocol AODV sous cooja.
    Le problème c'est que je ne parvient pas à le faire à cause de ma faible connaissance de ce simulateur et que c'est la première fois que je l'utilise.
    S'il vous plaît, il-y-t-il quelqu'un qui peut m'expliquer comment faire??
    merciiiiiiiiiii d'avance

    ReplyDelete
  4. Bonjour, mon ami,
    Je mentionne déjà comment installer contiki sur la machine linux et comment le faire fonctionner . Il était une procédure simple . Si vous êtes déjà installé et que vous exécutez sur votre machine et causer aucun problème dans la mise en œuvre du protocole de routage AODV dans cooja ... ? Je pense que vous ne devez pas vous inquiéter à ce sujet .. déjà la mise en œuvre est là dans cooja . vous pouvez télécharger le programme et l'exécuter .. Encore une fois , encore que vous êtes face à un problème dans implemenation de AODV dans cooja .. s'il vous plaît libres de demander à ce sujet ......

    Je vous remercie beaucoup d'avoir posé cette Q ?

    ReplyDelete
  5. Hi
    I downloaded contiki-IDs-attacks from GitHub
    when I want to open it through cooja simulator, I get compilation error: cannot run program "make" (in directory/../../../rpl-collect)
    could you please help me hot to solve it
    thanks

    ReplyDelete
    Replies
    1. Thanks for asking.... can you please tell me the procedures were using in this problem..?

      Delete
  6. thanks for replaying

    I downloaded the program from https://github.com/ecksun/Contiki-IDS/tree/attacks, after that extract it in contiki folder
    my contiki 3.0 is installed through VMware Workstation 12 Player
    I run it
    then open a terminal and write
    cd contiki/tools/cooja
    ant run
    then the cooja simulator is opened
    after that file>open simulation>browse
    contiki->contiki-IDs-attacks->examples->ipv6->rpl-collect->attack_clone.csc
    after processing it gives Mote type creation error:Mote type creation failed: compilation error: cannot run program "make" (in directory "/home/user/contiki/contiki-IDs-attacks/examples/ipv6/rpl-collect"): error=2. No such file or directory....

    I don't know there is another procedure to do before run the program

    thanks

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. i have problem with ant run
      Buildfile: /home/ayoub/Bureau/contiki-2.7/tools/cooja/build.xml

      init:

      compile:

      BUILD FAILED
      /home/ayoub/Bureau/contiki-2.7/tools/cooja/build.xml:74: Unable to find a javac compiler;
      com.sun.tools.javac.Main is not on the classpath.
      Perhaps JAVA_HOME does not point to the JDK.
      It is currently set to "/usr/lib/jvm/java-6-openjdk-amd64/jre"

      Total time: 0 seconds
      please help me ...

      Delete
  7. I am getting this in last few lines and COOJA IS NOT LOADING.

    run:
    [java] Error: Could not find or load main class org.contikios.cooja.Cooja
    [java] Java Result: 1

    BUILD SUCCESSFUL
    Total time: 6 seconds

    ReplyDelete
  8. Usually this problems comes when you are not properly configure the environment (Java Class) PATH in Cooja , This can be rectify by verify all the environment path used in Cooja ... Or use Instant Contiki... In Instant Contiki it will works perfectly.... Thank you... Come again if you couldn't solve the issue...

    ReplyDelete
  9. j'ai des problèmes de l’installation des paquets de simulateur CONTIKI

    ReplyDelete
  10. abd@abd-HP-ProBook-4540s:~$ sudo apt-get install gcc-MSP430
    Lecture des listes de paquets... Fait
    Construction de l'arbre des dépendances
    Lecture des informations d'état... Fait
    E: Impossible de trouver le paquet gcc-MSP430

    ReplyDelete
  11. E: Impossible de trouver le paquet binutils-MSP430
    E: Impossible de trouver le paquet gcc-MSP430
    E: Impossible de trouver le paquet binutils-avr-gcc
    E: Impossible de trouver le paquet avr
    E: Le paquet « openjdk-7-jdk » n'a pas de version susceptible d'être installée
    E: Le paquet « openjdk-7-jre » n'a pas de version susceptible d'être installée

    ReplyDelete
  12. comment faire pour désinstaller contiki 2.6 et installer contiki 2.7 sous la meme unbuntu (mon version de ubuntu 15.04 ) a ce que je peux ?? svp aide moi??

    ReplyDelete
  13. can u tell me how can i reinstall cooja simulator in ubuntu 16.04 ,becoz while i m executing rpl protocol it showing some error.

    ReplyDelete
  14. hi,
    i'm working on ubuntu 18.04 , when i try to install cooja , i have some problems
    i need help please

    ReplyDelete
  15. Bonjour je suis étudiante en école d'ingénieur et j'effectue un stage de 2 mois dans le monde de la recherche.

    Mon objectif est de développé le protocole de routage RPL sur les MicaZ mais pour le moment je n'y arrive pas. Est-il possible de trouver un programme de routage fonctionnant sur les MicaZ.
    S'il vous plait.

    Merci pour vos réponse je suis bloquée dans mon stage et j'aimerai beaucoup avancer.

    Hello I am a student in engineering school and I do a 2 months internship in the world of research.

    My goal is to develop the RPL routing protocol on MicaZ but for the moment I can't do it. Is it possible to find a routing program running on MicaZ.
    Please.

    Thank you for your answer I am stuck in my internship and I would like to advance a lot.

    ReplyDelete
  16. hi.. i am a student and have an error "Could not find the MSPSim build file. Did you run "git submodule update --init"? while giving command "sudo ant run"
    What is the solution?

    ReplyDelete
  17. hi..i am a beginner in contiki. i ran a hello-world program in cooja using the default mac protocol..can i change the existing mac protocol with another one..??if so, how do i do that..if anybody knows please help..??

    ReplyDelete