Based on slides from Andreas Larsson 2013. Table from CY Chong, SP Kumar, BA Hamilton - Proceedings of the IEEE, 2003.

Slides:



Advertisements
Similar presentations
System Integration and Performance
Advertisements

NesC Prepared for the Multimedia Networks Group University of Virginia.
Feb 2007WSN Training: First Steps in nesC Programming1 First Steps in TinyOS and nesC Programming Topics  Timer Application: MyApp  Application directory.
1 Lab 3 Objectives  Case study: “Hello world” program on motes  Write you first program on mote.
Overview: Chapter 7  Sensor node platforms must contend with many issues  Energy consumption  Sensing environment  Networking  Real-time constraints.
1 Lab4 Objectives  Learn to read light sensor data from sensor board  Learn to transmit a message containing the sensed data  through Mote serial port.
Mote Programming. 如何 compile 程式  make [re]install. : desired device address : target platform  install vs. reinstall install : compile the application.
TinyOS Introduction Advanced Computer Networks. TinyOS Outline  Introduction to the Architecture of TinyOS and nesC  Component Model –Components, interfaces,
TinyOS Tutorial Communication Networks I Wenyuan Xu Fall 2006.
How to Code on TinyOS Xufei Mao Advisor: Dr. Xiang-yang Li CS Dept. IIT.
Programming Motes A TinyOS and TOSSIM Tutorial By: Brent Rood.
1 TinyOS Network Communication Computer Network Programming Wenyuan Xu Fall 2007.
Development of a Mica2 Mote Sensor Network Cliff Macklin Bill Ehrbar December 8, 2004 University of Colorado, Colorado Springs.
TinyOS Software Engineering Sensor Networks for the Masses.
2008EECS Embedded Network Programming nesC, TinyOS, Networking, Microcontrollers Jonathan Hui University of California, Berkeley.
PtinyOS: Simulating TinyOS in Ptolemy II Elaine Cheong Dec 10, 2004 EE290N Project Presentation (Initial NC code generator by Yang Zhao and Edward Lee)
1 Lab 3 Objectives  Case study: “Hello world” program on motes  Write you first program on mote.
TinyOS Tutorial Based on Wenyuan Xu’s slides ( NetsF06/Comnet_TinyOS_Tutorial_xwy.ppt)
1 Software Development Infrastructure for Sensor Networks  Operating systems ( TinyOS )  Resource (device) management  Basic primitives  Protocols.
TinyOS Tutorial Jianping Wang (merge several tutorials found online)
A Survey of Software Tools for Sensor Networks
1 Lab 5 Objectives  Use XMesh multi-hop networking service to send sensing data to a base station  Using XServe to display the sensor data message on.
Programming in nesC (and TOSSIM)
By: R Jayampathi Sampath
April 15, 2005TinyOS: A Component Based OSPage 1 of 27 TinyOS A Component-Based Operating System for Networked Embedded Systems Tom Bush Graduate College.
1 TinyOS Computer Network Programming Wenyuan Xu Fall 2007.
TinyOS 1/2 Onsystech Sangjae Han.
1 Lab2 Objectives  Basics of TinyOS  Basics of nesC programming language.
HW2: Q&A Oct. 02, Lab Machine TinyOS is installed in one machine (531AB). But, you have to bring your kit. There is a sign up sheet. Please sign.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Light Sense Lab. Read data from light(photo diode) sensor, display using oscilloscope.
Dhanshree Nimje Smita Khartad
CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.
Lab 3 Introduction to TinyOS and nesC How to debug programs at PC Examples –Blink Timer –Blink –Hellow World Reference: 1.x/doc/tutorial/lesson1.html.
Simulation of Distributed Application and Protocols using TOSSIM Valliappan Annamalai.
TinyOS Tutorial Lesson 8 Data logging application.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 TinyOS & NesC.
Part 2 TinyOS and nesC Programming Selected slides from:
Feb 2007WSN Training: Creating a Simple Sensor Application1 A TinyOS Sensor Application called MyApp Objectives  How to create a simple Mote firmware.
Feb 2007WSN Training: XMesh Services1 Lab6 Objectives:  Route Control Interface  Understand XMesh transport services 1.Upstream 2.Upstream with end-to-end.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Wireless MAC Practice (MAC I)
Operating Systems Lecture November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,
@ nesC Programming KETI / Ubiquitous Computing Center Jeonghoon Kang
Main Issues Three major issues that we are concerned with in sensor networks are – Clustering Routing and Security To be considered against the backdrop.
RTX - 51 Objectives  Resources needed  Architecture  Components of RTX-51 - Task - Memory pools - Mail box - Signals.
Xiong Junjie Node-level debugging based on finite state machine in wireless sensor networks.
WSN Software Platforms - concepts Vinod Kulathumani Lecture uses some slides from tutorials prepared by authors of these platforms.
Lab 3, Part 2 Selected slides from: Wireless Sensor Networks Hardware/Software Tiny OS & NesC Programming borrowed from Turgay Korkmaz.
TinyOS Sandeep Gupta. Operating System (OS) What is an OS? Main functions  Process management  Memory management  Resource management Traditional OSs.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Gossiping Protocol.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Lab1: LED Control ZigbeX mote has Red, Yellow, Green LED. This lab using LED control component provided by TinyOS.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 HelloWorld By using LED & Timer components, we will display “helloworld” in a manner of Morse code.
Blink Blink.nc configuration Blink { } implementation { components Main, BlinkM, SingleTimer, LedsC; Main.StdControl -> BlinkM.StdControl; Main.StdControl.
Feb 2007WSN Training: XMesh Enabled Sensor App1 Lab 5 Objectives  Use XMesh multi-hop networking service to send sensing data to a base station  Using.
Cyber-Physical Programming
Why does it need? [USN] ( 주 ) 한백전자 Background Wireless Sensor Network (WSN)  Relationship between Sensor and WSN Individual sensors are very limited.
Software Architecture of Sensors. Hardware - Sensor Nodes Sensing: sensor --a transducer that converts a physical, chemical, or biological parameter into.
TinyOS Sandeep Gupta. TinyOS basics TinyOS is  Single tasking OS  Interrupt driven Written using a Component based language A set of components put.
Tinyos Introduction to Programming Pritee Parwekar.
Simulation of Distributed Application and Protocols using TOSSIM
WSN Training: XMesh Enabled Sensor App
Operating System for Sensor Network
Ad Hoc Networking using Flooding protocol
Lab 3 Routing in Sensor Networks
Lab 3 Routing in Sensor Networks
An Introduction to nesC
WSN Training: TinyOS/nesC Basic Concepts TinyOS and nesC
Operating Systems Lecture 3.
SenseToRfm SenseToInt.Timer -> TimerC; configuration SenseToRfm {
Lab 3 Routing in Sensor Networks
Lab 3 Routing in Sensor Networks
Presentation transcript:

Based on slides from Andreas Larsson 2013

Table from CY Chong, SP Kumar, BA Hamilton - Proceedings of the IEEE, 2003

CPU7MHz Program Memory 128 kB RAM4 kB Storage Memory 512 kB Bandwidth250 kBps Indoor Range m Outdoor Range m Battery Life Full operation at all times 50 h

 Sleeping  The Main Task  Data gathering  Data aggregation  Data communication  Auxiliary Tasks  Synchronization  Security

 Utility  Structural health monitoring  Agriculture  Parking space guidance/monitoring  Research  Volcanos  Permafrost  Animal behavior COMMONSense Permasense

Part 2 TinyOS and nesC Programming Selected slides from: Wireless Sensor Networks Hardware/Software Tiny OS & NesC Programming borrowed from Turgay Korkmaz

What is TinyOS? Operating system developed by UC Berkeley Open Source development environment – System, library and applications written in nesC nesC (network embedded system C) a component-based C – Event-driven architecture – Single shared stack – NO kernel, process/memory management

Programming Model Basic concept behind nesC: Separation of construction and composition Programs are built out of components

Components A component is a black box specified by interface(s) Interfaces define a set of logically related I/O functions called commands and events Components use and provide interfaces Components are statically wired together based on their interfaces Timer Component StdControl Timer Clock provides uses StdControl.nc interface StdControl { command result_t init(); command result_t start(); command result_t stop(); } Clock.nc interface Clock { command result_t setRate( char interval, char scale); event result_t fire(); }

Components (cont’d)‏ A component – Processes Commands – Throws Events – Has a Frame for local state – Uses Tasks for concurrency Components must implement – the events they use and – the commands they provide Can signalMust implement Provide Must implementCan call Use EventsCommandsComponent Timer Component StdControl Timer Clock provides uses

Commands and Events Commands – deposit request parameters into the frame – are non-blocking – need to return status – postpone time consuming work by posting a task – can call lower level commands Events – can call commands, signal events, post tasks – can Not be signaled by commands – preempt tasks, not vice-versa – interrupt trigger the lowest level events – deposit the information into the frame {... status = call CmdName(args)‏... } command CmdName(args) {... return status; } {... status = signal EvtName(args)‏... } event EvtName(args) {... return status; }

Component Hierarchy Components are wired together by connecting users with providers Commands: – Flow downwards – Control returns to caller Events: – Flow upwards – Control returns to signaler

Types of Components There are two types of components: Modules: provide code that implements one or more interfaces and internal behavior Configurations: Wires/links components together to yield a new component A component does not care if another component is a module or configuration A component may be composed of other components

Component Syntax - Module module ForwarderM { provides { interface StdControl; } uses { interface StdControl as CommControl; interface ReceiveMsg; interface SendMsg; interface Leds; } implementation { code implementing all provided commands used events, and tasks } ForwarderM StdControl ReceiveMsg provides uses CommControl SendMsg Leds interface StdControl { command result_t init(); command result_t start(); command result_t stop(); } interface SendMsg{ command result_t send(uint16_t address, uint8_t length, TOS_MsgPtr msg); event result_t sendDone(TOS_MsgPtr msg, result_t success); }

module ForwarderM { //interface declaration } implementation { command result_t StdControl.init() { call CommControl.init(); call Leds.init(); return SUCCESS; } command result_t StdControl.start() {…} command result_t StdControl.stop() {…} event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr m) { call Leds.yellowToggle(); call SendMsg.send(TOS_BCAST_ADDR, sizeof(IntMsg), m); return m; } event result_t SendMsg.sendDone(TOS_MsgPtr msg, bool success) { call Leds.greenToggle(); return success; } module ForwarderM { //interface declaration } implementation { command result_t StdControl.init() { call CommControl.init(); call Leds.init(); return SUCCESS; } command result_t StdControl.start() {…} command result_t StdControl.stop() {…} event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr m) { call Leds.yellowToggle(); call SendMsg.send(TOS_BCAST_ADDR, sizeof(IntMsg), m); return m; } event result_t SendMsg.sendDone(TOS_MsgPtr msg, bool success) { call Leds.greenToggle(); return success; } Command imp. (interface provided)‏ Event imp. (interface used)‏ ForwarderM StdControl ReceiveMsg provides uses CommControl SendMsg Leds Component Implementation

Component Syntax - Configuration configuration Forwarder { } implementation { components Main, LedsC; components GenericComm as Comm; components ForwarderM; Main.StdControl -> ForwarderM.StdControl; ForwarderM.CommControl -> Comm; ForwarderM.SendMsg -> Comm.SendMsg[AM_INTMSG]; ForwarderM.ReceiveMsg -> Comm.ReceiveMsg[AM_INTMSG]; ForwarderM.Leds -> LedsC; } Component Selection Wiring the Components together ForwarderM StdControl ReceiveMsg providesuses CommControl SendMsg Leds Main StdControl LedsC Leds GenericComm SendMsg ReceiveMsg StdControl Forwarder

21 DSII: Group Comm.

The lab is done on the computer: dark.cs.chalmers.se You will receive a username and password in pingpong. TinyOS with all sources for libraries and everything is installed at /opt/tinyos Unpack Rout.tar.gz into your home directory (at the server) and do the assignment from there. Compile the program by executing: make micaz sim Run the simulation by executing:./simulation.py Build topologies using buildtopo.py to get a grid and then remove some nodes to get some interesting formation

 Implement something better than the basic routing algorithm.  The battery level is something that is known to a node, so feel free to use that in your algorithm. Sink Messages: Announcement Content

 Aggregate information and send it to the sink.  Many nodes in an area send their information to a cluster head  The cluster head sends the aggregate message to the sink.  A simple algorithm to choose cluster head:  for every node with a certain probability announces itself to be a cluster head.  Choose the parameters you like: battery level of the node, battery level of neighbors, etc.  A cluster head should not store content for more than 1 round.

 Report:  Part 1:  Discuss the idea behind your algorithm.  Present results from comparing your algorithm to the original algorithm.  Discuss failed improvements.  Part 2:  Discuss the idea behind your algorithm.  Present results from comparing your algorithm to your algorithm in part one.  Discuss failed improvements.  Presentation:  Each group gives a 10 min presentation of their algorithm.  March 6, 13:15-17:00, Room: EL42. 25