<<Prev  
Home
   
Next>>
The TinyOS Simulator - TOSSIM
  TOSSIM, the TinyOS simulator, is a very useful tool for debugging and testing TinyOS programs. This tool is especially important because of the large number of possible problems that could be encountered by the motes which may not have anything to do with the NesC program. It would help a great deal to know that your code works fine, before you actually upload it to the motes.

We are currently writing programs in NesC which have all been tested using TOSSIM. We expect to upload these programs as soon as we resolve the hardware problems we had with the motes.

See http://webs.cs.berkeley.edu/tos/nest/doc/tutorial/tossim-lesson.html for a more complete description of how TOSSIM is used.

We summarize the steps for using TOSSIM and the related GUI-based application TinyViz.

TOSSIM
1. CD into the directory containing your NesC code.
2. Run ‘make pc’ for generating a TOSSIM version of the application. The TOSSIM executable is in build/pc/main.exe.
3. Run ‘./build/pc/main.exe <no. of motes>’ where <no.of motes> is the number of motes that are to be simulated. You should see the screen fill up with messages.
4. To filter this output, set the DBG environment variable. For this,
Type ‘export DBG=led’ (to see only led specific files).
Type ‘export DBG=am, led’(for seeing only active messages and leds).
For full set of DBG modules,
Type in ‘./build/pc/main.exe –help’.
TinyViz
TinyViz provides a user interface for debugging, visualizing and interacting with the TOSSIM simulations. It provides easy tracing of TinyOS applications, visualizing radio messages and radio connectivity of motes. See Pages 4-8 here for more details on using the various features provided by TinyViz. To start TinyViz, do the following:
export DBG=usr1
/opt/tinyos-1.x/tools/java/net/tinyos/sim/tinyviz –run build/pc/main.exe <no. of motes>

where <no. of motes> is the number of motes to be simulated by TOSSIM.

You should be able to see the motes visually, with the LEDs on them turning on and off according to the program they are running. There is also a debug messages option in the plugins that allows you to see the debug messages according to how you set the DBG option. We will let you explore the rest of the plugins provided, or see http://webs.cs.berkeley.edu/tos/nest/doc/tutorial/tossim-lesson.html for a description.