-
Notifications
You must be signed in to change notification settings - Fork 13.3k
No WiFi connect since 2.3.0 if delay >= 1000 in setup() for init of external hardware #2702
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
Comments
i had that problem too !!! The Problem is not the FIX FOR USING 2.3.0 CORE (only .begin if not connected)!!!!!!!
|
Hi there, |
Got the same problem but none of the workarounds seems to fix it. After my >1sec seconds I do this
After a clean power cycle the whole thing is working, just after flashing or sometimes on power-cycling from battery it is not working. |
Try using static IP rather than DHCP -- fixes it for me here. The internal DHCP seems to have issues under some conditions. |
I just discovered this wonderful feature 😡. The workaround suggested in kendo55's post begs the question, "why is the module connected prior to WiFi.begin?". The workaround could be problematic if there is more than 1 AP and you need to connect to one specific one or change from one to the other. |
Hardware
Hardware: ESP-12
Core Version: 2.3.0
Description
No WiFi connect since 2.3.0 if "delay >= 1000" in setup() for init of external hardware.
After upgrading to 2.3.0 many sketches wont connect anymore to WiFi Accesspoint.
Testing a few things showed up that the problem was caused by adding a delay(1000) in setup before WiFi.begin().
This was done to power up external hardware properly before starting the Arduino/ESP Code and connecting the WiFi.
After downgrading to 2.2.0 everything works fine again using this delay.
Settings in IDE
Module: Wemos D1 R2 & mini
Flash Size: 4MB/3MB
CPU Frequency: 80Mhz
Sketch
#include <ESP8266WiFi.h>
char ssid[50] = "your ssid";
char password[50] = "your pwd";
void setup() {
Serial.begin(9600);
delay(1000); // for ext. hardware init <<<<<<<<<<<
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
delay(1000);
Serial.println("X");
}
The text was updated successfully, but these errors were encountered: