Using Arduino IDE and Adafruit HUZZAH32-ESP32 Feather Board connected to a battery I wrote code to do the following.
1. ESP32 connects to WiFi network.
2. Once connected it stays in a loop and measures RSSI and displays the results to a LCD graph.
The idea of the code is to be able to walk around and plot signal strength of the WiFi network. The issue that I am having is that sometimes the RSSI value does not change. It shows the same value for prolong periods of time. Sometimes the same value is shown for 10 to 30 seconds, other times the same value is displayed for 5 to 10 minutes?
When it does work correctly, I can see the rssi fluctuating slightly when the device is stationary. And also see it increase or decrease as I move the it closer or further away from the WiFi router.
Yesterday when I first tried it out, it was working great in that there was only a few times where the RSSI value remained constant (10 to 30 seconds). This morning when I turned the device on the behavior considerably changed in that the RSSI values are remaining constant for periods of 5 to 10 minutes. Then without changing anything the rssi starts updating as expected. This happens regardless if the device is on battery or connected to 5V via USB. Between yesterday and today no code was changed.
If I change the code to do a network scan and filter on SSID to get the RSSI it works flawlessly in that rssi value always changes as expected. It seems like when the rssi value does freeze (i.e. does not change) the value shown is whatever the last value was right before the freeze. Note, I did verify through the use of PING that when the RSSI freezes the ESP32 is still connected to the network.
Questions,
1. Is there a setting in the ESP that might be causing this issue?
2. Is there a way to reset the ESP32?
3. Could it be related to my WiFi router settings?
4. Did something go wrong with the device?
I have tried to find info on how the actual RSSI measurement works inside the ESP32 but no details are found. Any help or guidance on solving this issue would be appreciated.
Thanks
Basic code that I am using is listed below....
//------------------------------------------------------------------------------------
#include <WiFi.h>
const char* ssid = "XXXXXX";
const char* password = "XXXXXXX";
void setup() {
Serial.begin(115200);
}
void loop() {
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Establishing connection to WiFi..");
}
Serial.println("Connected to network");
Serial.println(WiFi.localIP());
for (int i = 0; i <= 10000; i++){
long rssi = WiFi.RSSI();
Serial.print("rssi = ");
Serial.println(rssi);
delay(500);
}
WiFi.disconnect(true);
}
Measured RSSI Does Not Change
Re: Measured RSSI Does Not Change
Since my previous post did some more experimenting....
The next day after the original post the freezing RSSI was much more consistent and would last for 5 to 15 minutes and then would update as expected for a short time (5 to 20 seconds) before freezing again, this pattern lasted throughout the day. While this was occurring I tried another ESP32 device right out of the box and loaded it with the same code. Result was that the same as the old device in that RSSI was freezing.
The next day after this I turned on the original device to try to do more troubleshooting, but the device worked correctly? The RSSI never froze and would fluctuate when the ESP32 was stationary and would increase or decrease when the device was moved closer or further from the WiFi router. It was working like it should. Nothing was changed, the code was not reloaded, it was the exact same code as in previous days.
Based on I am thinking that the "freezing" RSSI might be due to the ESP32 internal algorithms and how it handles signals from WiFi router? I did check the WiFi channel number and it was the same all days (channel 11). Other devices connected to the same WiFi router worked correctly and no degrade in performance was seen on any of the days.
Not sure what caused the problem, but will continue to monitor to see if it reoccurs again. In the mean time if anybody has any thoughts as to what might have caused the problem it would be appreciated.
Thanks
The next day after the original post the freezing RSSI was much more consistent and would last for 5 to 15 minutes and then would update as expected for a short time (5 to 20 seconds) before freezing again, this pattern lasted throughout the day. While this was occurring I tried another ESP32 device right out of the box and loaded it with the same code. Result was that the same as the old device in that RSSI was freezing.
The next day after this I turned on the original device to try to do more troubleshooting, but the device worked correctly? The RSSI never froze and would fluctuate when the ESP32 was stationary and would increase or decrease when the device was moved closer or further from the WiFi router. It was working like it should. Nothing was changed, the code was not reloaded, it was the exact same code as in previous days.
Based on I am thinking that the "freezing" RSSI might be due to the ESP32 internal algorithms and how it handles signals from WiFi router? I did check the WiFi channel number and it was the same all days (channel 11). Other devices connected to the same WiFi router worked correctly and no degrade in performance was seen on any of the days.
Not sure what caused the problem, but will continue to monitor to see if it reoccurs again. In the mean time if anybody has any thoughts as to what might have caused the problem it would be appreciated.
Thanks
Re: Measured RSSI Does Not Change
Another update from previous post....
Did another experiment using two different ESP32's each connected to their own display screen. Code was written to display the RSSI in a graph. Code in both was the same except for the differences in writing to the displays because two different different displays were used (Adafurit TFT FeatherWing - 2.4" 320x240 and 3.5" 480x320 Displays).
Turned both displays on and started graphing RSSI. Result was that when the RSSI would freeze it did it on both units at the same time. An then after a few seconds after freezing the RSSI went back to normal on both displays at the same time. Conclusion from this is that the freezing is occurring because of the interaction of the WiFi signal and how the ESP32 is programmed. Based on preliminary research into the 802.11 spec it looks like the RSSI is measured in the preamble frame which is used by the device for synchronizing to the WiFi network. So if something happens to the frame then maybe this is the cause? When the freeze happens I can ping to the device which tells me it is still connected, so I do not think it is related to interference.
If anybody has more insight it would be appreciated if info is shared.
Note, currently the freeze is only occurring a few seconds out of a day. On previous days it was occurring much more often and on one day it was freezing for several minutes at a time consistently for 5 to 6 hours.
Thanks
Did another experiment using two different ESP32's each connected to their own display screen. Code was written to display the RSSI in a graph. Code in both was the same except for the differences in writing to the displays because two different different displays were used (Adafurit TFT FeatherWing - 2.4" 320x240 and 3.5" 480x320 Displays).
Turned both displays on and started graphing RSSI. Result was that when the RSSI would freeze it did it on both units at the same time. An then after a few seconds after freezing the RSSI went back to normal on both displays at the same time. Conclusion from this is that the freezing is occurring because of the interaction of the WiFi signal and how the ESP32 is programmed. Based on preliminary research into the 802.11 spec it looks like the RSSI is measured in the preamble frame which is used by the device for synchronizing to the WiFi network. So if something happens to the frame then maybe this is the cause? When the freeze happens I can ping to the device which tells me it is still connected, so I do not think it is related to interference.
If anybody has more insight it would be appreciated if info is shared.
Note, currently the freeze is only occurring a few seconds out of a day. On previous days it was occurring much more often and on one day it was freezing for several minutes at a time consistently for 5 to 6 hours.
Thanks
Re: Measured RSSI Does Not Change
Were there ever any fixes found to this issue? Trying to create a wifi strength heat map from some sensors running on existing esp32s.
Who is online
Users browsing this forum: No registered users and 51 guests