Hi folks,

  I find that on Tmotes (tinyos 1.x - latest CVS files for CC2420RadioM.nc and CC2420RadioC.nc)
  there is significant packet loss (while sending) under the following conditions :

  a) There is only one mote on the channel
  b) Multiple packets are sent one after the other.
  c) The packets are sent by posting a task in the send.SendDone of
     the previous packet.The posted task calls Send.send.
  d) The Radio does not return FAIL in the Send.sendDone

  The packet loss rate increases with size of the packets.

   I changed CntToRfm(Counter.nc ) to send 3 packets in a manner described above.
   I also  hacked IntToRfmM.nc to send a packet of size 44 (including TOS header) - with dummy bytes
   and changed the TOSH_DATA_LENGTH to 60.

 
  I wonder if this is a bug in the CC2420 radio library.
  Adding a delay after Send.sendDone seems to reduce the packet loss.

  I think this is not a problem with TOSBase missing packets - because when
  I changed CntToRfm to send a packet every 20 ms, TOSBase still did not seem to
  be losing any packets.


  Here is the TOSBase log:
 
  SAPP: 1E 01 08 30 FF FF FF FF 04 7D 30 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 31 FF FF FF FF 04 7D 31 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 32 FF FF FF FF 04 7D 32 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 33 FF FF FF FF 04 7D 33 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 35 FF FF FF FF 04 7D 35 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 37 FF FF FF FF 04 7D 37 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 39 FF FF FF FF 04 7D 39 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 3B FF FF FF FF 04 7D 3B 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 3D FF FF FF FF 04 7D 3D 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 3F FF FF FF FF 04 7D 3F 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 40 FF FF FF FF 04 7D 40 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 41 FF FF FF FF 04 7D 41 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 42 FF FF FF FF 04 7D 42 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 44 FF FF FF FF 04 7D 44 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 45 FF FF FF FF 04 7D 45 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 46 FF FF FF FF 04 7D 46 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 47 FF FF FF FF 04 7D 47 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 48 FF FF FF FF 04 7D 48 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SAPP: 1E 01 08 49 FF FF FF FF 04 7D 49 07 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

 The code for Counter.nc :

 module Counter {
  provides {
    interface StdControl;
  }
  uses {
    interface Timer;
    interface IntOutput;
  }
}
implementation {
  int state;
  uint8_t num;
  command result_t StdControl.init()
  {
    state = 1;
    atomic num = 0;
    return SUCCESS;
  }

  command result_t StdControl.start()
  {
    return call Timer.start (TIMER_REPEAT, 1000);
  }

  command result_t StdControl.stop()
  {
    return call Timer.stop();
  }
  task void intOutput()
  {
      if (call IntOutput.output(state))
      state++;
  }
      
 
  event result_t Timer.fired()
  {
    post intOutput();
#if 0   
    if (call IntOutput.output(state))
      state++;
      dbg(DBG_TEMP|DBG_USR1, "Counter: Value is %i\n", (int)state);
#endif
    return SUCCESS;
  }

  event result_t IntOutput.outputComplete(result_t success)
  {
    uint8_t temp;
    if(success == 0) state --;
    
    atomic temp = num;
    if (temp < 3)
    {
        post intOutput();
        atomic num++;
    }
    else
    {
        atomic num = 0;
    }
    return SUCCESS;
  }
}


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

Reply via email to