[Tinyos-help] CCA Threshold

Philip Levis pal at cs.stanford.edu
Thu Aug 9 09:11:14 PDT 2007


On Aug 2, 2007, at 6:39 AM, Mathieu DAVID wrote:

> Hi,
> We wanted to know about the procedure to change the *CCA threshold*  
> using tinyOS.
> We are trying to simulate the scenario from the tutorials in  
> chapter 11. However, the nodes were established, but we could not  
> see the packets received. We attribute this to the default value of  
> CCA if -110dbm. Is this correct?
> And if so, how does one alter the CCA threshold to facilitate  
> packet transfer?
>
> We are actually facing the problem described in the tutorial with  
> this output:
>
> 1 2 -54.0
> 2 1 -55.0
> 1 3 -60.0
> 3 1 -60.0
> 2 3 -64.0
> 3 2 -64.0
> DEBUG (1): Application booted.
> DEBUG (1): Application booted again.
> DEBUG (1): Application booted a third time.
> DEBUG (2): Application booted.
> DEBUG (2): Application booted again.
> DEBUG (2): Application booted a third time.
> DEBUG (3): Application booted.
> DEBUG (3): Application booted again.
> DEBUG (3): Application booted a third time.
> DEBUG (1): RadioCountToLedsC: timer fired, counter is 1.
> DEBUG (1): RadioCountToLedsC: packet sent.
> DEBUG (2): RadioCountToLedsC: timer fired, counter is 1.
> DEBUG (2): RadioCountToLedsC: packet sent.
> DEBUG (3): RadioCountToLedsC: timer fired, counter is 1.
> DEBUG (3): RadioCountToLedsC: packet sent.
> DEBUG (1): RadioCountToLedsC: timer fired, counter is 2.
> DEBUG (2): RadioCountToLedsC: timer fired, counter is 2.
> DEBUG (3): RadioCountToLedsC: timer fired, counter is 2.
>
> In the tutorial, some commands are given to modify the parameters  
> of the radio channel :
>
> />>> from TOSSIM import *
>>>> t = Tossim([])
>>>> r = t.radio()
>>>> dir(r)
> ['__class__', '__del__', '__delattr__', '__dict__', '__doc__',
> '__getattr__', '__getattribute__', '__hash__', '__init__',
> '__module__', '__new__', '__reduce__', '__reduce_ex__',
> '__repr__', '__setattr__', '__str__', '__swig_getmethods__',
> '__swig_setmethods__', '__weakref__', 'add', 'connected',
> 'gain', 'remove', 'setNoise', 'this', 'thisown',
> ]
>        /
>
> /The first set of methods (with the double underscores) are ones  
> that you usually don't call. The important ones are at the end.  
> They are:/
>
>    * /*|add(src, dest, gain)|*: Add a link from //src to //dest with
>      //gain. When //src transmits, //dest will receive a packet
>      attenuated by the //gain value. /
>    * /*|connected(src, dest)|*: Return whether there is a link from
>      //src to //dest. /
>    * /*|gain(src, dest)|*: Return the gain value of the link from // 
> src
>      to //dest. /
>    * /*|threshold()|*: Return the CCA threshold. /
>    * /*|setThreshold(val)|*: Set the CCA threshold value in dBm. The
>      default is -72dbM./
>
>
> *But the fact is, None of the two last command exists !! *How can  
> we solve this issue??

What version are you referring to? For 2.0.1 and 2.0.2, it looks like  
the tutorial is out of sync with the code. I removed those two calls  
because the CCA threshold is often something the node itself can  
adjust. A node can current adjust it by calling  
GainRadioModel.setClearValue(). Note that this call is simulator  
specific. The hope was that future radio models might incorporate  
chip-specific interfaces (e.g., setting the CCA with a CC2420 control  
interface) and map them to this underlying call.

Phil




More information about the Tinyos-help mailing list