Hi,

I'm trying to send a msg from one mote to another. Mote A has a msg in a buffer that will send to mote B. Everything works , except in one situation where mote A sends to mote B, but the msg doesn't get there and consequently no ack, then in sendDone i repost the task of the msg.

The weird thing is that when i repost the task, the addr should be B, but for some weird reason the var addr in the repost becomes mote A addr and enters an infinite loop.

I haven't tested this in real motes, only in tossim, here's a part of the simulation:

/*.................................*/
DEBUG (4): Reading Sensors for App with id = 1, and sample time = 20
DEBUG (4): Reading of Sensor Temperature is 5221 @ 0:0:20.484296889
DEBUG (4): Reading of Sensor Humity is 7542 @ 0:0:20.484296889
DEBUG (4): Added Alarm Entry
DEBUG (4): Yellow Alarm Fired!! - Sending
DEBUG (4): Sending to Neighbor that has the best RSSI = 1
DEBUG (4): RequestAck SUCCESS
DEBUG (4): Send Yellow Msg SUCCESS
DEBUG (4): DefCon Yellow for App with id = 1 @ 0:0:20.484296889
.....
DEBUG (1): Received a Yellow Alarm from 4,need to respond.
DEBUG (1): source 4
DEBUG (1): Sending to 4
DEBUG (4): Ack for yellow msg received
DEBUG (1): Ack for yellow rsp msg not received
.....
DEBUG (1): source 1
DEBUG (1): Sending to 1
DEBUG (1): Ack for yellow rsp msg not received
DEBUG (1): source 1
DEBUG (1): Sending to 1
DEBUG (1): Ack for yellow rsp msg not received
DEBUG (1): source 1
DEBUG (1): Sending to 1
DEBUG (1): Ack for yellow rsp msg not received
(loop)

/* ................... */

Here is a part of the code where i send the msg:

/*BEGIN*/
Task void send() {
yellowMsg_t* yellowmsg = (yellowMsg_t*) (call RadioPacket.getPayload(AlarmQueue[alarmOut], NULL));
.....
busy = TRUE;
yrsp_send = TRUE;
msg = AlarmQueue[alarmOut];
len = call RadioPacket.payloadLength(msg);
source = call RadioAMPacket.source(msg);

yellowmsg->id = YELLOW_RSP;
if (call Sensors.getDefCon(yellowmsg->id,yellowmsg->sensor) != NOT_FOUND)
   yellowmsg->alarmType = CONFIRMED;
else
   yellowmsg->alarmType = NOT_CONFIRMED;

if (call PacketAck.requestAck(AlarmQueue[alarmOut]) != SUCCESS){
        dbg("DTest","requestAck != SUCCESS\n");
       call PacketAck.requestAck(AlarmQueue[alarmOut]);
}

if (call AlarmModeSend.send(source, AlarmQueue[alarmOut], len) != SUCCESS) {
    call AlarmModeSend.send(source, AlarmQueue[alarmOut], len)
}
}

/* END */

I hope i could express myself well. Anyone had the same problem or similar?
I'm using T2.

Thanks,
Ricardo

_________________________________________________________________
MSN Busca: fácil, rápido, direto ao ponto.  http://search.msn.com.br

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

Reply via email to