MS,
I thought you could do that. I was staring at code all week and my brain had
turned to mush.

-Ben

On Fri, June 29, 2007 1:16 pm, Michael Schippling said:
> I think the original problem is this:
>      RSSI=*((uint8_t *)recv_packet->strength);
> which is treating "strength" as a pointer and de-referencing it. What you
want is:
>      RSSI = recv_packet->strength;
> Then do all the arcana of converting to db which is covered in
> these other answers...
>
> As to the funny-ness with ADC get and ready, the underlying
> radio code calls the ADC0 get right after it receives a messsage. So you
probably overloaded their ready() with yours.
>
> MS
>
>
> Benjamin Madore wrote:
>> On Fri, June 29, 2007 11:43 am, Bernardo Avila Pires said:
>>> Wasn't the value in msg->strenght some untransformed one? I remember
having read that a function should be applied to it in order to obtain
RSSI.
>> Only if you want decibels or some other unit. The number given is the
internal measurement scale, plenty useful for direct comparison.
>>> 2007/6/29, Benjamin Madore <[EMAIL PROTECTED]>:
>>>> msg->strength is uint16_t
>>>> You're only getting half the number.
>>>> Besides,
>>>>     uint16_t * stren = (uint16_t *) msg->strength;
>>>>     RSSI = stren[0];
>>>> should be easier to read. I think there is an even more elegant way to
state
>>>> this, but I don't care enough to find it. Avoid doing multiple things
on
>>>> one
>>>> line until your sure all your bugs are gone. (I.E. Never do multiple
things
>>>> on one line.) Let the compiler optimize.
>>>> Your RSSI should be between 400 and 0. It is interpreted as a negative
number, with 400 being quiet, and 0 being very loud.
>>>> You can also wire to ADC.ADC[TOS_ADC_CC_RSSI_PORT] and call
>>>> "ADC.getData();"
>>>> which provides the event "ADC.dataReady(uint16_t data);" like you said.
dataReady is singled every time anyone calls getData. The radio stack
does
>>>> this a lot. You have to filter out your calls. I might suggest a lock.
When you call getData, set a boolean to true, and when you have read
one
>>>> value in dataReady, set it to false.
>>>> -Ben
>>>> On Fri, June 29, 2007 10:21 am, CASTEL Myriam said:
>>>>> Hello,
>>>>> I'm trying to obtain the RSSI value with Mica2 motes.
>>>>> -I programmed a component which stores the strength of a TOSMsg
>>>> received:
>>>>> RSSI=*((uint8_t *)recv_packet->strength);
>>>>> But this doesn't give reasonnable results. I think this method is only
for the micaz? Isn't it?
>>>>> - In the documentation, I saw that the RSSI was given by the channel 0
in mica2.
>>>>> I tried to sample channel 0 with in configuration file: MyApp.ADC->
ADCC.ADC[0];
>>>>> in module file:  event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr
recv_packet){
>>>>>       call ADC.getData();
>>>>>       return recv_packet;
>>>>>   }
>>>>> async event result_t ADC.dataReady(uint16_t data) {
>>>>>       atomic pack->xData.datap1.value = data;
>>>>>       post sendMsg();
>>>>>       return SUCCESS;
>>>>> }
>>>>> but the problem is that the mote execute ADC.dataReady even if getData
wasn't called. Maybe I have forgotten some elements as:
>>>>> call
ADC.Control.bindPort(TOS_ADC_CC_RSSI_PORT,TOS_ACTUAL_CC_RSSI_PORT)
>>>>> or other things.
>>>>> Can you help me to obtain RSSI value (with channel 0 or other)? If you
have the code to compute RSSI, can you send it to me?
>>>>> I'm sorry for this question but I'm new and I don't find the answers
in
>>>>> the documentation provided by Crossbow.
>>>>> Thanks
>>>> --
>>>> The difference between the right word and the almost right word is really
>>>> a
>>>> large matter- it's the difference between a lightning bug and the
lightning.
>>>> -Twain
>>>> _______________________________________________
>>>> Tinyos-help mailing list
>>>> Tinyos-help@Millennium.Berkeley.EDU
>>>> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>> --
>>> "The truth shall set you free"
>>> <a href="http://www.nerdtests.com/nq_ref.html";>
>>> <img src="http://www.nerdtests.com/images/badge/dc875a1ab1aff18f.gif";
alt="I am nerdier than 99% of all people. Are you a nerd? Click here to
find out!"></a>
>


-- 
The difference between the right word and the almost right word is really a
large matter- it's the difference between a lightning bug and the lightning.
-Twain




_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to