-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Getting a Hard fault
when using SSL with a WIZnet5k
#9317
Comments
I will note, that this is specific to the new feature in |
note, for those who wondered: that particular URL redirects to https:, so this is using https even though the url is http |
@jepler the same thing happens if it starts as My assumption (although probably totally wrong) is that some resource is still being held onto by python when the fake sleep happens |
and verified. This doesn't crash: import alarm
import board
import busio
import digitalio
import time
import adafruit_connection_manager
import adafruit_requests
from adafruit_wiznet5k import adafruit_wiznet5k
# delay so you can connect
print("starting:", end="")
for i in range(10):
print(".", end="")
time.sleep(1)
print()
print("getting radio")
chip_select = digitalio.DigitalInOut(board.D10)
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
radio = adafruit_wiznet5k.WIZNET5K(spi, chip_select, is_dhcp=True)
print("getting pool, ssl, requets")
pool = adafruit_connection_manager.get_radio_socketpool(radio)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(radio)
requests = adafruit_requests.Session(pool, ssl_context)
print("getting quotes")
test_url = "http://www.adafruit.com/api/quotes.php"
with requests.get(test_url) as response:
result = response.text
print(result)
adafruit_connection_manager.connection_manager_close_all(release_references=True)
print("sleeping")
time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 5)
alarm.exit_and_deep_sleep_until_alarms(time_alarm) |
what if your code doesn't deep sleep, but just exits? |
|
I was wrong, still had the old code. It fails the same way with both. |
Being even more specific, this fixes it: #connection_manager_close_all()
connection_manager = adafruit_connection_manager._global_connection_managers.get(pool)
connection_manager._free_sockets(force=True) So it's the open socket via the ssl_context |
CircuitPython version
Code/REPL
Behavior
Description
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: