[Tinyos-help] Time needed between send and receive.
Hi All, I am using the Tmote Sky. Assume Node A is sending a value to Node B who upon receipt of this message resends some other value back to node A straight away. Is there any problems that might occur in this scenario? For example is it possible that node A may not have time to switch to receive mode after it has sent its message and therefore miss the message from Node B? The reason I ask is I have a similar setup and Node A doesn't appear to be receiving anything at all but is sending. Any ideas on a solution? Best Regards, Terence _ Search and browse smarter - get MSN Search Toolbar with Desktop Search! http://toolbar.msn.ie ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Time needed between send and receive.
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;i500;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 Terence Joseph wrote: Hi All, I am using the Tmote Sky. Assume Node A is sending a value to Node B who upon receipt of this message resends some other value back to node A straight away. Is there any problems that might occur in this scenario? For example is it possible that node A may not have time to switch to receive mode after it has sent its message and therefore miss the message from Node B? The reason I ask is I have a similar setup and Node A doesn't appear to be receiving anything at all but is sending. Any ideas on a solution? Best Regards, Terence _ Search and browse smarter - get MSN Search Toolbar with Desktop Search! http://toolbar.msn.ie ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Time needed between send and receive.
Can't this situation be helped by changing the receive evens to async? Harri At 12:58 PM 12/15/2005 +0100, 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;i500;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 Terence Joseph wrote: Hi All, I am using the Tmote Sky. Assume Node A is sending a value to Node B who upon receipt of this message resends some other value back to node A straight away. Is there any problems that might occur in this scenario? For example is it possible that node A may not have time to switch to receive mode after it has sent its message and therefore miss the message from Node B? The reason I ask is I have a similar setup and Node A doesn't appear to be receiving anything at all but is sending. Any ideas on a solution? Best Regards, Terence _ Search and browse smarter - get MSN Search Toolbar with Desktop Search! http://toolbar.msn.ie ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Time needed between send and receive.
Obviously this would be a job for the TinyOS authors if that's the case. Your second thought cannot be true, how could you declare sync events in that case? Regards, Harri At 02:04 PM 12/15/2005 +0100, Andrea Pacini wrote: But we need to change TinyOS system files and all dependencies ? Because simply declaring : async event Receive ... doesn't work because compiler plains about previous declaration of receive. Anyway if I remember correctly , when async word misses, automatically the behaviour is set to asyncronous. Harri Siirtola wrote: Can't this situation be helped by changing the receive evens to async? Harri At 12:58 PM 12/15/2005 +0100, 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;i500;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 Terence Joseph wrote: Hi All, I am using the Tmote Sky. Assume Node A is sending a value to Node B who upon receipt of this message resends some other value back to node A straight away. Is there any problems that might occur in this scenario? For example is it possible that node A may not have time to switch to receive mode after it has sent its message and therefore miss the message from Node B? The reason I ask is I have a similar setup and Node A doesn't appear to be receiving anything at all but is sending. Any ideas on a solution? Best Regards, Terence _ Search and browse smarter - get MSN Search Toolbar with Desktop Search! http://toolbar.msn.ie ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Time needed between send and receive.
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;i500;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 Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Time needed between send and receive.
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;i500;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;i500;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 Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help