Re: [Tinyos-help] send, senddone and receive
Hi, No idea. It should not be like that. Have you tried with only one node or many? If there are many perhaps you are getting a message from another one. Otherwise there may be something wrong in your code... Cheers! Sergio On Wed, Feb 15, 2012 at 4:33 PM, Omar Cheikhrouhou (yahoo) enis01a...@yahoo.fr wrote: Dear all, Does anybody can explain why the receive event is triggered before the senddone event, when sending a message? ** ** Thanks in advance, Omar ___ 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
Re: [Tinyos-help] send, senddone and receive
I would say it has nothing to do with sending. Rather, I suspect that the mote has actually received a packet from another mote. Does it do this repeatedly? that is can you duplicate the behaviour, or does it change.If the only mote powered up is the mote in question, does the problem replicate? On Wed, Feb 15, 2012 at 11:06 AM, Sergio Valcarcel serteck...@gmail.comwrote: Hi, No idea. It should not be like that. Have you tried with only one node or many? If there are many perhaps you are getting a message from another one. Otherwise there may be something wrong in your code... Cheers! Sergio On Wed, Feb 15, 2012 at 4:33 PM, Omar Cheikhrouhou (yahoo) enis01a...@yahoo.fr wrote: Dear all, Does anybody can explain why the receive event is triggered before the senddone event, when sending a message? ** ** Thanks in advance, Omar ___ 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 -- Eric B. Decker Senior (over 50 :-) Researcher ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
RE: [Tinyos-help] send - sendDone delay (MICAz, T2)?
Hi again It's because of the MAC layer. The default CC2420 layer in T2 has an initial backoff of approximately 1-10ms. So after you call send(), the MAC layer waits 1-10ms before trying to send the packet. am I correct in saing that one jiffy is something like ~0.03125 ms from the 32khz timer and that: (from the code below the p.s.) CC2420_BACKOFF_PERIOD = CC2420_MIN_BACKOFF = 10 jiffies or ~0.3125ms so the initial backoff is (call Random.rand16() % (0x1F * CC2420_BACKOFF_PERIOD) + CC2420_MIN_BACKOFF) which is bounded by 10 and 319 jiffies, or 0.3125 and 9.96875 ms and congestion backoff is (call Random.rand16() % (0x7 * CC2420_BACKOFF_PERIOD) + CC2420_MIN_BACKOFF) which is bounded by 10 and 79 jiffies or 0.3125 and 2.46875 ms ...I'm sure I saw something increasing and then limiting the maximum number of congestion backoff periods as well somewhere? Probably to three or four, so the maximum total backoff before the radio gave up (assuming it eventually gives up?) would be maybe (10 + 2.5 + 5 + 7.5 + 10 [...+n*10?]) about 35ms[...+n*10?]? or has my guessing/maths gone horribly wrong somewhere? :-) I assume this has something to do with the existence of the 100ms default on-time timer in LPL when energy is detected? regards, Ben p.s. code I am basing these guesses on... I found the following in CC2420.h: enum cc2420_enums { CC2420_TIME_ACK_TURNAROUND = 7, // jiffies CC2420_TIME_VREN = 20, // jiffies CC2420_TIME_SYMBOL = 2, // 2 symbols / jiffy CC2420_BACKOFF_PERIOD = ( 20 / CC2420_TIME_SYMBOL ), // symbols CC2420_MIN_BACKOFF = ( 20 / CC2420_TIME_SYMBOL ), // platform specific? CC2420_ACK_WAIT_DELAY = 256,// jiffies }; and then this in CC2420CsmaP: /* SubBackoff Events / async event void SubBackoff.requestInitialBackoff(message_t *msg) { call SubBackoff.setInitialBackoff ( call Random.rand16() % (0x1F * CC2420_BACKOFF_PERIOD) + CC2420_MIN_BACKOFF); signal RadioBackoff.requestInitialBackoff[((cc2420_header_t*)(msg-data - sizeof(cc2420_header_t)))-type](msg); } async event void SubBackoff.requestCongestionBackoff(message_t *msg) { call SubBackoff.setCongestionBackoff( call Random.rand16() % (0x7 * CC2420_BACKOFF_PERIOD) + CC2420_MIN_BACKOFF); signal RadioBackoff.requestCongestionBackoff[((cc2420_header_t*)(msg-data - sizeof(cc2420_header_t)))-type](msg); } ---end--- *** Please consider the environment before printing this email. *** This email and any files transmitted with it are intended solely for the use of the individual or entity to whom they are addressed and may not be divulged to any third party without the express permission of the originator. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thales Research Technology (UK) Limited. *** ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] send - sendDone delay (MICAz, T2)?
Hi I did some tests a while ago with a couple of MICAz nodes when putting some time sync into my code and came across a 10ms randomness in the delay between my code calling .Send() and the .sendDone() event being signalled. The delay seemed to vary pretty randomly between 3ms and 13ms. Is there some reason for this (large?) delay? I based the timing on the difference in value of a millisecond timer for matched send and senddone pairings and used that to achieve decent enough (hopefully about +-1ms) sync for some small-scale controlled tests but it was a bit of a rushed (and rather roundabout) way to achieve accurate sync and not really practical in a proper deployment. I saw the discussion on time sync in the devel forum and people seem to indicate rather better sync in the order of (micro seconds) us or better and I was wondering where the option to stick a timestamp in the outgoing messages at the actual time of transmission rather than the time of calling the send event as the latter is not very accurate requiring a more complex sync proceedure? the TEP I read indicated that the timestamp in the message_t is not transmitted but is local to the node? cheers, Ben *** Please consider the environment before printing this email. *** This email and any files transmitted with it are intended solely for the use of the individual or entity to whom they are addressed and may not be divulged to any third party without the express permission of the originator. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thales Research Technology (UK) Limited. *** ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] send - sendDone delay (MICAz, T2)?
On Jan 3, 2008, at 5:58 AM, Murray, Ben wrote: Hi I did some tests a while ago with a couple of MICAz nodes when putting some time sync into my code and came across a 10ms randomness in the delay between my code calling .Send() and the .sendDone() event being signalled. The delay seemed to vary pretty randomly between 3ms and 13ms. Is there some reason for this (large?) delay? I based the timing on the difference in value of a millisecond timer for matched send and senddone pairings and used that to achieve decent enough (hopefully about +-1ms) sync for some small-scale controlled tests but it was a bit of a rushed (and rather roundabout) way to achieve accurate sync and not really practical in a proper deployment. It's because of the MAC layer. The default CC2420 layer in T2 has an initial backoff of approximately 1-10ms. So after you call send(), the MAC layer waits 1-10ms before trying to send the packet. I saw the discussion on time sync in the devel forum and people seem to indicate rather better sync in the order of (micro seconds) us or better and I was wondering where the option to stick a timestamp in the outgoing messages at the actual time of transmission rather than the time of calling the send event as the latter is not very accurate requiring a more complex sync proceedure? the TEP I read indicated that the timestamp in the message_t is not transmitted but is local to the node? The core WG is talking about this right now. The actual embedment of a timestamp is not a big deal; the question is what the API should be. We're also trying to wrestle with network interoperability questions. Take a look at Miklos' mail to -devel in November. It has two interfaces; one is for receiver-only timestamps, the other is for transmitter-receiver timestamps. Phil ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] send - sendDone delay (MICAz, T2)?
The delay seemed to vary pretty randomly between 3ms and 13ms. Is there some reason for this (large?) delay? Sending uses CSMA with a random backoff to avoid collisions with packets sent by other motes in the network. On the CC1000 you can change the backoff value by implementing the CsmaBackoff interface and wiring it into CC1000CsmaRadioC. I'm not quite sure how its done on the CC2420, but I assume there is probably something similar. -- ~Kevin ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
RE: [Tinyos-help] send - sendDone delay (MICAz, T2)?
Thanks Phil and Kevin. I didn't realise the backoff was that long - I guess the 3ms is the time taken at a (rater sub-240kbps) actual data rate after overheads etc. I had it in my head that the backoff was in the order of microseconds - I'm sure I found that somewhere, but it may have been under the LPL framework?! I'll try have a proper read of the devel discussion. cheers, Ben *** Please consider the environment before printing this email. *** This email and any files transmitted with it are intended solely for the use of the individual or entity to whom they are addressed and may not be divulged to any third party without the express permission of the originator. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thales Research Technology (UK) Limited. *** ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
RE: [Tinyos-help] send(), senddone() and receive()
When you call send() and it returns SUCCESS, the packet goes into a queue with the promise to send it at some point in the future. The radio might first finish receiving a packet and/or wait for the channel to clear if it is currently busy. After that, it'll go into TX mode and actually send the packet. HTH, Michiel SOWNet logo_KL Michiel Konstapel Software Engineer T: +31 (0)15 26 00 44 6 F: +31 (0)15 26 00 40 5 W: www.sownet.nl From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tingting Sun Sent: vrijdag 30 november 2007 0:26 To: tinyos-help@Millennium.Berkeley.EDU Subject: [Tinyos-help] send(), senddone() and receive() Hi All, For some reason my motes are getting interrupted between AMSend.send() and AMSend.sendDone() by the Receive.receive() event. But to my understanding, after a send() and before a senddone(), the radio is in tx mode and should not go to rx mode in the middle to enable a receive, is that correct? Any quick suggestions, if possible, would be greately appreciated. Here are some details about my project, in case they contribute to my problem: I am trying to implement a network of 6 or so motes. Part of my algorithm includes having the five nodes turn their radios off periodically. While their radios are on, these five of the nodes must exchange messages with the sixth node, whose radio is always on. regards, tingting image001.jpg___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] send(), senddone() and receive()
Hi All, For some reason my motes are getting interrupted between AMSend.send() and AMSend.sendDone() by the Receive.receive() event. But to my understanding, after a *send() *and before a *senddone(), *the radio is in tx mode and should not go to rx mode in the middle to enable a receive, is that correct? Any quick suggestions, if possible, would be greately appreciated. Here are some details about my project, in case they contribute to my problem: I am trying to implement a network of 6 or so motes. Part of my algorithm includes having the five nodes turn their radios off periodically. While their radios are on, these five of the nodes must exchange messages with the sixth node, whose radio is always on. regards, tingting ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] send(), senddone() and receive()
On Nov 29, 2007, at 3:26 PM, Tingting Sun wrote: Hi All, For some reason my motes are getting interrupted between AMSend.send () and AMSend.sendDone() by the Receive.receive() event. But to my understanding, after a send() and before a senddone(), the radio is in tx mode and should not go to rx mode in the middle to enable a receive, is that correct? That is incorrect. What if the node delays sending because it is receiving a packet? Phil ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] Send -- SendDone
Hi All, For some reason my motes are having a hard time going to AMSend.sendDone() after calling the command AMSend.send(). This makes no sense because I think AMSend.sendDone() is called at the end of AMSend.send(). Do you think that this has anything to do with hardware unreliability or batteries that are running slightly low? Also, if it has to do with unreliability, how can I make sending/receiving packets more reliable? Any quick suggestions, if possible, would be appreciated. Here are some details about my project, in case they contribute to my problem: I am trying to implement a network of 6 or so motes. Part of my algorithm includes having the five nodes turn their radios off periodically. While their radios are on, these five of the nodes must exchange messages with the sixth node, whose radio is always on. Nicole ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Send -- SendDone
Make sure you are getting a SUCCESS from the send(), otherwise the message is not sent and no sendDone() is to be expected. As to reliability, you can use various kinds of ACKs. The choices depend on your platform, so google around a bit. I also did some brute force testing and a resend protocol on micas which you can see at: http://www.etantdonnes.com/Motes/report_micaz/ MS Nicole Caruso wrote: Hi All, For some reason my motes are having a hard time going to AMSend.sendDone() after calling the command AMSend.send(). This makes no sense because I think AMSend.sendDone() is called at the end of AMSend.send(). Do you think that this has anything to do with hardware unreliability or batteries that are running slightly low? Also, if it has to do with unreliability, how can I make sending/receiving packets more reliable? Any quick suggestions, if possible, would be appreciated. Here are some details about my project, in case they contribute to my problem: I am trying to implement a network of 6 or so motes. Part of my algorithm includes having the five nodes turn their radios off periodically. While their radios are on, these five of the nodes must exchange messages with the sixth node, whose radio is always on. Nicole ___ 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