Re: [Tinyos-help] RF230 readinf ED instead of RSSI

2008-06-13 Thread Miklos Maroti
Hi Stefano,

> I'm using the CVS version of tinyos-2.x, and I'm trying to read the ED
> value instead RSSI. I used the RssiDemo tutorial as code base and I
> slightly modified it to make it work with the Iris platform. The
> RssiDemo perfectly works if I read the RSSI value from the RF230, but
> as soon as I recompile it to read the ED value from the RF230 I always
> get 0 (zero) as ED value. Do you have any tips? Have anyone used the
> ED reading with Iris successfully?

I have not played with it. One problem could be that the ED is not yet
ready when we read it. There are two reasons why:

1) The required 140 microsec did not pass, but I think this is not the case

2) The ED is an averaged RSSI value calculated from 8 symbols. Maybe
we read this value too close to the beginning of the start message and
we measure mostly the "silence" before the transmission. I will looki
at the code.

> Also have looked at the /opt/tinyos-2.x/tos/chips/rf230/RF230LayerP.nc
> file and I have simple question, the code:
>
>if( irq == RF230_IRQ_RX_START )
>{
>temp = 
> readRegister(RF230_PHY_RSSI) & RF230_RSSI_MASK;
>
>rssiBusy += temp - (rssiBusy 
> >> 2);
>
> #ifdef RF230_RSSI_ENERGY
>temp = 
> readRegister(RF230_PHY_ED_LEVEL);
> #endif
>
>call PacketRSSI.set(rxMsg, 
> temp);
>}
>
> should not be rewritten in the following way?
>
>if( irq == RF230_IRQ_RX_START )
>{
> #ifdef RF230_RSSI_ENERGY
>temp = 
> readRegister(RF230_PHY_ED_LEVEL);
> #else
>temp = 
> readRegister(RF230_PHY_RSSI) & RF230_RSSI_MASK;
>
>rssiBusy += temp - (rssiBusy 
> >> 2);
> #endif
>
>call PacketRSSI.set(rxMsg, 
> temp);
>}
>

Absolutely not. You WANT to update the rssiBusy values (which ALWAYS
use the RSSI and not the ED for checking the busy channel. So that
part of the code is OK.

Miklos
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] RF230 readinf ED instead of RSSI

2008-06-13 Thread Miklos Maroti
Hi Stefano,

Did you check if PacketRSSI.isValid() returns TRUE? In some cases I
cannot guarantee that the returned ED value is correct.

> 1) The required 140 microsec did not pass, but I think this is not the case

After looking at the code it might be possible (although very
unlikely) that we handle the IRQ, read the status register in 140
microsec. I have moved the reading of the PHY_ED_LEVEL to the end of
the reception in the attached file. Please replace your copy of
RF230LayerP.nc with this one ang give it a try and let us know.

> 2) The ED is an averaged RSSI value calculated from 8 symbols. Maybe
> we read this value too close to the beginning of the start message and
> we measure mostly the "silence" before the transmission. I will looki
> at the code.

Value 0 means below -91 dBm, so probably that value is not a correctly
measured value, so ED measurement did not finish or was not performed.

Miklos


RF230LayerP2.nc
Description: Cdf file
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] RF230 readinf ED instead of RSSI

2008-06-16 Thread Stefano "Kismet" Lenzi
On Fri, Jun 13, 2008 at 22:58, Miklos Maroti <[EMAIL PROTECTED]> wrote:
> Hi Stefano,
>
> Did you check if PacketRSSI.isValid() returns TRUE? In some cases I
> cannot guarantee that the returned ED value is correct.

I have just looked at the code and  I check PacketRSSI.isSet(),
instead of PacketRSSI.isValid(), but I think that you meant isSet(),
don't you?

>
>> 1) The required 140 microsec did not pass, but I think this is not the case
>
> After looking at the code it might be possible (although very
> unlikely) that we handle the IRQ, read the status register in 140
> microsec. I have moved the reading of the PHY_ED_LEVEL to the end of
> the reception in the attached file. Please replace your copy of
> RF230LayerP.nc with this one ang give it a try and let us know.

Probably I will have a chance to test the code today.

>
>> 2) The ED is an averaged RSSI value calculated from 8 symbols. Maybe
>> we read this value too close to the beginning of the start message and
>> we measure mostly the "silence" before the transmission. I will looki
>> at the code.
>
> Value 0 means below -91 dBm, so probably that value is not a correctly
> measured value, so ED measurement did not finish or was not performed.

I agree with your statement but, I check the PacketRSSI.isSet() so if
your patch works mean that isSet() does not return the right value all
the time.

>
> Miklos
>

Stefano Lenzi
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] RF230 readinf ED instead of RSSI

2008-06-16 Thread Stefano "Kismet" Lenzi
On Mon, Jun 16, 2008 at 08:56, Stefano Kismet Lenzi <[EMAIL PROTECTED]> wrote:
> On Fri, Jun 13, 2008 at 22:58, Miklos Maroti <[EMAIL PROTECTED]> wrote:
>> Hi Stefano,
>>
>> Did you check if PacketRSSI.isValid() returns TRUE? In some cases I
>> cannot guarantee that the returned ED value is correct.
>
> I have just looked at the code and  I check PacketRSSI.isSet(),
> instead of PacketRSSI.isValid(), but I think that you meant isSet(),
> don't you?
>
>>
>>> 1) The required 140 microsec did not pass, but I think this is not the case
>>
>> After looking at the code it might be possible (although very
>> unlikely) that we handle the IRQ, read the status register in 140
>> microsec. I have moved the reading of the PHY_ED_LEVEL to the end of
>> the reception in the attached file. Please replace your copy of
>> RF230LayerP.nc with this one ang give it a try and let us know.
>
> Probably I will have a chance to test the code today.

