-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delayed or no connection to WiFi #7297
Comments
Works just fine for me once I fix your MCVE. I don't have your Asus router. //#include <Arduino.h> not needed for this MCVE
#include <ESP8266WiFi.h> // I'm just guessing, but you couldn't possibly have compiled without this
const char* ssid = "your SSID";
const char* password = "your password";
void setup() {
Serial.begin(250000); // my D1 Mini won't run at half a million baud
Serial.setTimeout(2000);
// Wait for serial to initialize.
// while (!Serial) { } not needed, this isn't a Leonardo
Serial.println("Serial debug should be running");
// Connect to WiFi network
WiFi.mode(WIFI_STA);
// wifiConnectHandler = WiFi.onStationModeGotIP(onWifiConnect); not defined
// wifiDisconnectHandler = WiFi.onStationModeDisconnected(onWifiDisconnect); not defined
// WiFi.disconnect(); not needed
delay(1);
WiFi.begin(ssid, password);
//--------temp
while (WiFi.waitForConnectResult() != WL_CONNECTED)
{
Serial.printf("Connection status: %d\n", WiFi.status());
WiFi.printDiag(Serial);
delay(1000);
Serial.print(".");
}
}
void loop() {
} MCVE = Minimal Complete Verifiable Example (you only got the 'Example' part right) ;-) |
I didn't know if it contained something unusual. Is there diagnostic information I can collect to help diagnose? |
You said:
and
which tells me you missed some things. |
In addition to what @devyte said,
|
@d-a-v I will try erasing entire flash. I had hoped that after a year of development, the platform wouldn't regress to require tweaks on the router so I have not tried those. I have had no trouble with the older version of the platform. |
This option "erase all flash" is here because we have had experienced the same as you do when upgrading from an old closed-firmware to a new closed-one and this one simple action can solve it all.
|
I used "Erase flash: All Flash Contents" in the Arduino SDK. No change in behavior with new release. With current release (2.7.1), it most commonly will not connect to WiFi. Around 4 minutes in, something times out and it gives itself a self assigned IP address. I am able to connect to the ESP8266 using the self assigned IP. Is there diagnostic information I can collect? With the older version of this library, 2.5.1, it connects almost immediately and consistently. Presumably unrelated, but since erasing flash, I have been unable to get PlatformIO to function properly with platform version 2.2.0 (2.5.1 of this repo). The ESP8266 crashes at startup. With latest version it doesn't crash, but behaves as above regarding WiFi connectivity. |
In core version 2.5.1, default FW is
|
@d-a-v That worked!! After trying the other settings as well, it works successfully! I've done repeated tests. Connected in 6 seconds, 6 seconds, immediately, 3 seconds, immediately. I'll keep tweaking to see if there's a particular setting that makes the difference. I'm also trying to replicate in PlatformIO. Thanks!! FYI: I've tried three different physical boards with the same behavior. NodeMCU from Amica, NodeMCU from Lolin, and the D1 mini. |
Hi, |
In PlatformIO you can change SDK to this version by passing build flag -D PIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK221 as described here: @d-a-v I'm having similar issues that were solved by rolling back the SDK to this version. Would I be better off to change the SDK to the newest version available to ensure that I'm getting the all the latest bug fixes included also? Or would there be risk of other instabilities? |
Please have a look to the two pinned issues |
I am having a lot of issues with my tasmota devices that have the new ESP core version (2.7.4.9) and my asus mesh network. It loses the connection a lot of times per day. Even with only 2.4GHz Wifi on legacy mode. Can i create with arduino IDE a .bin file with Espressif FW: 2.2.1-Legacy? Thank you! |
Yes, in the arduino IDE menu, or PIO option |
Basic Infos
Platform
Settings in IDE
Problem Description
Detailed problem description goes here.
Attempting to connect to ASUS RT-AC86U router running latest firmware.
Does not connect to WiFi, or connects after extended period of time. Often appears to time out at 4 minutes, uses self assigned IP address.
This problem does not occur with version 2.5.1 of this same library. Only occurred after updating library. If I go back to 2.5.1 it connects within a couple of seconds.
Router using WAP2-personal.
All other settings set to default.
Returns connection status: 6
MCVE Sketch
Debug Messages
The text was updated successfully, but these errors were encountered: