if all you want in background noise measure then u can write a simple
program that used interface Read<uint16_t>
here is the implementation part of the code i have. it measures background
noise every 500ms and prints it.
implementation
{
event void Boot.booted(){
call SplitControl.start();
call Timer.startPeriodic(500);
}
event void SplitControl.startDone(error_t err){
if(err!=SUCCESS){
call SplitControl.start();
}
}
event void SplitControl.stopDone(error_t err)
{ }
event void Timer.fired(){
if(call ReadRssi.read()==FAIL){
call ReadRssi.read();
}
}
event void ReadRssi.readDone(error_t result, uint16_t val){
int8_t noise_val=(int8_t)(((val-0x7F)&0xFF)-45);
count++;
printf("%d\n",noise_val);
printfflush();
}
}
> Hello folks,
>
> I'm using tinyos 2.1 and trying to get the rssi noise floor reading with
> telosb mote. In apps/tests/cc2420 there's an app called RssiToSerial
> which
> does exactly what I want. But when I do "make telosb", it has following
> error:
>
> xiaowei@ubuntu:/opt/tinyos-2.1.0/apps/tests/cc2420/RssiToSerial$ make
> telosb
> mkdir -p build/telosb
> compiling RssiToSerialC to a telosb binary
> ncc -o build/telosb/main.exe -Os -O -mdisable-hwmul -fnesc-separator=__
> -Wall -Wshadow -Wnesc-all -target=telosb -fnesc-cfile=build/telosb/app.c
> -board= -DDEFINED_TOS_AM_GROUP=0x22 -DIDENT_APPNAME=\"RssiToSerialC\"
> -DIDENT_USERNAME=\"xiaowei\" -DIDENT_HOSTNAME=\"ubuntu\"
> -DIDENT_USERHASH=0x62d326b9L -DIDENT_TIMESTAMP=0x4eb772e4L
> -DIDENT_UIDHASH=0x90025cb8L RssiToSerialC.nc -lm
> In file included from RssiToSerialP.nc:57,
> from RssiToSerialC.nc:51:
> In interface `CC2420Config':
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/interfaces/CC2420Config.nc:64:
> only commands and events can be defined in interfaces
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/interfaces/CC2420Config.nc:64:
> warning: return-type defaults to `int'
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/interfaces/CC2420Config.nc:64:
> syntax error before `getExtAddr'
> In file included from
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/control/CC2420ControlC.nc:53,
> from
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/csma/CC2420CsmaC.nc:58,
> from
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/CC2420RadioC.nc:63,
> from
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/CC2420ActiveMessageC.nc:75,
> from
> /home/xiaowei/Desktop/tinyos/tos/platforms/telosa/ActiveMessageC.nc:76,
> from RssiToSerialC.nc:54:
> In component `CC2420ControlP':
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/control/CC2420ControlP.nc:290:
> `getExtAddr' is not in interface `CC2420Config'
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/control/CC2420ControlP.nc:82:
> `CC2420Config.ieee_eui64_t' not implemented
> In file included from
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/receive/CC2420ReceiveC.nc:50,
> from
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/transmit/CC2420TransmitC.nc:94,
> from
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/csma/CC2420CsmaC.nc:62,
> from
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/CC2420RadioC.nc:63,
> from
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/CC2420ActiveMessageC.nc:75,
> from
> /home/xiaowei/Desktop/tinyos/tos/platforms/telosa/ActiveMessageC.nc:76,
> from RssiToSerialC.nc:54:
> In component `CC2420ReceiveP':
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/receive/CC2420ReceiveP.nc:
> In
> function `passesAddressCheck':
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/receive/CC2420ReceiveP.nc:837:
> interface has no command or event named `getExtAddr'
> /home/xiaowei/Desktop/tinyos/tos/chips/cc2420/lpl/DummyLplC.nc:39:2:
> warning: #warning "*** LOW POWER COMMUNICATIONS DISABLED ***"
> make: *** [exe0] Error 1
>
> Anyone has any idea with this?
>
> I also tried the app RssiBase in app/tutorial/RssiDemo, it says that "to
> perform RSSI noise floor reading on platforms with the CC2420 radio, the
> HAL component CC2420ControlP should be used". This component is used in
> RssiToSerial, I tried to use it the same way here in RssiBase, but could
> make it work. Any suggestions on this please?
>
>
> Thanks in advance!
> Sean
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help