I have bought a Wifly shield for Arduino (http://www.sparkfun.com/products/9954). I want to read the strength of any Wifi signal in the area to control some LEDs, I noticed that the module incorporates a function called "show RSSI" as it says in the data sheet: http://www.sparkfun.com/datasheets/Wireless/WiFi/WiFlyGSX-um2.pdf.

I can't figure out how to successfully read a value for RSSI (signal strength). Would somebody be able to help me get started with this code?

Most recent library for Wifly: http://forum.sparkfun.com/viewtopic.php?f=32&t=25216.

My code is able now to write a series of commands to the WiFly shield in the following order:- $$$ (with no carrige return)(this command enters command mode)- set wlan ssid BTHub3-Q9Z8- set wlan phrase df2387da92- join BTHub3-Q9Z8- show rssi

It seams to bring back a number for the signal strength (RSSI) but it isn't very consistent and its very slow to respond when I move the shield relative to my wifi router. My code:

#include "WiFly.h" // We use this for the preinstantiated SpiSerial object.//#include "WiFlySerial.h"

Serial.begin(9600); Serial.println("SPI UART on WiFly Shield terminal tool"); Serial.println("--------------------------------------"); Serial.println(); Serial.println("This is a tool to help you troubleshoot problems with the WiFly shield."); Serial.println("For consistent results unplug & replug power to your Arduino and WiFly shield."); Serial.println("(Ensure the serial monitor is not open when you remove power.)"); Serial.println();

This code gives me a good predictable RSSI reading that dynamically updates when I move the shield relative to my router.

This code can be found here: http://forum.sparkfun.com/viewtopic.php?f=32&t=25129

And here:

/*

SpiUartTerminal - tool to help troubleshoot problems with WiFly shield

This code will initialize and test the SC16IS750 UART-SPI bridge then enable you to send commands to the WiFly module.

Copyright (c) 2010 SparkFun Electronics. http://sparkfun.com LGPL 3.0

*/

#include "WiFly.h" // We use this for the preinstantiated SpiSerial object.

void setup() {

Serial.begin(9600); Serial.println("SPI UART on WiFly Shield terminal tool"); Serial.println("--------------------------------------"); Serial.println(); Serial.println("This is a tool to help you troubleshoot problems with the WiFly shield."); Serial.println("For consistent results unplug & replug power to your Arduino and WiFly shield."); Serial.println("(Ensure the serial monitor is not open when you remove power.)"); Serial.println();

Serial.println(" * Use $$$ (with no line ending) to enter WiFly command mode. (\"CMD\")"); Serial.println(" * Then send each command followed by a carriage return."); Serial.println();

Serial.println("Waiting for input."); Serial.println();

}

void loop() { // Terminal routine

// Always display a response uninterrupted by typing // but note that this makes the terminal unresponsive // while a response is being received. while(SpiSerial.available() > 0) { Serial.print(SpiSerial.read(), BYTE); }