Help for the Viptos 1.0-beta Sensor Networks Development Platform

Running a TinyOS model from within Viptos does not work under Windows

Note: As of 2/06, Windows users must use gcc-3.2 and Cygwin 1.3.22 to to run TinyOS models inside Ptolemy. The reason is that that Java Native Interface (JNI) is broken in newer versions of Cygwin. Windows users must install Cygwin from roughly August, 2003, such as Ptolemy II 3.0 Cygwin Devel See the Ptolemy II PtinyOS Domain Installation Notes for details about setting up Cygwin.

Generating Code for the pc target

Despite the bug above, Windows users and other users can generate code by changing the PtinyOSDirector target from ptII to pc or some other tinyos target like mica or mica install. Only running a simulation within ptII will bring up the pthreads issue.
  1. Assuming you are looking at a demo model, look inside MicaBoard or MicaActor.
  2. Double-click on the PtinyOSDirector and change the target parameter to pc.
  3. Run the model as usual by hitting Control-R or hitting the green run button.
  4. Look in the output directory (you can find out what it was by double-clicking on the PtinyOSDirector and examining the destinationDirectory parameter. For demo models, this is usually demo directory/output.
  5. To run the generated TOSSIM:
    cd demo directory/output
    ./build/pc/main.exe 1
    
    This will run TOSSIM with 1 node.
  6. To only see selected debug output, you may also set your DBG environment variable to the known dbg modes described described when you run:
    ./build/pc/main.exe --help
    
    For example, in tcsh:
    setenv DBG=usr1,am
    
    or in Cygwin bash under Windows
    export DB=-usr1,am
    

Further information

For information about using Viptos, see the Viptos documentation.