ESP8266 stuck in network.STAT_CONNECTING although connected
Somehow between multiple soft resets I was able to get the esp8266 stuck in a state where sta.isconnect() returns False and s.status() returns network.STAT_CONNECTING forever.
However it was perfectly connected and I could use the webrepl.
Only a disconnect followed by a connect fixed that.
I know that without a reproducable testcase this issue might be worthless, in which case feel free to close it. But maybe someone familiar with the esp8266 network code can see a possibility for this to happen now that he has the information.
(Well I can "reproduce" it by doing multiple resets in a wdt interrupt routine and repl reconnects but I can't provide a real testcase at the moment)
ESP8266 is difficult to obtain an IP address from soft-routing WIFI
Port, board and/or hardware
esp8266
MicroPython version
ESP8266_GENERIC-FLASH_1M-20241025-v1.24.0
Reproduction
wlan = network.WLAN(network.STA_IF)
def connect_static_ip(ssid, password):
wlan.active(True)
while not wlan.isconnected():
print("connecting...", _, wlan.isconnected(), wlan.status())
time.sleep(1)
print("IP :", wlan.ifconfig(), wlan.isconnected())
Expected behaviour
I tried to use esp8266 to connect to wifi and found it difficult to connect, occasionally I can get the ip address
After that, I tried to use ARDUINO for programming, and connected to the same WIFI. I found that every time I connected to WIFI under Arduino, I could get the DHCP IP smoothly and correctly.
Observed behaviour
I tried to use esp8266 to connect to wifi and found it difficult to connect, occasionally I can get the ip address
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree