A little HowTo on running TinyOS applications in the Cooja emulation / simulation environment.

  1. Cooja is included in the Contiki CVS Git. Hence, make sure you have a recent cvs checkout git clone / checkout / branch /… of Contiki on your system. See http://www.sics.se/contiki/download.html for installation instructions.
    2011-03-27: update: contiki is now on Git.
  2. Compile your tinyos application with “make telosb”
  3. In your Contiki installation, go to tools/cooja/ and run “ant”. This requires you to have java and ant installed. After compilation it will greet you with an empty simulation environment.
    cooja1
  4. Hit File –> New Simulation to configure your simulation run.
    cooja2
  5. Press create and you will see your initial setup.
    cooja3
  6. Now it is time to add some sensor nodes. Hit mote types –> create mote type –> sky mote type and select the image (main.exe) of your tinyos application by hitting browse.
    cooja4
    cooja5
  7. Hit open and create and next specify the number of sensor nodes you need with that application image. You can add other application by repeating the steps 6 and 7. Hit create and add to make the sensor nodes appear.
    cooja6cooja7
  8. Play with select visualizer skins to customize the sensor visualizations. I prefer mote ids, leds, and radio traffic.
    cooja8
  9. Activate the radio logger (Plugins –> radio logger) and place all windows conveniently on the screen.
    cooja9
  10. Press start to see the action. Check the timeline to see packets sent and received and also the Leds. Check the loggers to see radio packets and serial communication.
    cooja10
  11. Cooja has many other features such as serial sockets, debugging, etc. I will leave it to you to explore them. Please keep in mind that some functionality in Cooja is specific for Contiki and will not work (or only partially) with TinyOS.
About these ads