130 likes | 260 Views
TinyOS. By Valliappan Annamalai. Hardware. Mica motes (Mica2 and Mica2Dot) Hardware Radio Microcontroller Flash memory ADC Sensor Board (MTA310). Programming Motes. TinyOS Simple Operating system. Similar to state machine model. Component based model. Language: Nesc.
E N D
TinyOS By Valliappan Annamalai
Hardware • Mica motes (Mica2 and Mica2Dot) • Hardware • Radio • Microcontroller • Flash memory • ADC • Sensor Board (MTA310)
Programming Motes • TinyOS • Simple Operating system. • Similar to state machine model. • Component based model. • Language: Nesc.
TinyOS Composition • Simple FIFO scheduler • Commands • Signals • Tasks
TinyOS-Services • Radio, MAC, Routing • Sensor Interfaces • Power Management • Security • Time
TinyOS Programming Structures • Components • Provides and Use interfaces • Interfaces are bi-directional (Commands & events) • Two types of components • Modules • Configuration
Radio Packet packet Radio byte byte RFM bit TinyOS Application • Consists of a tiny scheduler and graph of components data processing application comp message-event driven active message crc event-driven byte-pump encode/decode event-driven bit-pump
Programming the Mote • Compile the application using ncc. • Convert it into a flash memory format using avr-objcopy. • Upload to mote using the programming board (MIB 500) via parallel port. • Uisp is used to program the flash.
Example Application • Badge Tracker • Badge: Used for establishing a person’s location • Infrastructure based application BS BM BM B BM BM BS BS
Applications • Badge • Base Station • Serial Forwarder • Tracker Sender • Tracker Server
Application Messaging Tracker Sender Tracker Server Badge Base Station W/L Message With Bdg ID Bdg Msg With BS ID and Signal Strength Forwards the Messages it Receives 1 Sec UDP data packets with BS message W/L Message With Bdg ID …….. Serial Forwarder
Common Problems • Radio: Motes not able to exchange data • check • Frequency of Operation • Group ID • Distance • Transmission power level • Check destination ID • UART: PC not able to correct data • Check • Bit rate
Troubleshooting • Leds • Dbg Statements • JTAG • Use Atomic statements to avoid race conditions • Send & receive message buffers