Posts

Showing posts with the label tinyos

LINK ESTIMATION EXCHANGE PROTOCOL: (LEEP)

In-bound link quality:In-bound link quality is a value in the range of 0 to 255 that descries the quality of link from A to B estimated by B by counting the packets which are successfully receuved among all the transmitted packets. For calculating the bidirectional link quality ,the in-bound link should be exchanged among the neighbours.LEEP frame includes a sequence number that will be incremented for every outbound.It will be incremented even when it is retransmitted. Nodes receiving the frames use those sequence numbers and a small cache to determine the quality of in-bound link. Each frame also includes inbound link quality for each of the sender's neighbours. Receiving nodes may use that (outbound quality) combined with the inbound quality that they have calculated from the neighbour's sequence numbers to determine the bidirectional quality.

TinyOS code to set a Node as Root

According to a collection protocol a node has four roles : producer,consumer,snooper and in-network processor.Consumer is the root. To set the node as the root the TinyOS code is Node_RootC.nc module Node_RootC { uses interface Boot; uses interface Leds; uses interface RootControl; } implementation { event void Boot.booted() { call RootControl.setRoot(); if(call RootControl.isRoot()==TRUE) call Leds.led0On(); } } Node_RootAppC .nc configuration Node_RootAppC { } implementation { components MainC,LedsC,CollectionC,Node_RootC; Node_RootC.Boot->MainC; Node_RootC.Leds->LedsC; Node_RootC.RootControl->CollectionC; } Here RootControl.setRoot() command is used to set the node as Root and RootControl.isRoot() commands returns a boolean value. It returns TRUE when the node is root . It returns FALSE when the node is non-root.

Error in IRIS Mote -solved

If you get any error like when you are installing blink program on iris avrdude: safemode: efuse changed! Was ff, and is now f7 Would you like this fuse to be changed back? [y/n] y solution: vi /opt/tinyos-main/support/make/iris.target add in this : ifeq ($(PROGRAMMER),avrdude) PROGRAMMER_PART ?= -pm1281 -U efuse:w:0xff:m endif afterwards: ifeq ($(PROGRAMMER),avrdude) PROGRAMMER_PART ?= -pm1281 -U efuse:w:0xf7:m #PROGRAMMER_PART ?= -pm1281 -U efuse:w:0xff:m endif 

Creating a New Platform in TInyOS

What is aTinyOS Platform?     A physical platform is comprised of a set of chips. Similarly a TinyOS platform is nothing but  collection of components representing these chips(drivers of the chips).. How to create a New Platform?   If the chips of the new platform are already present in the exixsting platform then implementing a new platform simply means wiring existing components. If the chips of the new platform are not present in any existing platforms then implementing the new platform consists of implementing components (drivers) for those chips and then wiring them. Things Required For a New Platform:     A new platform definition requires three things: Defintion of chips that creates the platform Definition of the Platform(Combining chips to platform) and Tool Chain or make definition Chips Defintions:(tos/chips/chipX)     Each chip will be assigned a specific directory under tos/chips.    Each...

Booting Process in TinyOS

In our programs we always be wiring in our configuration file Boot interface to MainC component.Boot->MainC.Boot; So from this MainC is the component which is providing the Boot Interface. But when you look at the code in the MainC component. You will find that Boot=RealMainP. It means whenever you call MainC.Boot it automatically goes to RealMainP.Boot.. It means that RealMainP  signals the event booted() of the Boot interface. Now we will see what are the steps before it signals the booted() event of Boot interface. Step1: Platform_bootstrap();           call Scheduler.init(); Here he is initializing the scheduler so that any components can posts tasks and initializing all the other hardware related stuff. Step2: call PlatformInit.init();        while(call Scheduler.runNextTask()); Initializing the platform. Then spinning on the scheduler to check whether all the tasks are completed. If all the  tasks are complet...

TinyOS Syntax Highlighting with gedit

If  you want the gedit to show some colours when you are writing a TinyOS/NesC program follow these steps Download the nesc.lang file from the site http://sourceforge.net/projects/nescplugin/files/ and copy it to /usr/share/gtksourceview-3.0/language-specs/

Hardware Abstraction Architecture of TInyOS

Hardware Abstraction Architecture of TInyOS The Hardware Abstraction Architecture of TinyOS has three layers.. 1. Hardware Presentation Layer : It is the lowest layer. It provides the lowest level access to the hardware, and provides wrappers around lowest level tasks,such as setting registers with higher level software calls. Components in this layer are not expected to be used from user program as any functionality they provide should be exposed by higher levels above it. Components should be efficient,because many higher level components may call it simultaneously. 2.Hardware Adaptation Layer: It is above the Hardware Presentation Layer. Contains most of the platform code. Exposes one or more components for each piece of functionality the mote provides. HAL components provide advanced functionality of the program at the expense of programs using them become platform-specific. 3.Hardware Interface Layer: The...

MOTE -PC COMMUNICATION in TinyOS

MOTE -PC COMMUNICATION in TinyOS STEP1:Install the TestSerial Application on your mote. The application sends a packet over the serial interface for every second,and when it receives a packet it displays the binary equivalent over the LED's. STEP2:Once you have installed application on the mote.we need to run the corresponding java application to communicate with the serial port. This is build when we install the application on the mote. From the application directory type java TestSerial<-' If you get an error like sf@localhost:9002 died - exiting (java.net.ConnectException: Connection refused) It means you have not specified the serial port as source you have to specify in the syntax Type export MOTECOM=serial@/dev/ttyUSB0:telosb for telosb mote. STEP3: Now when you type java TestSerial <-' , you will get output like Received packet sequence number 317 Sending packet 1 Received packet sequence number 318 Sending pac...