News

COOJA and Testbed Federation/TWIST growing together

Two COOJA plugins and manuals have been published to integrate the TWIST testbed in COOJA and to take checkpoints and perform rollbacks both in TWIST and COOJA.


Call for Papers: CONET/UBICITEC 2013

The 4th International Workshop on Networks of Cooperating Objects for Smart Cities 2013 (CONET/UBICITEC 2013), colocated with CPSWeek 2013, accepts submissions until January 28th, 2013.


Newsletter issue #19

The 19th CONET newsletter has been published. You can read on Virtual Organizations for Multi-Model Based Embedded Systems and on the UvA Bird Tracking System.


CONET Simulation Platform

Introduction and Objectives

There exist a large number of simulation platforms. These are non-interoperable both with respect to each other and to their connection with simulators. This causes several problems:

  1. It complicates the development of CO applications as cooperation between simulators themselves and between simulators and testbeds is useful. For example, mobility scenarios from mobility simulators such as BonnMotion can be used as input to wireless sensor network simulators that simulate networks of mobile nodes.
  2. The overhead of moving from simulation to testbed is unnecessary complex
  3. It makes it more or less impossible to compare simulation results

NEW: Integration between Simulation and the Testbed Federation

We have developed a Cooja-TWIST plugin that lets you use the Testbed Federation and in particular the TWIST testbed directly from the Cooja simulator. It makes it easier to upload your code and observe its execution remotely with all the power of Cooja. Please find the manual undefinedhere to try it out! It is really useful for everybody using TWIST and/or COOJA.

NEW: Checkpointing in TWIST and COOJA

We have further developed support for taking checkpoints and performing a rollback both in the COOJA simulator and the TWIST testbed. The manual is available undefinedhere.

 

Approach

Towards this end, the mission of this CONET task is to constitute a simulation platform that enables cooperation between simulators. There are different approaches that we have discussed in a publication. The approach we advocate is that of a common input and output format.

The FP7 project WISEBED has designed WiseML, format that directly fits our common input and output format. We also enable cooperation between the CONET Integrated Testbed and between the TWIST testbed and the COOJA simulator.

Results

Our current main results towards the cooperation of simulators include:

Other results:

Downloads

Note: an updated installation tutorial can be found below.

For your convenience, we have prepared a VMWare image with all software pre-installed. You need hence not download and install all COOJA extension projects separately.

  • Instant Contiki 2.4 (CONET edition) with a recent Contiki CVS snapshot (2010-07-05), and with all three below COOJA projects pre-installed.
  • COOJA extension project: Mobility (mobility, also available via Contiki-projects)
  • COOJA extension project: WiseML (cooja-wiseml, not yet publicly available elsewhere)
  • COOJA extension project: Robots (robot-testbed, not yet publicly available elsewhere)

Tutorials

