TimerC; SenseToInt.ADC -> Sensor; SenseToInt.ADCControl -> Sensor; SenseToInt.IntOutput -> IntToLeds; } module SenseToInt { provides { interface StdControl; } uses { interface Timer; interface StdControl as TimerControl; interface ADC; interface StdControl as ADCControl; interface IntOutput; } } implementation {... } configuration TimerC { provides interface Timer[uint8_t id]; provides interface StdControl; } implementation { components TimerM, ClockC, NoLeds, HPLPowerManagementM; TimerM.Leds -> NoLeds; TimerM.Clock -> ClockC; TimerM.PowerManagement -> HPLPowerManagementM; StdControl = TimerM; Timer = TimerM; }"> TimerC; SenseToInt.ADC -> Sensor; SenseToInt.ADCControl -> Sensor; SenseToInt.IntOutput -> IntToLeds; } module SenseToInt { provides { interface StdControl; } uses { interface Timer; interface StdControl as TimerControl; interface ADC; interface StdControl as ADCControl; interface IntOutput; } } implementation {... } configuration TimerC { provides interface Timer[uint8_t id]; provides interface StdControl; } implementation { components TimerM, ClockC, NoLeds, HPLPowerManagementM; TimerM.Leds -> NoLeds; TimerM.Clock -> ClockC; TimerM.PowerManagement -> HPLPowerManagementM; StdControl = TimerM; Timer = TimerM; }">
Download presentation
Presentation is loading. Please wait.
1
A Graphical Development and Simulation Environment for TinyOS-based Wireless Sensor Networks Elaine Cheong February 13, 2007 Seventh Biennial Ptolemy Miniconference Berkeley, California
2
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 2 Wireless Sensor Networks
3
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 3 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; } module SenseToInt { provides { interface StdControl; } uses { interface Timer; interface StdControl as TimerControl; interface ADC; interface StdControl as ADCControl; interface IntOutput; } } implementation {... } configuration TimerC { provides interface Timer[uint8_t id]; provides interface StdControl; } implementation { components TimerM, ClockC, NoLeds, HPLPowerManagementM; TimerM.Leds -> NoLeds; TimerM.Clock -> ClockC; TimerM.PowerManagement -> HPLPowerManagementM; StdControl = TimerM; Timer = TimerM; }
4
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 4 SenseToLeds in Viptos
5
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 5 Converting between nesC and MoML nc2moml nesC component code MoML class (Ptolemy actor) ncapp2moml nesC application code MoML entity (Ptolemy model)
6
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 6 Generating MoML for TimerC.nc – nc2moml <!DOCTYPE plot PUBLIC "-//UC Berkeley//DTD MoML 1//EN" "http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd">
7
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 7 Generating MoML for SenseToLeds.nc – ncapp2moml... <entity name="MicaCompositeActor" class="ptolemy.domains.ptinyos.lib.MicaCompositeActor">.........
8
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 8 SenseToLeds – Physical Environment
9
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 9 SenseToLeds – Hardware
10
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 10 SenseToLeds – Software
11
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 11 PtinyOSDirector
12
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 12 SenseToLeds – PhotoSource
13
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 13 SenseToLeds – PhotoChannel
14
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 14 SenseToLeds – WirelessDirector
15
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 15 SenseToLeds – Simulation
16
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 16 How it works Java (PtinyOSDirector)Java (PtinyOSLoader)C (TOSSIM) PtinyOSDirector.preinitialize() Generate nesC code, makefile, and PtinyOSLoader Java file. Run ‘make’. Compile nesC code to a TOSSIM shared object, and PtinyOSLoader Java file to a Java class file. PtinyOSDirector.initialize() Load PtinyOSLoader Java class into memory. Create instance of PtinyOSLoader class (_loader). Call Java _loader.load(). _loader.load() Load the TOSSIM shared object into memory.
17
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 17 How it works (cont.) Java (PtinyOSDirector)Java (PtinyOSLoader)C (TOSSIM) PtinyOSDirector.initialize(), continued Call Java _loader.main(). _loader.main() Call JNI main_unique_name() native method. JNI main_unique_name() Call TOSSIM main(), which contains an initialization routine: Call TOSSIM initializeSockets() Call TOSSIM ptII_startThreads() Call JNI _loader.startThreads(). _loader.startThreads() Create Java threads. Call Java Thread.start() on each thread.
18
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 18 How it works (cont.) Java (PtinyOSDirector)Java (PtinyOSLoader)C (TOSSIM) TOSSIM main() initialization routine, continued Create bootup event. Call TOSSIM ptII_queue_insert_event(). Call JNI _loader.enqueueEvent(). _loader.enqueueEvent() Call Java PtinyOSDirector.enqueueEvent(). PtinyOSDirector.enqueueEvent() Call Java Ptolemy II fireAt() on the executive director.
19
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 19 SendAndReceiveCnt
20
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 20 SendAndReceiveCnt
21
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 21 SendAndReceiveCnt
22
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 22 SendAndReceiveCnt – Simulation
23
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 23 Multihop Routing – Surge
24
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 24 Performance Evaluation – SenseToLeds
25
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 25 Performance Evaluation – SendAndReceiveCnt
26
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 26 Related Work ns-2 OPNET Modeler, OPNET Wireless Module OMNeT++, NesCT J-Sim Prowler Em*, EmTOS TOSSIM, TinyViz
27
February 13, 2007 Elaine Cheong, UC Berkeley, Ptolemy Miniconference 27 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.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.