Hi, I'm working with TinyOS-2.x for a few weeks in my free time. I'm 
using the Iris platform. I have few problems with my application. App is 
for sending broadcast messages in a specified interval to the motes 
where I measure the rssi. And then forward these values with CTP to the 
CTP-root and from there to the serial port. I have topology of 2 of 
broadcasting motes, 5 receivers/forwarders and 1 base.
The Problem is that the broadcasting motes in a random time stop 
working. This problem I have with forwarders and CTProot too.
They stop working at random time. Sometimes after 5 minutes or after 
hour, or they work just fine for a whole night. But I think that the 
main problem eventually can be just in the Sending interface. Maybe Im 
using it wrong way.
Now all motes are at one place, so every mote except the base can 
receive the broadcast messages. Im suspecting that the medium can be 
occupied, because forwarders trying send messages at the same time, and 
this can have effects to the sending interface, if there is implemented 
some kind of default MAC proto. Maybe CSMA, I really dont know. Or I 
have to implement Csma in a some way, if it isnt default?

Is there any limitations to the send interface or can anybody tell me 
where  am I making mistakes? Because I cant explain this behavior.
Here is the sample of code:

configuration DummySendAppC {
}
implementation {
     components MainC;
   ....
     components ActiveMessageC;
     components RF230ActiveMessageC;
     components new AMSenderC(AM_DUMMY);

     App.Boot->MainC;
   .......
     App.Packet->AMSenderC;
     App.AMPacket->AMSenderC;
     App.AMSend->AMSenderC;
     App.AMControl->ActiveMessageC;
}


module DummySendC @safe(){
   uses interface Boot;
   ....
     uses interface AMSend;
     uses interface SplitControl as AMControl;
}
implementation {
     bool busy = FALSE;
     message_t dummy;
     message_t * dummyPtr = &dummy;
     RssiMsg * btrpkt;

     ...
     ...
     event void Timer0.fired() {
         btrpkt = (RssiMsg * )(call AMSend.getPayload(dummyPtr, 
sizeof(RssiMsg)));
         btrpkt->SrcID = TOS_NODE_ID;
         btrpkt->TxRssi = TX_POWER;
         call AMSend.send(AM_BROADCAST_ADDR, dummyPtr, sizeof(RssiMsg));
     }

     event void AMSend.sendDone(message_t * msg, error_t error) {
         if(error == SUCCESS) {
             call Leds.led2Toggle();
         }
     }
     ......

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to