I met very weird behavior of ESP. I spent already 3 days trying to understand what's wrong, but couldn't find reason. I'm quite sure that I'm doing something wrong, that's why I need your help to figure it out
I have ESP-01 board with ESP8266. I'm using following sketch:
#define DEBUG_ESP_WIFI
#define DEBUG_ESP_PORT Serial
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
ESP8266WiFiMulti WiFiMulti;
void setup()
{
Serial.begin(9600);
Serial.setDebugOutput(true);
delay(2000);
WiFi.mode(WIFI_STA);
WiFiMulti.addAP("my_wifi", "my_password");
Serial.println();
Serial.println();
Serial.print("Wait for WiFi... ");
while (WiFiMulti.run() != WL_CONNECTED)
{
Serial.print(".");
delay(500);
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
delay(500);
}
void loop()
{
Serial.print("WiFi Status: ");
Serial.print(WiFi.status());
Serial.print("; is connected: ");
Serial.print(WiFi.isConnected());
Serial.println();
delay(5000);
}
As soon as ESP connects to WiFi, WiFi becomes much slowlier. You can notice it by significantly slowlier response times of Google search, by random and significant drops in speed here https://www.speedtest.net (ex. 35 -> 4 -> 15 Mb/s). I have 2 phones and 2 laptops in WiFi. All of them, except of 1 laptop, is quite fine with this. But as soon as one laptop (let's call it "laptop X") connects to WiFi, all WiFi is ruined. Router is available by ethernet, it shows no errors in its logs, but all devices losses their connection to WiFi. Reconnection doesn't help. The only thing which helps is restart of router.
I was observing following scenarios:
1. Restart router, do NOT connect ESP and laptop X. Check WiFi speed on wireless devices - everything fine. Connect ESP. Check WiFi speed - it becomes slowlier. Connect laptop X - WiFi is down.
2. Restart router, do NOT connect ESP and laptop X. Check WiFi speed on wireless devices - everything fine. Connect ESP. Check WiFi speed - it becomes slowlier. Disconnect ESP. Wait for couple of minutes. Check WiFi speed - it is still slow. Connect laptop X - WiFi is down!
So, it seems like connection of ESP is changing something on router and further connection of laptop X triggers WiFi fall. I know, it sounds like black magic, but I still can not find reason of this behavior.
I thought problem can be in my router (old Keenetic Lite). I tried to establish Access Point from my Xiaomi phone. I connected to that AP from Samsung phone. This connection is stable, I checked for few hours. Then I connected ESP to the same AP - WiFi became slowlier, but still alive. After that in about 23-30 min WiFi falls. So, looks like ESP somehow affects even AP provided by phone. Righ now I'm looking for another router to test, but quite probable that problem is not in router.
I tried erasing entire flash on ESP-01 by ESPFlasher - issue didn't disappear.
I thought that problem can be in USB power supply (I'm using this adapter to connect ESP-01: https://www.aliexpress.com/item/3297133 ... 4c4db2jeQM). I connected adapter directly to USB charger - issue didn't disappear.
Can anyone give me any hint, what is wrong and how to fix this behavior? I would really appreciate any help.