Download presentation
Presentation is loading. Please wait.
1
5/5/2003MobiSys 2003 Tutorial TinyOS Tutorial, Part II Robert Szewczyk, Joe Polastre, Phil Levis, David Culler Mobisys 2003
2
5/5/2003MobiSys 2003 Tutorial Outline Power Management Displaying data on a PC Injecting and broadcasting packets
3
5/5/2003MobiSys 2003 Tutorial Energy – the critical resource Tremendous variance in energy supply and demand –Varied energy sources: primary batteries, rechargeable batteries, solar, vibration, AC –Varied requirements: long term application deployment v. bandwidth limited tracking applications –1 year on 2xAA batteries => 200 uA average current consumption ComponentRateStartup timeCurrent consumption CPU Active 4 MHzN/A 4.6 mA CPU Idle 4 MHz1 us 2.4 mA CPU Suspend 32 kHz 4 ms10 uA Radio Transmit 40 kHz 30 ms12 mA Radio Receive 40 kHz 30 ms3.6 mA Photo2000 Hz10 ms1.235 mA I2C Temp2 Hz500 ms0.150 mA Pressure10 Hz500 ms0.010 mA Press Temp10 Hz500 ms0.010 mA Humidity500 Hz500 ms0.775 mA Thermopile2000 Hz200 ms0.170 mA Thermistor2000 Hz10 ms0.126 mA
4
5/5/2003MobiSys 2003 Tutorial Power Management Design goals –Simple and pervasive mechanism for turning devices off and on –Leave the specific policy to applications or subcomponents Implementation: StdCommand interface interface StdControl { command result_t init(); command result_t start(); command result_t stop(); } “Deep” semantics: start/stop on a component invokes start/stop on subcomponents Components interfacing with hardware need to adjust the CPU state by using PowerManagement interface interface PowerManagement { command uint8_t adjustPower(); }
5
5/5/2003MobiSys 2003 Tutorial Interface & implementation limitations No split-phase interface –Difficult to know exactly when a subcomponent is started and ready to use –Can be solved with queuing requests Start/stop are supposed to act immediately –No delay to finish current tasks –No reference counting, makes sharing difficult when many components attempt to power manage a single subcomponent Boost converter on mica needs to be managed separately to achieve minimum power consumption
6
5/5/2003MobiSys 2003 Tutorial Using Power Management: Chirp Application at a glance ChirpM PhotoSensor GenericCom m TimerLEDs Program one mote with Chirp application cd ${TOSDIR}/apps/Chirp make mica install Program one mote with GenericBase cd ${TOSDIR}/apps/GenericBase make mica install Start SerialForwarder on your PC cd ${TOSDIR}/tools/java java net.tinyos.sf.SerialForwarder & java net.tinyos.tools.ForwarderListen localhost 9000 Verify that packets are coming in
7
5/5/2003MobiSys 2003 Tutorial Components: Timer Timer functionality –Relative timer at 1 ms granularity –Supports one-shot and repeat timers –Parameterized interfaces used to provide different applications with distinct Timers interface Timer { command result_t start(char type, uint32_t interval); command result_t stop(); event result_t fired(); } Wiring the Timer: Chirp.nc configuration Chirp { } implementation { components Main, ChirpM, GenericComm as Comm, Photo, TimerC, LedsC; … ChirpM.Timer -> TimerC.Timer[unique("Timer")]; }
8
5/5/2003MobiSys 2003 Tutorial Timer, cont. Using Timer: ChirpM.nc command result_t StdControl.start() { return call Timer.start(TIMER_REPEAT, 330); } event result_t Timer.fired() { // Do something return SUCCESS; } Timer limitations –Rate errors –Number of active timers –Relative timer only, for applications requiring time synchronization and absolute time reference use the AbsoluteTimer
9
5/5/2003MobiSys 2003 Tutorial ADC: generic sensing interface Interface interface ADC { command result_t getData(); command result_t getContinuousData(); event result_t dataReady(uint16_t data); } Implementation using internal MCU ADC –8 channels, multiplexed onto a single 10-bit ADC with maximum sampling rate of ~15 ksps –Parametrized interfaces –Sensor components assign functional names to the ADC channels and typically add StdControl functionality (e.g. PhotoC).
10
5/5/2003MobiSys 2003 Tutorial Exercise Add a simple power management strategy –When timer fires, start the Photo sensor GenericComm –When a message has been sent successfully, stop the photo sensor, GenericComm and turn off the LEDs Verify that Chirp works as before Expected current consumption graph
11
5/5/2003MobiSys 2003 Tutorial Additional Resources Extending the power management across the network according to different policies –Zhiyuan Ren and Bruce Krogh, “Sentry-Based Power Management in Wireless Sensor Networks,” http://www.andrew.cmu.edu/~zren/papers/ipsn03.pdfSentry-Based Power Management in Wireless Sensor Networks http://www.andrew.cmu.edu/~zren/papers/ipsn03.pdf Generic mechanism for starting/stopping components according to synchronized clock schedule –ServiceSchedulerC in tos/lib –Used within GSK (much more extensive example) Evaluations in real application scenarios (upcoming) –http://www.greatduckisland.nethttp://www.greatduckisland.net
12
5/5/2003MobiSys 2003 Tutorial Displaying data on a PC Refer to tutorial 6
13
5/5/2003MobiSys 2003 Tutorial Injecting and broadcasting packets Refer to tutorial 7
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.