Closed
Description
trying to connect esp8266 to access point. simple sketch.
#include <ESP8266WiFi.h>
#define WIFI_SSID "My_SSID"
#define WIFI_PASS "My_pass"
void setup() {
Serial.begin(115200);
WiFi.setPhyMode(WIFI_PHY_MODE_11G);
WiFi.begin(WIFI_SSID, WIFI_PASS);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("Connected");
Serial.println(WiFi.localIP());
}
void loop() {
}
router log only one entry
...
daemon.info hostapd: wlan1: STA yy:yy:yy:yy:yy:yy IEEE 802.11: authenticated
daemon.info hostapd: wlan1: STA yy:yy:yy:yy:yy:yy IEEE 802.11: authenticated
daemon.info hostapd: wlan1: STA yy:yy:yy:yy:yy:yy IEEE 802.11: authenticated
...
esp does not receive ip address.
SDK:3.0.0-dev(c0f7b44)/Core:2.5.0=20500000/lwIP:STABLE-2_1_2_RELEASE/glue:1.1/BearSSL:6778687
scandone
.wifi evt: 2
....scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 0 (1f)
wifi evt: 1
STA disconnect: 203
..reconnect
......scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 0 (1f)
wifi evt: 1
STA disconnect: 203
..reconnect
...wifi evt: 7
wifi evt: 7
...scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 0 (1f)
wifi evt: 1
STA disconnect: 203
..reconnect
i don't know if this is an esp or AP problem
Activity
mcspr commentedon Feb 27, 2025
Duplicate of #7965 (and some other ones)
You got the main gist of forcing G mode, iirc it is the main reason
Another thing is forced SDK:3.0.0-dev, which we don't recommend using
Please update to Core 3.1.2
When trying out different SDK versions, make sure to erase SDK before flashing the .bin
johndoe71rus commentedon Mar 2, 2025
initially I tried the latest version of SDK. then I found somewhere that after 2.5 many people stopped connecting, so I switched to it.
now I have the correct version of Core: 3.1.2?
wifi AP log
mcspr commentedon Mar 2, 2025
Not much to go on, really.
What is the AP hardware?
What about /etc/config/wireless?
You can't use WPA3, in case you are forcing it. Only WPA2 2.4GHZ works.
WiFi.setPhyMode(WIFI_PHY_MODE_11G);
is sometimes there to force the AP, but it may work as-is too(as it does with e.g. various mediatek routers)
Just to clarify some terminology
NONOS SDK is a closed-source blob from Espressif, WiFi and low level networking is handled there.
We do have a build option for both Arduino IDE and PlatformIO to switch to a different SDK version, in case it broke something. See menu options in Arduino IDE and these build flags for PIO - https://docs.platformio.org/en/latest/platforms/espressif8266.html#sdk-version
Why I mentioned this - 2.4.2 -> 2.5.0 switch switched from SDK:2.2.1 to SDK:3.0.0-dev by default. 2.6.0+ switched back, 2.7.0+ ship with SDK:2.2.2(from various git dates).
If you had it working before 2.5.0, swap to SDK:2.2.1 and try again (or any other available version)
johndoe71rus commentedon Mar 2, 2025
I used nodemcu and nexx wt1520 openwrt 15 before... .
Now I changed the hardware to x86 openwrt OpenWrt 23.05. 5
I couldn't connect to nodemcu. Now I'm trying a simple sketch in Arduino IDE.
hardware AP
USB device found, idVendor=0b05, idProduct=1784, bcdDevice= 1.01
cat /etc/config/wireless
flash sketch with full erase.
android phone work with this AP
mcspr commentedon Mar 2, 2025
No mfp support for NONOS, ieee80211w 'required' likely the cause
Don't really remember much about ccmp forcing.
johndoe71rus commentedon Mar 2, 2025
i try WPA-PSK/WPA2-PSK Mixed and TKIP CCMP without success.
this #7965 (comment) ?
or some else? i use Wemos D1 mini r2 & mini board profile
the device appears in the web interface for a few seconds. Tr 0, but this behavior occurs even at 30 cm from the router.
johndoe71rus commentedon Mar 8, 2025
check old AP settings
and to old AP modele connect fine
try Wemos D1 mini r2 & mini board profile
try add option hwmode '11g' to new AP without success
johndoe71rus commentedon Mar 9, 2025
fixed
set AP option ieee80211w '1' and all work