Learning about TOSSIM¶
TOSSIM is a discrete event simulator.
When it runs, it pulls events of the event queue (sorted by time) and executes them.
It works by replacing components with simulation implementations.
TOSSIM is a library: you must write a program that configures a simulation and runs it.
Preparing environment¶
Install required additional packages: gcc-4.8, g++-4.8 and python-dev.
Edit $TOSROOT/support/make/sim.extra:
Change value of GCC to gcc-4.8.
Change value of GPP to g++-4.8.
In PYTHON_VERSION change argument of the sed command to:
's/Python 2\.\([0-9]\)\..*/2.\1/'
Verify it works by compiling TOSSIM for the Blink example app:
$ cd apps/Blink
$ make micaz sim
and then invoking python and importing TOSSIM:
>>> from TOSSIM import *
Using TOSSIM¶
Follow TOSSIM tutorial. Sections 1 – 5 are essential for our classes. Feel encouraged to read also Sections 6 – 8 containing other useful information (e.g. using gdb).
JTossim¶
There is a GUI to TOSSIM. It contains also some additional useful features. See JTossim website.