Hi, I am not familiar of using the UDP-based Shell as what you are using. But I can suggest you to use the built in java tools in T2 to watch the RSSI value. You can issue command, for example: $java net.tinyos.tools.Listen -comm serial@/dev/ttyUSB0:micaz to view the raw data at the computer screen using the serial connection to the Base station mote.
You may refer to the rssi demo available in the T2, which is at the /apps/tutorials/RssiDemo. You can test it on real micaz motes if you have them. The only code you can add is in the BaseStationP.nc component at the RadioIntercept.forward() and SerialIntercept.forward() events (this is the case if you want to bypass the RssiBase components). The additional code should read the message structure (RssiDemoMessages.h) you created and passed from the SendingMote application. The resulted raw data (negative hexa) viewed at the screen should then be translated to the equivalent decimal values that represents the RSSI values. Hope this helps. Yusnaidi ------------------------------ > > Message: 3 > Date: Mon, 24 May 2010 17:51:59 +0100 > From: TheMrOrange <[email protected]> > Subject: [Tinyos-help] gathering RSSI from CC2420 > To: [email protected] > Message-ID: <[email protected]> > Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes > > Hi. > We are in trouble trying to get RSSI from CC2420. We use the Intercept > interface provided by InterceptBase to intercept incoming packets and > perhaps we are not pointing to the RSSI field. We use the UDP-based > Shell to display RSSI and other parameters. > Here is the code we are using: > > uint16_t datarssi; > > // this should intercept packets > > event bool RssiMsgIntercept.forward(message_t *msg, void *payload, > uint8_t len) { > datarssi = getRssi(msg); > return TRUE; > } > > // this should get the RSSI > > uint16_t getRssi(message_t *msg){ > return (uint16_t) call CC2420Packet.getRssi(msg); > } > > // and this should print it in a UDP-based Shell: > > event char *ShellRSSI.eval(int argc, char **argv) { > char *ret = call ShellRSSI.getBuffer(15); > snprintf(ret, 50, "%i\n", datarssi); > return ret; > } > > We do not get errors while compiling but RSSI reported is "0". It > seems that getRssi(msg) has never been executed. Can you see any error > in our code? > > The Shell is working fine: > ie. Initializing datarssi = 14 it prints 14 correctly. > > > Thanks in advance > > Davide > > > ------------------------------ > >
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
