[Tinyos-help] Tough problems

Adam shiyuan69 at gmail.com
Fri Jul 7 10:25:55 PDT 2006


I am a TinyOS 1.1.15 user. I am recently testing on LQIMultihopRouter
program with SurgeTelos and find out several weired problem. In the test, I
used three telosb motes, and each one generate a TOS_Msg about 64bytes in
every 100ms and forward to a gateway.

(1)If I remove the "atomic" in task SendData, even if Send.send return
success, the "printfUART("MHOP_FWD_QUEUE is full: %i!\n",
pReading->numfree); " will still be excuted. After I added atomic, it works
okay. I can not think of any reason for this, since SendData is a task and
only here will call Multihop's Send.send.

  task void SendData() {
    SurgeMsg *pReading;
    uint16_t Len, i;
    dbg(DBG_USR1, "SurgeM: Sending sensor reading\n");
atomic {
    if ((pReading = (SurgeMsg *)call Send.getBuffer(&gMsgBuffer,&Len)) !=
NULL) {
      pReading->type = SURGE_TYPE_SENSORREADING;
      pReading->parentaddr = call RouteControl.getParent();
//      pReading->reading = gSensorData;
      for (i=0; i<SIZE_READING ; i++ )  pReading->reading[i] = testdata ++;

      pReading->seq_no = seqno++;
 
#ifdef MHOP_LEDS
      call Leds.redOn();
#endif
#ifdef DEBUG_SURGE
         pReading->numfree = call RouteControl.getOccupancy();
#endif
      if ((call Send.send(&gMsgBuffer,sizeof(SurgeMsg))) != SUCCESS)
	      atomic { gfSendBusy = FALSE;
#ifdef DEBUG_SURGE
        printfUART("MHOP_FWD_QUEUE is full: %i!\n", pReading->numfree);   
#endif
      }
    }
}
  }

(2) How many tasks can be posted at same time in TinyOS 1.x? Including same
task or different task. I am wondering
whether there is a limit. And, in what condition, will a task be posted
failed? I find some weired problems, really wan to know whether this is the
reason.

(3)
I am reading Harvard's volcano Multihop code, where they mention CC2420
sendDone could be called twice in certain condition, and "The affect of this
bug was to truncate the message length (the radio stack send completed
handling subtracts a number of bytes out of the TOS_MsgPtr->length field and
that was happening multiple times)." Has this problem been corrected in
updated TinyOS 1.x? This is terrible since I am implementing re-TX from
sendDone ans assume the msg's content does not change if send failed.





More information about the Tinyos-help mailing list