Open LewsTherinTelamon opened 3 years ago
205 unfortunately is not a very helpful error code: "Espressif-specific Wi-Fi reason-code: the connection to the AP has failed."
Does the intermittent error persist after a hard reset of the MagTag?
Hard reset being either unplug/replug or a pressing of the reset button? Persists after both.
I reported the same issue in the adafruit forums ("Magtag - ConnectionError: Unknown failure 205") a few weeks ago.
In my case, when running the magtag wifi test program, or any other sample programs (from the adafruit learn circuitpython example), it can see several access points in my area. However when attempting to connect to my local wifi network, all I get is the 205 error after a 10-15 second delay. Contents of "secrets" file are correct. I have NEVER been able to connect to my network.
I've tried all 6.2.x versions of magtab circuitpython - no difference.
I have several ESP32 devkit boards (programmed & running test programs from arduino), and they can all connect to my network without problems - problem seems to be ESP32-S2 (and/or circuitpython) specific????
Note that I'm new to circuit/micro-python...
If you haven't already, try connect
in a loop with try/except. After connecting the first time, it's a little more resilient to re-establishing the connection if it fails.
Again, if you haven't already, try to connect to an alternate Access Point, and see if proximity to the AP makes a difference (a scan in CircuitPython will show RSSI for each AP; unfortunately a connection is probably needed to see the RSSI of the device from the AP perspective).
I've spent some time experimenting with location & orientation of the magtag and have FINALLY got it to connect to my wifi router. It looks like it could possibly be signal corruption due to parts layout on the magtag pcb causing interference to the wifi signal. Results of my testing in the adafruit forums ("Magtag - ConnectionError: Unknown failure 205").
I am experiencing this same issue using circuitpython. The further away from my AP I get, the more 205 errors I seem to receive. The other ESP32 boards I've own do not have this issue.
If there is more than one AP broadcasting the same SSID, you can select a specific AP to connect to by its BSSID, and / or, you can select a specific channel to use to avoid channel congestion or other sources of interference: https://circuitpython.readthedocs.io/en/latest/shared-bindings/wifi/index.html#wifi.Radio.connect
Forum discussion is here: https://forums.adafruit.com/viewtopic.php?f=19&t=175553
I'm seeing this problem as well. It was working fine and then one day it won't connect. The AP is shown on wifi scan but it won't connect to it. Sometimes it says "No network with that ssid" and other times it's "Unknown failure 205". If I bring the magtag within a few feet of the AP it will connect.
Thought I would pass along my experience in case it provides a clue.. I have a Magtag running
Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit MagTag with ESP32S2 Board ID:adafruit_magtag_2.9_grayscale
It was running the Weather code from the Adafruit examples fine for a few weeks. And then one day it started with the Unknown Failure 205 error. During the course of testing, I deleted everything and reloaded all the libraries and code. Still have the problem.
I have tried both and ASUS RT-AC56U and a Trendnet TEW-810DR, located in different parts of the house. The Trendnet only has the Magtag connected to it. Results were "about" the same, It would work sometimes, and not work sometimes.
I added this code:
# - Set the clock (and make sure we can connect to the AP
print("Connecting and getting time")
need_connect=True
connect_tries=01
while need_connect:
try:
magtag.network.get_local_time()
need_connect=False
except:
connect_tries+=1
print("Connect failed: Tries:{}".format(connect_tries))
time.sleep(10)
This will at least keep trying to connect to the AP every 10 seconds. Usually it will make the connection in less than 3 tries. But I have seen it go as high as 10 times before it was successful.
Just had all the ESP32-S2 devices from Adafruit in my home start acting like my router doesn't exist, very strange. ("No network with that name" and/or error 205). I suspect it's router related, since they're different ages and usage profiles, but I didn't change anything router related... Maybe it's the new neighbors.
I was searching around for what to do for Unknown Error 205 on discord and kept finding this issue. Here's what I did to work around it on my mesh network (Google Nest WiFi) using a picow and 8.0.0-beta2: 1) Use the app WiFi Analyzer on my Android phone to scan and create a dump. 2) Look through the generated .XML for the BSSIDs and signal strength of all my access points. I chose the one with the highest (closest to zero) level in decibels. 3) Add the BSSID as follows to the radio connect command:
wifi.radio.connect(os.getenv('WIFI_SSID'), os.getenv('WIFI_PASSWORD'), bssid=bytes([0x90,0x9D,0x7D,0x99,0x99,0x99]))
No, that really isn't by BSSID but you get the idea. Now, it seems to connect every time. Which to me begs the question, "Can this priority be automated?"
Note, I can also force the error to happen by specifying the BSSID of an AP that is very weak.
Espressif docs seem to imply that when there is more than one AP with the same SSID, it will [re]connect to the best one.
PicoW isn't espressif, so the preceding comment is probably misplaced.
espressif
should find the best AP among those offering the same SSID, but BSSID and / or channel can be specified. I don't know how Pico W handles that use case, but the Unknown Failure 205
is espressif
-specific - if it's occurring on a Pico W, that's a separate bug.
(much later addendum: as of 8.0.0-betas, looks like Pico W error codes are drawn from the same constants, including 205, so it's not a bug per se if Pico W gets a 205 or other ostensibly espressif
error codes.)
As a suggestion if there's an option in the wifi router for "Channel bandwidth" Try setting it to "40Mhz" instead of "20/40Mhz"
This seemed to fix problems I was having when connecting to the lower channel numbers of 7 and below
Same problem here with an Adafruit MagTag. Connects fine until the device is moved more than about 20'/6m from the AP. Will definitely connect when within that distance.
Firmware
Code/REPL Wifi test from guide
Behavior
Intermittent failure to connect to wifi AP. Behavior began after connecting to a second network and then trying to connect to the first network again. Confirmed "secrets.py" is correct as Wifi sometimes connects. Connection attempt seems to take 2-3 times longer than standard when the error occurs and then the error below appears in the REPL.
Additional Info
Not sure whether resetting my router fixed the issue temporarily or it cleared up on its own briefly. Error occurs when using the simpletest above and when using
magtag.network.get_local_time()