CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes...
-
Upload
godwin-harold-oneal -
Category
Documents
-
view
227 -
download
0
Transcript of CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes...
![Page 1: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/1.jpg)
CIS 798
Sensor Network Implementation
![Page 2: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/2.jpg)
Goals
• Learning sensor network programming with Crossbow motes
• Implement reasonable sized sensor applications
• Develop expertise to engage in more realistic sensor applications
![Page 3: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/3.jpg)
Platforms
• Crossbow Motes
• TinyOS
![Page 4: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/4.jpg)
• Student groups (2 students each)
• Lab groups
• Project groups
![Page 5: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/5.jpg)
Topics
• TinyOS programming
• Component based programming model
• System setup
![Page 6: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/6.jpg)
![Page 7: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/7.jpg)
![Page 8: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/8.jpg)
![Page 9: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/9.jpg)
• Tutorials
• Help sessions
• Hardware
![Page 10: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/10.jpg)
commands
events
Components
provides uses
Interface: Bidirectional
![Page 11: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/11.jpg)
Interfaces
provides uses
Component: Provide or use multiple interfaces of the same type or different types
![Page 12: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/12.jpg)
Components
Simple components
Configuration
![Page 13: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/13.jpg)
Blink
This application simply causes the red LED on the mote to turn on and off at 1Hz
![Page 14: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/14.jpg)
BlinkBlink.nc configuration Blink {}implementation { components Main, BlinkM, SingleTimer, LedsC;
Main.StdControl -> BlinkM.StdControl; Main.StdControl -> SingleTimer.StdControl; BlinkM.Timer -> SingleTimer.Timer; BlinkM.Leds -> LedsC;}
![Page 15: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/15.jpg)
Interface stdcontrolStdControl.nc interface StdControl { command result_t init(); command result_t start(); command result_t stop();}
![Page 16: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/16.jpg)
Interface StdcontrolMain.StdControl -> BlinkM.StdControl;
When StdControl.init in Main is called, StdControl.init in BlinkM is automatically invoked
![Page 17: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/17.jpg)
BlinkM.ncmodule BlinkM { provides { interface StdControl; } uses { interface Timer; interface Leds; }}
interface Timer { command result_t start(char type, uint32_t interval); command result_t stop(); event result_t fired();}
• start(): to specify the type of the timer and the interval at which the timer will expire;
• the fired() event is signaled when the specified interval has passed
![Page 18: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/18.jpg)
BlinkM.ncinterface Timer { command result_t start(char type, uint32_t interval); command result_t stop(); event result_t fired();}
interface Leds { async command result_t init(); async command result_t redOn(); async command result_t redOff(); async command result_t redToggle(); async command result_t greenOn(); async command result_t greenOff(); async command result_t greenToggle(); async command result_t yellowOn(); : :}
![Page 19: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/19.jpg)
BlinkM.nc
module BlinkM { provides { interface StdControl; } uses { interface Timer; interface Leds; }}
implementation {
command result_t StdControl.init() { call Leds.init(); return SUCCESS; }
command result_t StdControl.start() { return call Timer.start(TIMER_REPEAT, 1000) ; }
command result_t StdControl.stop() { return call Timer.stop(); }
event result_t Timer.fired() { call Leds.redToggle(); return SUCCESS; }}
![Page 20: CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.](https://reader030.fdocuments.net/reader030/viewer/2022032805/56649ef65503460f94c0a91d/html5/thumbnails/20.jpg)
Week 1
• Read lesson 1
• Install Tiny OS (or use machines in N22)
• Compile Blink
• Program mote to run Blink
• Modify Blink so that Led blinks for 10 secs and then stops for 5 secs (and this is repeated).