Bai Li,
maybe your code is correct and it is functioning well.
If you read RSSI, you will see that receiving power decreases as Tx
power decreases.
I tested Mica2 communications in different distances, and I measured
RSSI. When the nodes were 15 meters distant, the receiving power was -60dBm;
when the nodes were 5 meters distant, the receiving power was -50dBm; when the
nodes were 2.5 meters distant, the receiving power was -45dBm. This
expreriment was conducted with 0dBm Tx power.
Mica2 radios (CC1000) are sensitive to -100dBm receiving power. Then,
if you are using the distance of 5 meters between sensor nodes they will
communicate even if you set minimal Tx power (-20 dBm for CC1000; -25dBm for
CC2420).
You can take the numbers for CC1000 (Mica2):
* distance = 5 meters, 0dBm Tx power ----> Rx power = -50 dBm.
* distance = 5 meters, -20dBm Tx power ----> Rx power = -70 dBm.
* distance = 5 meters, -50dBm Tx power ----> Rx power = -100dBm.
The numbers for CC2420 is almost the same.
Conclusion: your nodes will communicate for distances of 5 meters even
if you set minimal Tx power. The tables of CC1000 and CC2420 do not specify
which power corresponds to PAPOW = 1 (or PA_Level = 1); but it is probably
greater than -50dBm. Then, if you put your radios separated by 5 meters, they
will be able to communicate without problems.
How to get RSSI ? This value is put in the received message. You can
see the messge structure in AM.h.
I have used TinyOS-1 and I have developed a Block to control Tx power.
I can send it to you later.
*****************
João Giacomin
Prof-DCC-UFLA
*****************
---------- Original Message -----------
From: Urs Hunkeler <[email protected]>
To: BAI LI <[email protected]>
Cc: [email protected]
Sent: Wed, 17 Dec 2008 07:46:54 +0100
Subject: Re: [Tinyos-help] where to set the power level?
> Hi,
>
> A typical Makefile in TinyOS 2.x that I use looks something like this:
>
> --------------------
>
> COMPONENT = MyDemoAppC
> CFLAGS += "-DCC2420_DEF_RFPOWER=1"
> #CFLAGS += "-DCC2420_DEF_CHANNEL=18"
> #CFLAGS += "-DTOSH_DATA_LENGTH=64"
>
> include $(MAKERULES)
>
> --------------------
>
> There is no need for any modifications in the code (if I remember
> correctly, the TX power level was set in multiple places). Defining
> the power level in the CFLAGS (as in the example above) will have
> precedence over the values that would otherwise be set in the TinyOS code.
>
> You can also set the TX power level on a per-packet basis with code
> similar to this (right before sending the packet):
>
> --------------------
>
> call CC2420Packet.setPower(&packet, pwr);
>
> --------------------
>
> &packet is a reference to the radio packet you want to transmit
>
> (message_t), pwr is the power level you want the packet to be sent with
> (e.g. 3) and CC2420Packet is an interface available from the component
> CC2420PacketC.
>
> I don't know whether there is a difference in the output power between
> 1 and 3, but a value of 1 definitely works to reduce the power in my
> setup
> (with telosb with the internal antenna I get a max tx distance of
> about 3m).
>
> If this still does not work for you, do you have modified hardware
> (e.g. external antenna)? Do you at least observe a difference in the
> TX range
> (e.g. 20m instead of 50m)?
>
> Cheers,
> Urs
>
> BAI LI wrote:
> > I just tested it. Same here. Not working. Thanks for your help anyway. Any
> > other ideas?
> >
> > Cheers,
> > Bai
> >
> > On Wed, Dec 17, 2008 at 12:59 PM, Hui Kang <[email protected]> wrote:
> >
> >> Add this line to your makefile and remove those macro.
> >> CFLAGS=-DCC2420_DEF_RFPOWER=3
> >>
> >>
> >> - Hui
> >>
> >> BAI LI wrote:
> >>
> >>> I read the cc2420 datasheet and modified it but unluckily it still didn't
> >>> work. I modified the following code repectivcely.
> >>> #ifndef CC2420_DEF_RFPOWER
> >>> #define CC2420_DEF_RFPOWER 0x1F // changed the 0x1F to 3 or
1,
> >>> didn't work.
> >>> #endif
> >>> cheers,
> >>> Bai
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
------- End of Original Message -------
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help