Yes, I have tested also this variant but with the same results:

void task dummy_task() {
uint32_t i; call Leds.redOn(); for (i=0;i<5000000;i++) ; call Leds.redOff(); }

 command result_t StdControl.start(){
                   post dummy_task();
                   return SUCCESS;
}

The receive event IS NOT TRIGGERED during the task.

Martin Gercke wrote:

Are you sure that this behaviour has nothing to do with the fact that you call your loop in StdControl.start? E.g. you could try to drop a task in the StdControl.start and see if the problem still persists. I doubt that this would cause any problems since the packets are received in an interrupt and any function run in that interrupt will be called directly, right?
Not too sure about this though.

Martin


Andrea Pacini wrote:

Yes this is the same problem , I think, that I have met some time ago.
The problem is that when a node sends a message the other node receives this message ONLY IF it is not running any code. (only in this case the receive event is triggered). It seems that the node cannot buffer the RECEIVE event if it is running something. So , if you want that a node receives surely a message you must write your code so that when it should receive a message it has run
all the previous code.
It is a strange behaviour in my opinion, I don't know if it is only for Tmote Sky (TelosB) or for all platforms.

To highlight this behaviour try these situation:

NODE A: NODE B:

[...] event Receive (){ call Leds.redOn(); } call Send(); // sends something StdControl.start () { }
[....]

Node B does nothing; it only waits for A message. Clearly, it receives the message from A.
Now try these:

NODE A: NODE B:

[...] event Receive (){ call Leds.redOn(); } call Send(); // sends something StdControl.start () { [....] for (i=0;i<5000000;i++) ; }

Now A sends a message while B is running a FOR cycle (make sure that A sends its message while B is running the for cycle) You should see that red Led doesn't turn on, because the Receive event seems to be "LOST".


Andrea


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



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

Reply via email to