Skip to content

Wifi connection fails - only works after router reboot #8412

Open
@Toto5931

Description

@Toto5931

Basic Infos

  • [X ] This issue complies with the issue POLICY doc.
  • [X ] I have read the documentation at readthedocs and the issue is not addressed there.
  • [ X] I have tested that the issue is present in current master branch (aka latest git).
  • [X ] I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • [ X] I have filled out all fields below.

Platform

  • Hardware: esp8266
  • Core Version: 3.0.2
  • Development Env: Arduino IDE
  • Operating System: Windows

Settings in IDE

  • Module: Wemos D1 mini
  • Flash Mode: DOUT
  • Flash Size: 4MB
  • lwip Variant: v2 Lower Memory
  • Flash Frequency: 40Mhz
  • CPU Frequency: 80Mhz
  • Upload Using: SERIAL
  • Upload Speed: 921600

Problem Description

The WIFI connection is very unstable. It often works just after router restart but few times later the connection fails.
The debug message tells me that I am connected but the status stays at 0 and never goes to WL_CONNECTED
I have tried with many ESP8266 wemos d1 mini hardware it is always the same problem
The connection works fine with an ESP32.
Thanks for your help

#include <ESP8266WiFi.h> 

void setup()
{
  Serial.begin(9600);
  Serial.println();

  WiFi.begin("SFR_5758", "xxxxxxxxxxx");

  Serial.print("Connecting");

  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.print(".");
  }
  
  if (WiFi.status() == WL_CONNECTED) {
    Serial.print("Connected, IP address: ");
    Serial.println(WiFi.localIP());
  }
}

void loop() {}

Debug Messages

22:29:28.936 -> SDK:2.2.2-dev(38a443e)/Core:3.0.2=30002000/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-48-g7421258/BearSSL:6105635
22:29:29.076 -> 
22:29:29.076 -> fpm close 1 
22:29:29.076 -> mode : sta(8c:aa:b5:7b:1f:5f)
22:29:29.076 -> add if0
22:29:29.123 -> Connectingwifi evt: 8
22:29:29.962 -> .wifi evt: 2
22:29:30.991 -> .scandone
22:29:32.724 -> state: 0 -> 2 (b0)
22:29:32.724 -> .state: 2 -> 3 (0)
22:29:32.770 -> state: 3 -> 5 (10)
22:29:32.770 -> add 0
22:29:32.770 -> aid 3
22:29:32.770 -> cnt 
22:29:32.770 -> state: 5 -> 2 (2c0)
22:29:32.770 -> rm 0
22:29:32.816 -> wifi evt: 1
22:29:32.816 -> STA disconnect: 2
22:29:33.703 -> .reconnect
22:29:33.749 -> state: 2 -> 0 (0)
22:29:33.841 -> scandone
22:29:33.841 -> state: 0 -> 2 (b0)
22:29:33.841 -> state: 2 -> 3 (0)
22:29:33.887 -> state: 3 -> 5 (10)
22:29:33.935 -> add 0
22:29:33.935 -> aid 3
22:29:33.935 -> cnt 
22:29:33.935 -> 
22:29:33.935 -> connected with SFR_5758, channel 11
22:29:33.983 -> dhcp client start...
22:29:33.983 -> wifi evt: 0
22:29:34.686 -> ..........pm open,type:2 0
22:29:44.684 -> .............................................................................................

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