Tutorial #1 Start the Instant Contiki (CONET edition) environment

  1. Prerequisites: Install VMWare Player (http://www.vmware.com/products/player/)
  2. Download and unpack Instant Contiki 2.4 (CONET edition) above
  3. Load the virtual machine by opening instant-contiki.vmx in VMWare Player
  4. Logon to the system, user/password: user/user
  5. Open a terminal by double-clicking the Terminal desktop icon

 

Tutorial #2 Run COOJA with mobility support

  1. Start COOJA via terminal
    > cd /home/user
    > cd contiki-2.x/tools/cooja
    > ant
  2. Load simulation with mobile nodes:
    Menu > File > Open simulation > Browse > /home/user/conet/mobility.csc
    The above simulation moves simulated nodes according to a random-waypoint model.
    The node positions are located in the BonnMotion-compatible positions file in /home/user/conet/mobility/position.dat.
  3. Click Control Panel > Start to start the simulation.

Note that you can easily create your own mobility file using BonnMotion. You need BonnMotion version 1.4. COOJA accepts files in the "IntervalFormat" (see Section 7.4 in the BonnMotion documentation). You create these by running e.g. bm IntervalFormat -f scenario

Tutorial #3 Run COOJA and import a WiseML-simulation (with and without COOJA hints)

  1. Start COOJA via terminal
    > cd /home/user
    > cd contiki-2.x/tools/cooja
    > ant
  2. Import WiseML simulation *WITHOUT* COOJA hints:
    Menu > File > Import from WiseML > Browse to /home/user/conet/cooja-wiseml/examples/ex_110nodes.wiseml > Open.
    Since this is a generic WiseML configuration it does not know about COOJA/Contiki, so you now have to specify what application to simulate.
  3. Click Next
  4. Select Note Type: Contiki Mote Type
  5. Select application by clicking Browse, and selecting the Contiki application in /home/user/contiki-2.x/examples/rime/example-abc.c. Click Next.
    The WiseML simulation is now loaded. It contains mobility scenario information.
  6. Click Control Panel > Start to start the simulation. You'll see nodes moving in the visualizer.
  7. Close the current simulation: Menu > File > Close simulation > Remove

 

Now we will load an equivalent WiseML simulation *WITH* COOJA hints.

  1. Again, click Menu > File > Import from WiseML.
    Browse to /home/user/conet/cooja-wiseml/examples/ex_110nodes_cooja.wiseml > Open.
    Since this WiseML simulation contains COOJA hints, this time you do not need to specify the Contiki application.
  2. Click Control Panel > Start to start the simulation.

Note that in this example, nodes move and send packets. When running the example, you will notice that nodes do not receive packets. This is because for the radio model that is used (DGRM), there are not links defined. You can add links between nodes with the "DGRM Configurator" plugin.

Tutorial #4 Connect COOJA to a (simulated) Robot testbed

You will need access to a Robot testbed. This guide assumes you have a network-enabled CONET IT VM, where we will start up a Stage Robot simulation (see below). We will then connect COOJA to the simulated robot testbed.

 

TIP: One way to enable inter-virtual machine communication is to configure the CONET IT VM to use host-only networking, and the Instant Contiki to use NAT networking.

Start the Robot Stage simulation, and record host information: 

  1. Load the CONET IT VM and logon to the system, user/password: ituser/ituser
  2. Start a terminal and go to the Stage example simulations
    > cd /home/ituser/Software/Stage\ files
  3. Start the Stage Robot simulation. It will by default listen on port 6665.
    > player testbed.cfg
  4. Start a secondary terminal, and record the CONET IT VM address information
    > ifconfig
    Look for the IP addrees of eth1, for example 192.168.56.101.
  5. Make sure you can access the CONET IT VM from your host system (e.g. Windows)
    > ping 192.168.56.101
  6. Make sure you can access the CONET IT VM from the Instant Contiki virtual machine (inside VMWare)
    > ping 192.168.56.101

 

Return to Instant Contiki

  1. Update configuration to point to your robot testbed server address (e.g. 192.168.56.101 above).
    Update the following fields in in /home/user/conet/robot-testbed/cooja-player/cooja.config:
    se.sics.cooja.conet.CoojaPlayer.TESTBED_ip = 192.168.56.101
    se.sics.cooja.conet.CoojaPlayer.TESTBED_port = 6665 
  2. Start COOJA via terminal
    > cd /home/user
    > cd contiki-2.x/tools/cooja
    > ant 
  3. Load simulation that connects to robot testbed
    Menu > File > Open simulation > Browse > /home/user/conet/robot.csc
  4. Click the "Connect ..." button in the CONET Testbed plugin. The 5 robot nodes visible in the visualizer are now synchronized to the robot testbed.

Return to CONET IT VM and control the simulated robots, for example via:
> playerv
Menu > Devices > position2d:0 > Subscribe & Command, and mouse-drag the robot

Updated version: CONET Integrated Testbed simulation environment: COOJA vs Robots

Note: a VM with all necessary software pre-installed is available here. If you have downloaded the Virtual Machine image with the required software already pre-installed, skip down to Section "Run demo application".

The CONET Integrated Testbed simulation environment allows you to write and test both robot applications and sensor network Contiki applications without access to any hardware! This guide will help you step-by-step install all software required for the CONET Integrated Testbed simulation environment.

Installation

  • Install the free version of VMWare Player, required to correctly run Instant Contiki (www.vmware.com/products/player/)
  • Download the Instant Contiki 2.5rc1 VM: www.sics.se/contiki/instant-contiki.html
  • Start Instant Contiki, log in (user/user), and open a terminal
  • Install prerequisites:
    • $ sudo apt-get install libserial-dev # password "user", Y to confirm
    • $ sudo apt-get install libdc1394*
    • $ sudo apt-get install libgtk2.0-dev
    • $ sudo apt-get install socat
    • $ sudo apt-get install cmake
    • $ sudo apt-get install libfltk1.1
    • $ sudo apt-get install libfltk1.1-dev
    • $ sudo apt-get install libglu1-mesa-dev
    • $ sudo apt-get install git-core

 

Install Contiki and COOJA

    • $ cd
    • $ mv contiki-2.x contiki-2.x_old # Rename previous CVS-based Contiki dist
    • $ git clone git://contiki.git.sourceforge.net/gitroot/contiki/contiki contiki-2.x
    • $ export CONTIKI_HOME=~/contiki-2.x
    • $ cd $CONTIKI_HOME/tools/cooja
    • $ ant jar

Install Player and Stage with CONET-specific modifications

Download IT demo goto application

Compile Cooja Robot project

    • $ cd # return to home directory
    • $ cd $ROBOT_APP_HOME/cooja-robot-project
    • $ ant jar

Register Cooja Robot project in Cooja

  • Start Cooja
    • $ cd $CONTIKI_HOME/tools/cooja
    • ant run
      • Menu > Settings > COOJA projects > Browse to and select both javaclient_download and cooja-robot-project under /home/user/conet-it-goto-demo-app
      • Click Save as default, followed by OK
  • Quit Cooja

Run demo application

Setup paths

  • Start Instant Contiki, log in (user/user), and open a terminal
    • $ export CONTIKI_HOME=~/contiki-2.x
    • $ export ROBOT_APP_HOME=~/conet-it-goto-demo-app

Start Player/Stage demo application

    • $ cd $ROBOT_APP_HOME/robot
    • $ player robot-app.cfg
    • When the robot simulation starts a window appears, press "R" to show a 3D perspective view

Note: a bug in Stage causes the player server to sometimes crash at startup. For now, just restart it. More information available here: old.nabble.com/-STAGE--Subscribing-to-some-drivers-causes-extreme-FLTK-badness-p29311245.html

Connect to the player server with the robot application in a new terminal

  • Start a new terminal and setup paths as above
    • $ cd $ROBOT_APP_HOME/robot
    • $ make robot-app
    • $ ./robot-app

Start COOJA, and load demo simulation

  • Start a new terminal and setup paths as above
    • $ cd $CONTIKI_HOME/tools/cooja
    • $ ant
  • Menu > File > Open simulation > Browse.. > Browse to /home/user/conet-it-goto-demo-app/contiki > Open demo_scenario_goto.csc
  • When the simulation has loaded, the robot connection will automatically be established as shown in the upper right "Robot testbed connection" plugin.
  • Click Control Panel's Start button to start the simulation.

Simulate communication between WSN and Robot testbed

  • The connection is via a virtual serial port
  • Both the robot and the sensor motes can send commands via serial port
  • In this demo, a mote issues a goto request to the robot, that acknowledges the command and then moves to the mote's location
  • Sensor mote button clicks cause the mote to broadcast a message to all robot-connected motes, whereby the robot-connected motes command the robot to move to the button-mote
  • To simulate an on-board button click: Right-click a mote in the Simulation Visualizer, and select "Click button on [...]". You will see the robot moving accordingly short thereafter.