I get one sensible return from a call to WiFi.RSSI() and all subsequent calls return error code 2 when I compile with the IDE and firmware version 0.49.
Recompiling with firmware version 0.47 works fine for at least 20 calls. My Photon also seems OK.
I have written some minimal code that demonstrates the problem - it uses no other functions and just reports the RSSI value by blinking the built in LED.
int Nflash;
void setup()
{
pinMode(D7, OUTPUT);
}
void loop()
{
Nflash = -(WiFi.RSSI());
if (Nflash < 0){
digitalWrite(D7,HIGH); // do a long flash for errors
delay(900);
digitalWrite(D7,LOW);
delay(100);
}
else{
for (int i=0; i<Nflash / 10;i++){
digitalWrite(D7, HIGH); // do a long blink for each 10dB
delay(400);
digitalWrite(D7, LOW);
delay(100);
}
for (int i=0; i<Nflash % 10;i++){
digitalWrite(D7, HIGH); // do a short blink for each unit of dB
delay(100);
digitalWrite(D7, LOW);
delay(400);
}
}
delay(10000);
}
postscript: firmware v4.7 also gives the error code after several minutes (about 60 calls to RSSI()), but if I remove the antenna so that the Core flashes green, on reconnection the RSSI() gives sensible answers again for a short while.
I have reflashed the CC3000 using the usb/cli and used a different Core but I get the same result.
@mdma, I have the RSSI going out to a Digole display, refreshed once a second and I never get any value besides 2. On a Photon, the same code shows -55 (ish).
Thanks for your attention @mdma. How mysterious. I have tried the code with a Serial.print and printed WiFi.ready(), SSID(), and RSSI(). With the Serial.print() there is no obvious difference between the behaviour of the firmware versions. Both give a valid RSSI, though not always for long. Once I get the error code it stays until I lose WiFi connectivity (green flashing). On regaining the WiFi connection I get a few more valid RSSI values before the error state is re-entered.
I went back to my LED only code and added a check for WiFi.ready(). It reports true regardless of RSSI error 2 and as with my initial example 0.49 always returns the error straight away while 0.47 gives me several sensible RSSI values before reporting the error.
Here is the output of my Serial.print() code (headings and comments added afterwards).
Ready? SSID RSSI
--------------------------------
Ready OneRoof -78 //startup
Ready OneRoof -78
Ready OneRoof -78
Ready OneRoof -78
Ready OneRoof -78
Ready OneRoof -78
Ready OneRoof 2 //error state
Ready OneRoof 2 //lasts a long time
Ready OneRoof 2
Ready OneRoof 2
Not Ready 0 //WiFi briefly switched off at router (green flashing)
Not Ready 0 //error code 0 as expected from the documentation
Not Ready 0
Not Ready 0
Not Ready 0
Not Ready 0
Not Ready 0
Not Ready 0
Not Ready 0
Not Ready 0
Not Ready 0
Not Ready 0
Ready -73 //WiFi connection reacquired
Ready OneRoof -73
Ready OneRoof -73
...
...
...
Ready OneRoof 2
Ready OneRoof 2
Ready OneRoof 2
and my code to generate this:
//Read WiFi signal and output to serial
int sig;
String SSID;
void setup() {
pinMode(D7, OUTPUT);
Serial.begin(9600);
}
void loop() {
digitalWrite(D7,HIGH);
delay(500);
if (WiFi.ready()) Serial.print("Ready \t");
else Serial.print("Not Ready \t");
SSID = WiFi.SSID();
Serial.print(SSID);
Serial.print('\t');
sig = WiFi.RSSI();
Serial.println(sig);
digitalWrite(D7,LOW);
delay(1500); //2 secs per loop
}
Can you try upgrading to 1.14 of the cc3000 driver to see if that helps.
particle flash --usb cc3000_1_14
If that does’t help there not much I can do about this since any failure is happening within the cc3000. You might try turning wifi off and then on again after detecting the RSSI value 2.
I’ve upgraded the cc3000. Sadly no joy. It is strange that you don’t get the error.
But Hey! I have been connecting through my Huawei HG533 wireless modem.
I have just registered the Core with my range extender, a Netgear EX6200 and it looks as though the problem is solved. Both the Serial and flashing LED versions behave themselves. So for once the cc3000 isn’t to blame.
The signal from the extender is 10dB weaker than from the wireless modem (-75 vs -65dB) so it isn’t signal strength. Maybe a timing/latency thing?
@peekay123 have you tried a different access point?
I’m having the same issue with my Cores. In my testing it seems to work for about 1sec, I can make several calls before then but afterwards it always returns 2. The RSSI when it works is roughly -41, so it’s not a signal strength issue. Since switching back to 0.4.7 I haven’t seen a 2 yet.
my 2 cents. This graph is 30 days of data from a Core that reports RSSI every 10 minutes and is less than two meters away from the access point. Gives you a good indication of how rare non 2 responses are for RSSI
Not sure what firmware though. I track the develop branch the green graph has been installed for a few months. The yellow line was updated a few days ago did a fresh pull from develop and still shows the same behaviour.
I noticed that when photon is close proximity to router it starts returning numbers up to 7 for WiFi.RSS(). Otherwise in my experience it is 50/50 chance to get good reading or number 2.
I’ve just confirmed this is still an issue on 0.5.1 and 0.5.2. There is a workaround listed on the github page but I haven’t tried it. I’ve since re-purposed my Cores for other things and use Photons for anything with Wifi monitoring.