Hi all,
I'm using CTP to collect multiply motes together to perform some basic
measurements. I now want optimize power consumption, by enabling LPL (low
power listening).
As far as I can tell from various posts on the net, to use LPL together with
CTP one has to use the SendNotifier interface (from CC2420ActiveMessageC -
i'm using TelosB).

As you can see, in aboutToSend I call fatal_problem() to easily verify if
the event is ever signaled. However, it doesn't appear as if the event is
ever signaled/called. Have I done anything wrong in the wiring or something?

Below is relevant code:

Makefile
COMPONENT=MVizAppC
CFLAGS += -I$(TOSDIR)/lib/net/ -I$(TOSDIR)/lib/net/ctp
-I$(TOSDIR)/lib/net/le -I.
CFLAGS += -DCC2420_NO_ADDRESS_RECOGNITION


CFLAGS += -DLOW_POWER_LISTENING
BUILD_EXTRA_DEPS = MVizMsg.class

MVizMsg.java: MViz.h
        mig -target=null -java-classname=MVizMsg java MViz.h mviz_msg -o $@

MVizMsg.class: MVizMsg.java
        javac MVizMsg.java

include $(MAKERULES)



MVizAppC.nc
[...]
configuration MVizAppC { }
implementation {
        components MainC, MVizC, LedsC, new TimerMilliC(),
                   new SensirionSht11C() as Sensor, new DemoSensorC() as
VoltSensor, RandomC;


        MVizC.Boot -> MainC;
        MVizC.Timer -> TimerMilliC;
        MVizC.Read0 -> Sensor.Temperature;
        MVizC.Read1 -> Sensor.Humidity;
        MVizC.Read2 -> VoltSensor;
        MVizC.Leds -> LedsC;
        MVizC.Random -> RandomC;
        //
        // Communication components.  These are documented in TEP 113:
        // Serial Communication, and TEP 119: Collection.
        //
        components CollectionC as Collector,  // Collection layer
                   ActiveMessageC,                         // AM layer
                   new CollectionSenderC(AM_MVIZ_MSG), // Sends multihop RF
                   SerialActiveMessageC,                   // Serial
messaging
                   new SerialAMSenderC(AM_MVIZ_MSG);   // Sends to the
serial port


        components CC2420ActiveMessageC;
        MVizC -> CC2420ActiveMessageC.CC2420Packet;
        MVizC -> CC2420ActiveMessageC.LowPowerListening;
        MVizC -> CC2420ActiveMessageC.SendNotifier[AM_MVIZ_MSG]; // TODO:
rewire

        MVizC.RadioControl -> ActiveMessageC;
        MVizC.SerialControl -> SerialActiveMessageC;
        MVizC.RoutingControl -> Collector;

        MVizC.Send -> CollectionSenderC;
        MVizC.SerialSend -> SerialAMSenderC.AMSend;
        MVizC.Snoop -> Collector.Snoop[AM_MVIZ_MSG];
        MVizC.Receive -> Collector.Receive[AM_MVIZ_MSG];
        MVizC.Intercept -> Collector.Intercept[AM_MVIZ_MSG];
        MVizC.RootControl -> Collector;

}

[...]

MVizC.nc
[...]
module MVizC @safe(){
        uses {
                // Interfaces for initialization:
                interface Boot;
                interface SplitControl as RadioControl;
                interface SplitControl as SerialControl;
                interface StdControl as RoutingControl;

                // Interfaces for communication, multihop and serial:
                interface Send;
                interface Receive as Snoop;
                interface Receive;
                interface AMSend as SerialSend;
                interface CollectionPacket;
                interface RootControl;
                interface Intercept;

                // Miscalleny:
                interface Timer<TMilli>;
                interface Read<uint16_t> as Read0;
                interface Read<uint16_t> as Read1;
                interface Read<uint16_t> as Read2;
                interface Leds;
                interface Random;
                interface CC2420Packet;
                interface LowPowerListening;
                interface SendNotifier;
        }
}
[...]
event void Boot.booted() {
                if (call RadioControl.start() != SUCCESS)
                        fatal_problem();

                if (call RoutingControl.start() != SUCCESS)
                        fatal_problem();
                #if defined(LOW_POWER_LISTENING)
                call LowPowerListening.setLocalWakeupInterval(sleep);
                #endif
}

event void SendNotifier.aboutToSend(am_addr_t dest, message_t *msg){
                // TODO: Enable low power...
                fatal_problem();
}
[...]



Med Venlig Hilsen/Best Regards
Jan Christensen
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to