Skip to content

No WiFi connect since 2.3.0 if delay >= 1000 in setup() for init of external hardware #2702

@heiko-wolf

Description

@heiko-wolf

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");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions