If I understand what you're doing correctly, then the problem may be in the book-keeping.  If the RF channel is in use and your mote tries to send, that send is going to fail, and you're never going to get a RadioCoordinator event (because there is no sending going on).  Therefore, your handler for the RadioCoordinator.send() (or whatever it's called) is not going to be called, and you won't update the timestamp that you're using to time the start of the send.

Another answer, in the case of a successful send but a long delay (~400ms) is that the radio stack is executing a MAC backoff, which adds significantly to the amount of time that it takes to finally get your message out the door.

        - Conor


On 8/3/06, patrick kuckertz <[EMAIL PROTECTED]> wrote:
Dear all,
 
I get an event and i want to send a message with the elapsed time since the event occured. I do it like this. I use the fast clock with prescaler 8 and start the clock in start().
If I get an interrupt (INT0) I use getlocaltime() and save it in event time. In the radiosendcoordianor I check cnt with msg.type. If this byte is send I use getloacal time and substarct the old value from the new one. Then i put the 32bit value into the message, which is being send.
 
The tosbase uses the counter,too. If radioreceivecoordinator cnt == msg.type I use getlocaltime to get the itme. If the reception is complete i substract the elapsed time in the message from the reception time and so i should have the time of the event, with the reference of the local time of the base station. (Failure propagation, clock skew... but should be very little)
 
Problem:
 
 
1. i use one mote and if i get the event i send the time of it. In senddone() i repost send.... So i send infinity messages to the pc.
If i do it like this you see the eventtime incrementing in microsecond... This should happen because of clock skew... So the eventtime is roughly 10us later with the 10.th message.
 
 
2. If i use two motes, which are triggered by the same interrupt i get a different of the time up to 300us.
It is clear that bots nodes can not send at the same time. However, the difference should not bee much higher then if the message is reposted in senddone of a single node.
What is going wrong?
Is the clock skew soo big? The difference value changes by every event from 1us difference up to 400us?
I think that the radiosendcoordiantor... is in mac layer. So if I use this:
 
if (byteCount == (offsetof(struct TOS_Msg,type) )  && msg2->type == 0xEE)
  {....}
 
the message is send. So the channel is free and everything. This should be done earlier and included in the time, which is substraced at the receiver side?
 
I use mica2 nodes.
 
Best Regards,
 
 
Patrick
 
 



Yahoo! Music Unlimited - Access over 1 million songs. Try it free.


_______________________________________________
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

Reply via email to