TinyOS is an event-driven operating system designed for sensor network nodes that have very limited resources (e.g., 8K bytes of program memory, 512 bytes of RAM). TinyOS, is used, for example, on the Berkeley MICA motes, which are small wireless sensor nodes. nesC is an extension to the C programming language designed to embody the structuring concepts and execution model of TinyOS.
ncapp2moml is used to convert nesC application files (.nc) into MoML (.moml) files. This will create Ptolemy II models that you can run in Viptos. You must setup the necessary MoML library of nesC components with the nc2moml tool before you can successfully open files made with this ncapp2moml tool.
Note: You must follow the instructions here for running the nc2moml tool before you can use models generated with this ncapp2moml tool.
Note: As of 10/05, Windows users will not be able to run TinyOS models inside Ptolemy. The reason is that reloading the TinyOS shared objects into the running Ptolemy interface fails because the TinyOS shared objects use pthreads and under Windows, Java is using Windows native threads. We are working on a solution. In the interim, Windows users can convert .nc files to .moml files and create models, but running the model fails.
cd $PTII/ptolemy/domains/ptinyos/util/ncapp2moml ./ncapp2momlThe
ncapp2moml
command will take a few minutes to complete.
Note: The ncapp2moml tool requires that you build the tools in $PTII/bin
. Do the following and rerun the script above if they are missing:
cd $PTII/bin make
$PTII/vendors/ptinyos/momlapp
$PTII/bin/vergil -viptos
$PTII/vendors/ptinyos/momlapp/apps/CntToLeds/CntToLeds.moml
or
$PTII/vendors/ptinyos/momlapp/apps/CntToLeds/CntToLeds-InWireless.moml
(only one of these will have been generated, depending
on what options were used in running ncapp2moml).
$PTII/vendors/ptinyos/momlapp/apps/Blink/Blink.moml
or
$PTII/vendors/ptinyos/momlapp/apps/Blink/Blink-InWireless.moml
(only one of these will have been generated, depending
on what options were used in running ncapp2moml.