Thanks for your answer, but now I have another problem: I have two
kinds of telosB Motes, the first sends a message every second and the
second motes sends a message every five seconds and it is always
listening. The second mote has the following code:

event void Boot.booted ( )
{call RadioControl.start ( );
call LowPowerListening.setLocalSleepInterval (5000);
call Timer.startPeriodic (5000);
}

event void RadioControl.startDone (error_t error) { }

event void RadioControl.stopDone (error_t error) { }

event void Timer.fired ( )
{call Leds.led0Toggle ( );
call AMSend.send (AM_BROADCAST_ADDR, &sendbuf, sizeof local);
}
event void AMSend.sendDone (message_t* msg, error_t error) { }

event message_t* Receive.receive (message_t* msg, error_t error)
{call Leds.led1Toggle ( );
return msg
}

I don't understand why the yellow LED toggles every five seconds
instead to toggle every second. Can someone explain me why and how to
solve the problem?

Sarah Rediviva


2008/9/25 David Moss <[EMAIL PROTECTED]>:
> Are you compiling in the low power listening layer with the stack?  By
> default it is not there to save ROM for apps that don't need it. Add "lpl"
> to your make command, like "make telosb lpl" or just add
> "CFLAGS+=-DLOW_POWER_LISTENING" to your Makefile to add in the LPL layer.
> You'll see a warning telling you the LPL layer has been compiled in.
>
> You should only have to call setLocalSleepInterval once at the start of your
> application.  After that, the layer in the radio stack responsible for
> managing radio power will automatically put the radio back to sleep when no
> more activity is found on the channel.
>
> The amount of time the radio is awake after activity is programmable by
> editing the DELAY_AFTER_RECEIVE preprocessor variable found in DefaultLpl.h
> (in the latest stack version).
>
> -David
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Rediviva
> Goth
> Sent: Thursday, September 25, 2008 12:18 PM
> To: tinyos-help@millennium.berkeley.edu
> Subject: [Tinyos-help] CC2420 energy consumptions
>
> Hi to all
> I am an engineering student and I'm studying consumptions for the
> CC2420 radio. I have noticed that
>
> energy consumptions are very high and I tried to use LPL interface to
> reduce consumptions.
> In my test program I switched the radio, I set the timer and when it
> is called the event fired I send
>
> data to another mote. Every time I send data invoke the command
> setLocalSleepInterval to avoid
>
> unnecessary energy consumptions of radio, but consumption remains unchanged.
> How should I use interface LPL? someone can show me an example code if
> it is possible?
> Thank you
>
> Sarah Rediviva
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
>
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to