Difference between revisions of "TOSSIM Live"
(New page: TOSSIM Live is an extension of TOSSIM (of TinyOS 2.x) developed by Chad Metcalf from the Colorado School of Mines to enable virtual tiered networks. It has two main parts: a simulation thr...) |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | == Introduction == | ||
+ | |||
TOSSIM Live is an extension of TOSSIM (of TinyOS 2.x) developed by Chad Metcalf from the Colorado School of Mines to enable virtual tiered networks. It has two main parts: a simulation throttle and a serial forwarder. The simulation throttle allows the simulation clock to emulate the wall clock, whereas the serial forwarder allows serial messages to be sent to and received from the virtual motes. The code for the serial forwarder resides in <tt>$TOSDIR/lib/tossim/sf/</tt>. | TOSSIM Live is an extension of TOSSIM (of TinyOS 2.x) developed by Chad Metcalf from the Colorado School of Mines to enable virtual tiered networks. It has two main parts: a simulation throttle and a serial forwarder. The simulation throttle allows the simulation clock to emulate the wall clock, whereas the serial forwarder allows serial messages to be sent to and received from the virtual motes. The code for the serial forwarder resides in <tt>$TOSDIR/lib/tossim/sf/</tt>. | ||
Line 30: | Line 32: | ||
This is the active message type of the serial packets that travel across the serial interface. In <tt>TestSerialAppC.nc</tt>, the statement <code>App.Receive -> AM.Receive[AM_TEST_SERIAL_MSG];</code> makes sure only serial packets of the type <tt>AM_TEST_SERIAL_MSG</tt> are received through the serial interface. | This is the active message type of the serial packets that travel across the serial interface. In <tt>TestSerialAppC.nc</tt>, the statement <code>App.Receive -> AM.Receive[AM_TEST_SERIAL_MSG];</code> makes sure only serial packets of the type <tt>AM_TEST_SERIAL_MSG</tt> are received through the serial interface. | ||
− | Finally, run | + | Now, run |
+ | |||
+ | <pre>make micaz sim-sf</pre> | ||
+ | |||
+ | to compile the mote firmware for TOSSIM Live. Finally, run | ||
<pre>./TestSerial.py</pre> | <pre>./TestSerial.py</pre> | ||
+ | |||
+ | Notice that in <tt>TestSerial.py</tt>, serial packets are created using <tt>newSerialPacket()</tt>, whereas normal packets are created using <tt>newPacket()</tt>. |
Latest revision as of 17:40, 4 April 2009
Introduction
TOSSIM Live is an extension of TOSSIM (of TinyOS 2.x) developed by Chad Metcalf from the Colorado School of Mines to enable virtual tiered networks. It has two main parts: a simulation throttle and a serial forwarder. The simulation throttle allows the simulation clock to emulate the wall clock, whereas the serial forwarder allows serial messages to be sent to and received from the virtual motes. The code for the serial forwarder resides in $TOSDIR/lib/tossim/sf/.
Tutorial
Caution: The following tutorial is targeted at the CVS version when TinyOS 2.1.0 was released.
The sample application TestSerial can be used to demonstrate the serial forwarder of TOSSIM Live. While the mote firmware resides in $TOSROOT/apps/tests/TestSerial, the Python simulation code lives in $TOSDIR/lib/tossim/sf/examples. Before TestSerial.py can be run, copy (or make symbolic links of) the files from $TOSDIR/lib/tossim/sf/examples/ to $TOSROOT/apps/tests/TestSerial/.
Two changes need to be made to TestSerial.py. First,
chmod u+x TestSerial.py
Then, add the following to the first line of TestSerial.py if it is not there already:
#!/usr/bin/python
Use the following command to generate TestSerialMsg.py:
mig python -target=null -python-classname=TestSerialMsg TestSerial.h test_serial_msg -o TestSerialMsg.py
The preceding command can be found in $TOSDIR/lib/tossim/sf/examples/Makefile.Driver. Notice that in the file TestSerial.h, the following enum is defined:
enum { AM_TEST_SERIAL_MSG = 0x89, };
This is the active message type of the serial packets that travel across the serial interface. In TestSerialAppC.nc, the statement App.Receive -> AM.Receive[AM_TEST_SERIAL_MSG];
makes sure only serial packets of the type AM_TEST_SERIAL_MSG are received through the serial interface.
Now, run
make micaz sim-sf
to compile the mote firmware for TOSSIM Live. Finally, run
./TestSerial.py
Notice that in TestSerial.py, serial packets are created using newSerialPacket(), whereas normal packets are created using newPacket().