I have tested the RSSIDemo with the patch that you have sent me and it works :)

Ciao,
Stefano "Kismet" Lenzi
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] RF230 readinf ED instead of RSSI

2008-06-16 Thread Miklos Maroti
 1) The required 140 microsec did not pass, but I think this is not the case
>>>
>>> After looking at the code it might be possible (although very
>>> unlikely) that we handle the IRQ, read the status register in 140
>>> microsec. I have moved the reading of the PHY_ED_LEVEL to the end of
>>> the reception in the attached file. Please replace your copy of
>>> RF230LayerP.nc with this one ang give it a try and let us know.
>>
>> Probably I will have a chance to test the code today.
>
> I have tested the RSSIDemo with the patch that you have sent me and it works 
> :)

Ok, the updated version is checked in, so you can use the CVS version
now. This prives that we did handle the IRQ and managed to read two
RF230 registers in less than 140 microsecond, and that is why the
PHY_ED_LEVEL value was not yet calculated.

Best,
Miklos
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] RF230 readinf ED instead of RSSI

2008-06-18 Thread Andrey Gursky
Hi!

>> I have tested the RSSIDemo with the patch that you have sent me and it works 
>> :)

> Ok, the updated version is checked in, so you can use the CVS version
> now. This prives that we did handle the IRQ and managed to read two
> RF230 registers in less than 140 microsecond, and that is why the
> PHY_ED_LEVEL value was not yet calculated.

I've checked out the CVS tinyos-2.x on June, 17. But RssiDemo (from tutorials 
folder) still doesn't support IRIS platform (RF230). Is there any other CVS?

Andrey


P.S. Sorry, if my answers are still being posted as new thread. I click on 
answer/answer all button in the web interface of my mail server, and I'm not 
changing the topic, but something goes wrong :( Maybe any advices?
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] RF230 readinf ED instead of RSSI

2008-06-18 Thread Stefano "Kismet" Lenzi
I have attached the patch file produced with the command cvs diff from
the /opt/tinyos-2.x/apps/tutorials/RssiDemo/RssiBase directory

I think that makefile should be modified in order to have  it add the
RF230_RSSI_ENERGY define only if building the user is building the
application for the Iris platform.

Ciao,
Stefano "Kismet" Lenzi

On Wed, Jun 18, 2008 at 13:53, Miklos Maroti <[EMAIL PROTECTED]> wrote:
> Stefano,
>
> Could you please check in your modifications to support the IRIS
> platform too? If I recall correctly, you have them. If you want to, I
> can review your patch, just send me what did you modify.
>
> Miklos
>
> -- Forwarded message --
> From: Andrey Gursky <[EMAIL PROTECTED]>
> Date: Wed, Jun 18, 2008 at 1:20 PM
> Subject: Re: [Tinyos-help] RF230 readinf ED instead of RSSI
> To: "\"TinyOS Help Mailing-List\"" 
>
>
> Hi!
>
>>> I have tested the RSSIDemo with the patch that you have sent me and it 
>>> works :)
>
>> Ok, the updated version is checked in, so you can use the CVS version
>> now. This prives that we did handle the IRQ and managed to read two
>> RF230 registers in less than 140 microsecond, and that is why the
>> PHY_ED_LEVEL value was not yet calculated.
>
> I've checked out the CVS tinyos-2.x on June, 17. But RssiDemo (from
> tutorials folder) still doesn't support IRIS platform (RF230). Is
> there any other CVS?
>
> Andrey
>
>
> P.S. Sorry, if my answers are still being posted as new thread. I
> click on answer/answer all button in the web interface of my mail
> server, and I'm not changing the topic, but something goes wrong :(
> Maybe any advices?
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
Index: Makefile
===
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tutorials/RssiDemo/RssiBase/Makefile,v
retrieving revision 1.1
diff -r1.1 Makefile
7a8,9
> PFLAGS += -DRF230_RSSI_ENERGY
> 
Index: RssiBaseAppC.nc
===
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tutorials/RssiDemo/RssiBase/RssiBaseAppC.nc,v
retrieving revision 1.1
diff -r1.1 RssiBaseAppC.nc
46a47,49
> #elif  defined(PLATFORM_IRIS)
>   components  RF230ActiveMessageC;
>   App -> RF230ActiveMessageC.PacketRSSI;
Index: RssiBaseC.nc
===
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tutorials/RssiDemo/RssiBase/RssiBaseC.nc,v
retrieving revision 1.1
diff -r1.1 RssiBaseC.nc
43a44,45
> #elif defined(PLATFORM_IRIS)
>   uses interface PacketField as PacketRSSI;
66a69,76
> #elif defined(PLATFORM_IRIS)
>   uint16_t getRssi(message_t *msg){
> 
> if(call PacketRSSI.isSet(msg))
>   return (uint16_t) call PacketRSSI.get(msg);
> else
>   return 0x;
>   }

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] RF230 readinf ED instead of RSSI

2008-06-19 Thread Stefano "Kismet" Lenzi
On Thu, Jun 19, 2008 at 12:02, Andrey Gursky <[EMAIL PROTECTED]> wrote:
> Thanks Stefano!
>
> It works. The values are: 0..30 (HEX) 0..48 (DEC). Have you got maybe bigger 
> values for IRIS if two motes are very close to each other than 30 (HEX)?

In my case the I have measured value from 3 to 71, but I have
performed a very simple test.

>
> Andrey
>
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help