270 likes | 426 Views
A Graphical Development and Simulation Environment for TinyOS-based Wireless Sensor Networks. Elaine Cheong February 13, 2007 Seventh Biennial Ptolemy Miniconference Berkeley, California. Wireless Sensor Networks. module SenseToInt { provides { interface StdControl; } uses {
E N D
A Graphical Development and Simulation Environment for TinyOS-based Wireless Sensor Networks Elaine Cheong February 13, 2007 Seventh Biennial Ptolemy Miniconference Berkeley, California
Wireless Sensor Networks Elaine Cheong, UC Berkeley, Ptolemy Miniconference
moduleSenseToInt { provides { interface StdControl; } uses { interface Timer; interface StdControl as TimerControl; interface ADC; interface StdControl as ADCControl; interface IntOutput; } } implementation { ... } configurationTimerC { providesinterface Timer[uint8_t id]; providesinterface StdControl; } implementation { components TimerM, ClockC, NoLeds, HPLPowerManagementM; TimerM.Leds -> NoLeds; TimerM.Clock -> ClockC; TimerM.PowerManagement -> HPLPowerManagementM; StdControl = TimerM; Timer = TimerM; } TinyOS and nesC configuration SenseToLeds { } implementation { components Main, SenseToInt, IntToLeds, TimerC, DemoSensorC as Sensor; Main.StdControl -> SenseToInt; Main.StdControl -> IntToLeds; SenseToInt.Timer -> TimerC.Timer[unique("Timer")]; SenseToInt.TimerControl -> TimerC; SenseToInt.ADC -> Sensor; SenseToInt.ADCControl -> Sensor; SenseToInt.IntOutput -> IntToLeds; } Elaine Cheong, UC Berkeley, Ptolemy Miniconference
SenseToLeds in Viptos Elaine Cheong, UC Berkeley, Ptolemy Miniconference
Converting between nesC and MoML • nc2moml • nesC component code MoML class (Ptolemy actor) • ncapp2moml • nesC application code MoML entity (Ptolemy model) Elaine Cheong, UC Berkeley, Ptolemy Miniconference
Generating MoML for TimerC.nc – nc2moml <?xml version="1.0"?> <!DOCTYPE plot PUBLIC "-//UC Berkeley//DTD MoML 1//EN" "http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd"> <class name="TimerC" extends="ptolemy.domains.ptinyos.lib.NCComponent"> <property name="source" value="$CLASSPATH/tos/system/TimerC.nc" /> <port name="StdControl" class="ptolemy.actor.IOPort"> <property name="input" /> <property name="_showName" class="ptolemy.kernel.util.SingletonAttribute" /> </port> <port name="Timer" class="ptolemy.actor.IOPort"> <property name="input" /> <property name="multiport" /> <property name="_showName" class="ptolemy.kernel.util.SingletonAttribute" /> </port> </class> Elaine Cheong, UC Berkeley, Ptolemy Miniconference
Generating MoML for SenseToLeds.nc – ncapp2moml ... <entity name="MicaCompositeActor" class="ptolemy.domains.ptinyos.lib.MicaCompositeActor"> <entity name="Main" class="tos.system.Main" /> <entity name="TimerC" class="tos.system.TimerC" /> <entity name="SenseToInt" class="tos.lib.Counters.SenseToInt" /> <entity name="IntToLeds" class="tos.lib.Counters.IntToLeds" /> <entity name="DemoSensorC" class="tos.sensorboards.micasb.DemoSensorC" /> ... <link relation="relation1" port="Main.StdControl" /> <link port="IntToLeds.StdControl" relation="relation2" /> <link relation1="relation2" relation2="relation1" /> <link port="SenseToInt.StdControl" relation="relation3" /> <link relation1="relation3" relation2="relation1" /> <link relation="relation4" port="SenseToInt.Timer" /> <link port="TimerC.Timer" relation="relation5" /> <link relation1="relation5" relation2="relation4" /> ... </entity> ... Elaine Cheong, UC Berkeley, Ptolemy Miniconference
SenseToLeds – Physical Environment Elaine Cheong, UC Berkeley, Ptolemy Miniconference
SenseToLeds – Hardware Elaine Cheong, UC Berkeley, Ptolemy Miniconference
SenseToLeds – Software Elaine Cheong, UC Berkeley, Ptolemy Miniconference
PtinyOSDirector Elaine Cheong, UC Berkeley, Ptolemy Miniconference
SenseToLeds – PhotoSource Elaine Cheong, UC Berkeley, Ptolemy Miniconference
SenseToLeds – PhotoChannel Elaine Cheong, UC Berkeley, Ptolemy Miniconference
SenseToLeds – WirelessDirector Elaine Cheong, UC Berkeley, Ptolemy Miniconference
SenseToLeds – Simulation Elaine Cheong, UC Berkeley, Ptolemy Miniconference
How it works Elaine Cheong, UC Berkeley, Ptolemy Miniconference
How it works (cont.) Elaine Cheong, UC Berkeley, Ptolemy Miniconference
How it works (cont.) Elaine Cheong, UC Berkeley, Ptolemy Miniconference
SendAndReceiveCnt Elaine Cheong, UC Berkeley, Ptolemy Miniconference
SendAndReceiveCnt Elaine Cheong, UC Berkeley, Ptolemy Miniconference
SendAndReceiveCnt Elaine Cheong, UC Berkeley, Ptolemy Miniconference
SendAndReceiveCnt – Simulation Elaine Cheong, UC Berkeley, Ptolemy Miniconference
Multihop Routing – Surge Elaine Cheong, UC Berkeley, Ptolemy Miniconference
Performance Evaluation – SenseToLeds Elaine Cheong, UC Berkeley, Ptolemy Miniconference
Performance Evaluation – SendAndReceiveCnt Elaine Cheong, UC Berkeley, Ptolemy Miniconference
Related Work • ns-2 • OPNET Modeler, OPNET Wireless Module • OMNeT++, NesCT • J-Sim • Prowler • Em*, EmTOS • TOSSIM, TinyViz Elaine Cheong, UC Berkeley, Ptolemy Miniconference
Conclusion • http://ptolemy.eecs.berkeley.edu/viptos • Elaine Cheong, Edward A. Lee and Yang Zhao. “Joint Modeling and Design of Wireless Networks and Sensor Node Software”, EECS Department, University of California, Berkeley, Technical Report No. UCB/EECS-2006-150, November 17, 2006. Elaine Cheong, UC Berkeley, Ptolemy Miniconference