Step by step guide to installing Cooja simulator
Cooja is a java-based wireless sensor network simulator distributed with Contiki.
It allows the simulation of different levels from physical to application layer, and also allows the emulation of the hardware of a set of sensor nodes and this is why it is widely used in field of IOT.
This is a step-by-step guide to install Cooja in your linux system.
Step 1. Install Java
Cooja works well only with
Java 8 as Java has removed
javax.xml.bind module from its higher version jdks. Install it in your linux system using command :
sudo apt-get update
sudo apt-get install openjdk-8-jdk
Set environment variables for java and point them to location where java is installed. Example :
Check whether Java installation and environment variable setting is successful :
Step 2. Setup Cooja
FYI 1. Make sure git is installed in your system.
/home/weasel/Installed/is my base directory for software installation.
- Clone ContikiOS from github into any directory (contiki in my case) using command :
git clone git://github.com/contiki-os/contiki.git contiki
- If you directly run Cooja without downloading submodule code, you will run into an error as MSPSim simulator code is not downloaded at this point (you can verify this by going inside folder
/contiki/tools/mspsim/). Error that you will get :
- To download this dependency code, get into desired cooja folder :
contiki/tools/coojaand download submodule code for MSPSim using command :
git submodule update — init
- At this point you are all set up to get started.
Step 3. Run Cooja
contiki/tools/coojadirectory, run command
This marks end of the installation guide for Cooja. Now you are ready to start with your Hello World!!! program.
To connect with me on Linkedin click here.