Skip to content

esp32s2: wifi: fix several debug-build errors#3689

Merged
tannewt merged 1 commit into
adafruit:mainfrom
jepler:issue-3688
Nov 17, 2020
Merged

esp32s2: wifi: fix several debug-build errors#3689
tannewt merged 1 commit into
adafruit:mainfrom
jepler:issue-3688

Conversation

@jepler

@jepler jepler commented Nov 13, 2020

Copy link
Copy Markdown

Closes #3688

With this change, I don't get the ESP_ERROR_CHECK failed repeatedly running code that imports wifi. (I'm not getting a successful connection but that's probably my own fault, such as a secrets problem)

Closes adafruit#3688

With this change, I don't get the ESP_ERROR_CHECK failed repeatedly
running code that imports wifi.  (I'm not getting a successful connection
but that's probably my own fault, such as a secrets problem)
@jepler

jepler commented Nov 13, 2020

Copy link
Copy Markdown
Author

Testing performed: In a debug build on kaluga, repeatedly ran a test program which does import wifi:

import ipaddress
import ssl
import wifi
import socketpool
#import adafruit_requests

# URLs to fetch from
TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"
JSON_QUOTES_URL = "https://www.adafruit.com/api/quotes.php"
JSON_STARS_URL = "https://api.github.com/repos/adafruit/circuitpython"

# Get wifi details and more from a secrets.py file
try:
    from secrets import secrets
except ImportError:
    print("WiFi secrets are kept in secrets.py, please add them there!")
    raise

print("ESP32-S2 WebClient Test")

print("My MAC addr:", [hex(i) for i in wifi.radio.mac_address])

print("Avaliable WiFi networks:")
for network in wifi.radio.start_scanning_networks():
    print("\t%s\t\tRSSI: %d\tChannel: %d" % (str(network.ssid, "utf-8"),
            network.rssi, network.channel))
wifi.radio.stop_scanning_networks()

print("Connecting to %s"%secrets["ssid"])
wifi.radio.connect(secrets["ssid"], secrets["password"])
#...

There's more code after "..." but for probably unrelated reasons my wifi connection doesn't actually succeed.

@jepler

jepler commented Nov 13, 2020

Copy link
Copy Markdown
Author

With this something else is still wrong with my debug builds -- adding DEBUG=1 to the Make environment AND making the following changes in sdkconfig-debug.defaults:

+CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG=y
+CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y
+CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y

... leads to non-working wifi

@tannewt

tannewt commented Nov 16, 2020

Copy link
Copy Markdown
Member

So... do you want to merge it or not?

@jepler

jepler commented Nov 17, 2020

Copy link
Copy Markdown
Author

I don't think it's causing the wifi failures I saw with the additional debug flags enabled, so yeah, I'd like to see it merged.

@tannewt tannewt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks!

@tannewt tannewt merged commit e2b5ae2 into adafruit:main Nov 17, 2020
@jepler jepler deleted the issue-3688 branch November 3, 2021 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

esp32s2 debug build errors in wifi_reset

2 participants