esp8266 / esp8266/Arduino

Problematic WiFi connection to certain types of AP's

Open
#8,950 24 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
16.7k
Forks
13.1k
PR merge metrics
No merged PRs in 30d

Description

### Basic Infos

- [x] This issue complies with the [issue POLICY doc](https://github.com/esp8266/Arduino/blob/master/POLICY.md).
- [x] I have read the documentation at [readthedocs](https://arduino-esp8266.readthedocs.io/en/latest) and the issue is not addressed there.
- [n] I have tested that the issue is present in current master branch (aka latest git). Tested against 3.1.2 not sure how to test against latest.
- [x] I have searched the issue tracker for a similar issue.
- [na] If there is a stack dump, I have decoded it.
- [x] I have filled out all fields below.

#### Platform

- Hardware: [ESP826EX - Lolin D1 Mini v4 (and v3)]
- Core Version: [3.1.2 release, not sure how to update to latest]
- Development Env: [Arduino IDE]
- Operating System: [Fedora 37]

### Settings in IDE

- Module: [Wemos D1 mini r2]
- Flash Mode: [Default, not sure]
- Flash Size: [4MB]
- lwip Variant: [v2 Lower Memory]
- Reset Method: [dtr]
- Flash Frequency: [40MHz]
- CPU Frequency: [80MHz]
- Upload Using: [SERIAL]
- Upload Speed: [115200]

### Problem Description

I'm having issues getting the ESP8266EX to connect to one of my WiFi AP's, this is an Asus RT-AX86U Pro, it has no issues connecting to an older Asus model that is also providing WiFi for the same SSID.

I've put together a minimal sketch to try and help debug this issue, and the output that I get is as at the end.

FYI, I did try going to the esp8266 forum, however, there appears to be a problem with my registration (no email was received).

I see several other tickets raised relating to something similar #7965 #8299 and I've tried both fixes and changes that appear to have helped them, most notably.

WiFi.setPhyMode(WIFI_PHY_MODE_11G); <- Added both before and after WiFi.begin, which no change

And changing the board to esp8266 generic, and changing to nonos-sdk2.2.1+61 (190313)

### [MCVE](https://stackoverflow.com/help/mcve) Sketch

#include

void setup()
{
Serial.begin(115200);
Serial.setDebugOutput(true);
Serial.println();

WiFi.begin("HumptyDumpty", "Not_A_Real_SSID_for_me_at_least");

Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println();

Serial.print("Connected, IP address: ");
Serial.println(WiFi.localIP());
Serial.printf("Wi-Fi mode set to WIFI_STA %s\n", WiFi.mode(WIFI_STA) ? "" : "Failed!");
Serial.printf("Connection status: %d\n", WiFi.status());
WiFi.printDiag(Serial);

}

void loop() {}

```
Debug messages go here
```

I have the following information from my router, which may be helpful
Stations List
----------------------------------------
idx MAC Associated Authorized RSSI PHY PSM SGI STBC MUBF NSS BW Tx rate Rx rate Connect Time
7C:87:CE:BE:20:D4 Yes Yes -56dBm g No No No No 1 20M 54M 1M 00:00:03

So, I don't believe signal strength is an issue.

connected with HumptyDumpty, channel 6
dhcp client start...
ip:192.168.1.250,mask:255.255.255.0,gw:192.168.1.1
switch to channel 1
bcn_timout,ap_probe_send_start
ap_probe_send over, rest wifi status to disassoc
state: 5 -> 0 (1)
rm 0
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 33
cnt

connected with HumptyDumpty, channel 6
dhcp client start...
ip:192.168.1.250,mask:255.255.255.0,gw:192.168.1.1
switch to channel 1
bcn_timout,ap_probe_send_start
ap_probe_send over, rest wifi status to disassoc
state: 5 -> 0 (1)
rm 0
scandone
no HumptyDumpty found, reconnect after 1s
reconnect
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 26
cnt

connected with HumptyDumpty, channel 6
dhcp client start...
ip:192.168.1.250,mask:255.255.255.0,gw:192.168.1.1
switch to channel 1
bcn_timout,ap_probe_send_start
pm open,type:2 0
ap_probe_send over, rest wifi status to disassoc
state: 5 -> 0 (1)
rm 0
pm close 7
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 25
cnt

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.