WiFi often ends up in half connected unusable state #17207
Replies: 5 comments 5 replies
-
I would concentrate on
Given your decent rssi, that suggests some problem with the access point. |
Beta Was this translation helpful? Give feedback.
-
I have the following devices that have no problem connecting to the access point in question: |
Beta Was this translation helpful? Give feedback.
-
The other issue I'm seeing is sometimes the text from my print statements is getting corrupted? How the output should look:
Memory free now has a z?
Memory free just got more weird?
|
Beta Was this translation helpful? Give feedback.
-
It's hard to comment without seeing code, but (aside from the corruption) your application seems to be rapidly running out of RAM. I would try a minimal test script to determine whether the problem is with the hardware/network. If the script connects and uses the network reliably then it's time to debug the application. |
Beta Was this translation helpful? Give feedback.
-
Remember also that the esp8266 automatically reconnects to the last AP after reboot and that micropython does not reinitialise the wifi on a sot reset. I have found this to sometimes cause complications, so, in my eg: import network
import time
sta, ap = [network.WLAN(w) for w in (network.STA_IF, network.AP_IF)]
sta.active(False); ap.active(False) # Setting both inactive resets the esp8266 wifi stack and hardware
sta.active(True); ap.active(False) # Set interfaces to desired state
sta.disconnect() # Force the esp8266 to disconnect from the AP
while sta.isconnected()
time.sleep(0.1) # Ensure is disconnected before continuing
sta.connect("ssid", "password")
while not sta.isconnected()
time.sleep(0.1) # Ensure is connected before continuing
ssid, chan = sta.config("ssid"), ap.config("channel")
print(f'Connected to "{ssid}" on wifi channel {chan}') This might seem overkill, but I have found this much more reliably ensures wifi works again as I expected after a reset (soft or hard). See micropython-espnow-utils/wifi.py and README.md for a more comprehensive approach (which includes timeouts). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
After using my WEMOS Lolin D1 mini V4.0.0 often ends up in some weird half connected state that takes a
machine.reset()
to fix. Sometimes it'll hang connecting too. Here is the state when it ends up in this condition:Beta Was this translation helpful? Give feedback.
All reactions