[Tinyos-help] Can I use PacketAcknowledgments in TinyOS Testbed ? (It works well in Tossim, but doesn't work in Testbed).

Michael Schippling schip at santafe.edu
Sun Feb 3 16:36:58 PST 2008


ACKs worked on mica's under TOS1. One hopes they are not broken in T2.

You do need to turn them on in the base-station as well. And they will
only work for point-to-point messages since BCAST goes to everyone.
If you are sending to a base-station you need to use it's ID in the send().

MS


DAE HEE KIM wrote:
> Hi.
> 
> PacketAcknowledgements worked very well in Tossim. However, in motes. it 
> doesn't work.
> Do I have to change some other parameter in order to use 
> PacketAcknowledgement in motes ?
> 
> Following is my snippet that I added PacketAcknowledgements in 
> BlinkToRadio..
> 
>   /***************************
>    * Send Packet 
>    **************************/
>   // send data when timer expires
>   event void Timer0.fired()
>   {
>     counter++;
> 
>     if (!busy) {
> 
>       // create new packet
>       BlinkToRadioMsg *btrpkt = (BlinkToRadioMsg*)(call 
> Packet.getPayload(&pkt, NULL));
> 
>       // insert data into packet
>       btrpkt->nodeid  = TOS_NODE_ID;
>       btrpkt->counter = counter;
> 
>       // send packet (broadcast)
> 
>       call Acks.requestAck(&pkt);
>       if (call AMSend.send(AM_BROADCAST_ADDR, &pkt, 
> sizeof(BlinkToRadioMsg)) == SUCCESS) {
>         dbg("BlinkToRadioC","Send %d packet\n", counter);
>         busy = TRUE;
> 
>         // send success : Blink
>         call Leds.led0Toggle();
>       }
>     }
>   }
> 
>   // finish sending
>   event void AMSend.sendDone(message_t *msg, error_t error) {
>     if (&pkt == msg) {
>       if (call Acks.wasAcked(msg)) {
>         call Leds.led2Toggle();
>       }
>       else { 
>         call Leds.led1Toggle();    <-- led1 toggles which means not acked.
>       }
>       busy = FALSE;
>     }
>   }
> 
> Thanks in advance
> 
> 
> -- 
> DaeHee Kim (Danny)
> Department of Computer Science, State University of NewYork at Binghamton.
> Cell Phone : 1-607-321-9574
> Address : 13-A Andrea Dr, Vestal, NY, 13850
> email-address : dkim11 at binghamton.edu <mailto:dkim11 at binghamton.edu>, 
> dahkim77 at gmail.com <mailto:dahkim77 at gmail.com>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

-- 
Platform: WinXP/Cygwin
TinyOS version: 1.x, Boomerang
Programmer: MIB510
Device(s): Mica2, MicaZ, Tmote
Sensor board: homebrew



More information about the Tinyos-help mailing list