A little HowTo on running TinyOS applications in the Cooja emulation / simulation environment.
- Cooja is included in the Contiki
CVSGit. Hence, make sure you have a recent cvs checkoutgit 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.
- Compile your tinyos application with “make telosb”
- 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.
- Hit File –> New Simulation to configure your simulation run.
- Press create and you will see your initial setup.
- 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.
- 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.
- Play with select visualizer skins to customize the sensor visualizations. I prefer mote ids, leds, and radio traffic.
- Activate the radio logger (Plugins –> radio logger) and place all windows conveniently on the screen.
- 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.
- 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.