Mobility in Cooja-2.7 Simulator

 Mobility in Contiki-2.7 Cooja Simulator


This blog has set of steps needed for incorporating the mobility plugin and use it in the scenarios for IOT and WSN in Cooja Simulator.

Step 1: Download Plugin
The mobility plugin for Cooja is available on the URL below

Create a new directory at

cd contiki/tools/cooja/apps

Name it mobility
Download the files for the URL and dump it in the “mobility” folder and make sure that you make the folder structure, as it is given in the URL. 


Step 2 : Building the plugin
Navigate to the mobility folder with

cd contiki/tools/cooja/apps/mobility

from terminal and run the command

sudo ant jar

This will build the plugin

There might be an issue in a file call “build.xml” at the path 

/home/user/contiki/tools/cooja/apps/mobility” at line 7 

saying that the build cannot  find/build the cooja.jar file and so one will have to change the path from the relative to the absolute path. Putting it as so

<property name="cooja_jar" value="/home/user/contiki/tools/cooja/dist/cooja.jar"/>  


Step 3 : Enabling the Mobility Plugin in Cooja
Start Cooja Simulator

cd contiki/tools/cooja
sudo ant run
In Cooja,
Settings > External Tools Path…
 

                Scroll down to DEFAULT_PROJECTDIRS
It is necessary to add the paths of all the plugins in Cooja Simulator, We do this for linking the plugin with Cooja Simulator. To do so append the plugin’s path to the existing plugin paths by Inserting ‘ ; ‘ symbol.
Add the plugin’s path

[CONTIKI_DIR]/tools/cooja/apps/mobility
Save the changes
Restart the simulator again
Now go to
Settings>Cooja Extensions

Cooja Extensions Window will pop-up.

Scroll down to mobility select it and click on “Apply for the session”


This will show you the mobility plugin in the tools menu.

Comments

  1. it is nice and works properly.

    ReplyDelete
  2. Hi

    I am going to run some .csc files in the Contiki. It simulates an investigation of different attacks which are available in RPL. It uses udp-sink.c and udp-sender.c. These are all sky motes. when I run it,it gives the following errors at the end of compilation:

    [java] FATAL [Thread-0] (SkyMoteType.java:172) - >> /usr/local/msp430/bin/../lib/gcc/msp430/4.7.0/../../../../msp430/bin/ld: udp-sink.sky section `.bss' will not fit in region `ram'
    [java] FATAL [Thread-0] (SkyMoteType.java:172) - >> /usr/local/msp430/bin/../lib/gcc/msp430/4.7.0/../../../../msp430/bin/ld: region `ram' overflowed by 84 bytes
    [java] FATAL [Thread-0] (SkyMoteType.java:172) - >> collect2: error: ld returned 1 exit status
    [java] FATAL [Thread-0] (SkyMoteType.java:172) - >> rm udp-sink.co obj_sky/contiki-sky-main.o
    [java] FATAL [Thread-0] (SkyMoteType.java:172) - >> Process returned error code 2
    [java] FATAL [Thread-0] (SkyMoteType.java:172) - >> make: *** [udp-sink.sky] Error 1
    [java] FATAL [Thread-0] (SkyMoteType.java:175) - Compilation error: Bad return value

    do you have any idea about how to solve it?

    best regards.

    ReplyDelete
    Replies
    1. There is an issue with the image that you are trying to put in the mote, did you make any changes in the code. or may be data collection section? if so you will have to make your collector code efficient, or change and try the things with another mote.

      Delete
  3. what does it mean error 127 while compiling a program in cooja?

    ReplyDelete
  4. I followed the instructions and mobility is enabled in cooja extensions window. Still while on clicking "apply for session" I'm unable to get mobility on toolbar. Mobility.jar is not found.

    ReplyDelete
    Replies
    1. The same problem with me .... we're looking forward to your feedback.

      Thanks.

      Delete
  5. i followed the same instruction but i couldn't see the mobility option in my tool bar.pls reply what i have to do to add mobility menu in tools

    ReplyDelete
    Replies
    1. That happens automatically . there must a glitch at some place. apologies for late reply

      Delete
  6. How can i make more than one mote mobile in cooja?? I tried but i got an error saying "Next event is in the past..."

    ReplyDelete
    Replies
    1. The even should be in sequence. its totally dependent on the .dat file you write, and the timing sequence.

      Delete
  7. Can help me by explaining the use trickle timer in cooja with an video

    ReplyDelete
  8. Sir , can you explain the implementation trickle library in RPL Please

    ReplyDelete

Post a Comment

Popular posts from this blog

Sharto Lagu- Pankhi Re Pankhi Re Lyrics ( પંખી રે પંખી રે)

आज़ादी अभी अधूरी है।