Skip to content

ESP32S2 WiFi connect() hard-resets and "Connection Error: Unknown failure" #3712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
todbot opened this issue Nov 18, 2020 · 6 comments
Closed
Labels
bug espressif applies to multiple Espressif chips network
Milestone

Comments

@todbot
Copy link

todbot commented Nov 18, 2020

Tested on Metro ESP32-S2 and MagTag. This was also present in a debug firmware for MagTag provided by @tannewt on 17 Nov 2020.

On CircuitPython-6.1.0-beta.0, the wifi module will sometimes hard-reset on wifi.radio.connect(), using a small connect script (*) This seems to only occur on Ctrl-D and save-on-reload restarts. When starting from hardware reset / power-on, the script works.

Also on CP-6.1.0-beta.0, it seems the ESP32-S2 WiFi cannot connect to APs that are not DHCP servers (but instead use a DHCP server over LAN). I have two APs on my network: one is the router and DHCP server, another is secondary AP (with different SSID) on the same LAN as the DHCP server. The ESP32-S2 CP can connect to the primary AP that's the DHCP server, but will error out with Connection Error: Unknown failure on the secondary AP. This almost feels like the ESP32-S2 is timing out early for a DHCP response.

*e.g. a script such as:

import wifi
for network in wifi.radio.start_scanning_networks():
    print("\t'%s'\t\tRSSI: %d\tChannel: %d" % (network.ssid, network.rssi, network.channel))
wifi.radio.stop_scanning_networks()
print("connecting...")
wifi.radio.connect(ssid="mysssid", password="supersecret")
print("connected.")
@todbot
Copy link
Author

todbot commented Nov 18, 2020

After doing tests with Metro ESP32-S2 with the Arduino IDE, the second part of this issue (Connection Error: Unknown failure on a secondary AP) is not unique to CircuitPython. Perhaps ESP32-S2s cannot connect to Apple Airports in AP mode or to APs that forward DHCP over Ethernet.

@tannewt tannewt added bug espressif applies to multiple Espressif chips network labels Nov 18, 2020
@tannewt tannewt added this to the 6.1.0 milestone Nov 18, 2020
@todbot
Copy link
Author

todbot commented Nov 18, 2020

Small update: upon reboot of problematic AP (Apple Time Capsule w/ external DHCP), Metro ESP32-S2 connection results:

  • Arduino ESP32-S2 "idf-release/v4.2" : connects
  • CircuitPython 20201011-40a3d11: connects
  • CircuitPython 6.1.0-beta.0: does not connect, and often hard-resets

@tannewt
Copy link
Member

tannewt commented Nov 19, 2020

beta.0 is broken. Please use the a18 build until #3716 is merged into main.

@anecdata
Copy link
Member

anecdata commented Nov 25, 2020

Helping with a connection issue on Discord (https://discord.com/channels/327254708534116352/537365702651150357/781234430520852491), I was able to connect to an Apple Airport Express set up as "Create a Wireless Network" in bridge mode (main router providing DHCP), with

FeatherS2 with ESP32S2
6.1.0-beta.1 on 2020-11-20
adafruit-circuitpython-bundle-6.x-mpy-20201120

@tannewt
Copy link
Member

tannewt commented Nov 25, 2020

@todbot Any update? Maybe we can close this.

@todbot
Copy link
Author

todbot commented Nov 26, 2020

Hi @tannewt, I've not been able to reproduce this error on 6.1.0-beta.1 on Metro ESP32S2. So okay for this to be closed I guess. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug espressif applies to multiple Espressif chips network
Projects
None yet
Development

No branches or pull requests

3 participants