I am trying to utilize my new MatrixPortal M4 using the SAMD chip to make some GET requests and then do useful things with that data.
Currently I am having a lot of trouble being able to consistently make successful requests.
I am seeing the following error constantly:
Code: Select all
File "code.py", line 28, in <module>
File "adafruit_portalbase/network.py", line 505, in fetch
File "adafruit_requests.py", line 864, in get
File "adafruit_requests.py", line 710, in request
File "adafruit_requests.py", line 563, in _get_socket
RuntimeError: Sending request failed
Here is the test code I am using:
Code: Select all
import board
from src.NetworkManager import NetworkManager
from src.ota_updater import OTAUpdater
from adafruit_matrixportal.network import Network
# Get wifi details and more from a secrets.py file
from secrets import secrets
print("Currently stored secrets:",secrets)
net = Network(status_neopixel=board.NEOPIXEL)
net.connect()
print(net._wifi.is_connected)
TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"
JSON_GET_URL = "https://api.github.com/repos/adafruit/Adafruit_CircuitPython_MatrixPortal/releases/latest"
res = net.fetch(TEXT_URL)
print(res)
res.close()
res = net.fetch(JSON_GET_URL)
print(res)
res = net.fetch(TEXT_URL)
print(res)
res = net.fetch(JSON_GET_URL)
print(res)
res = net.fetch(TEXT_URL)
print(res)
res = net.fetch(JSON_GET_URL)
print(res)
res = net.fetch(TEXT_URL)
print(res)
Code: Select all
Retrieving data...<Response object at 0x20004480>
Retrieving data...<Response object at 0x20004490>
Retrieving data...<Response object at 0x20004730>
Retrieving data...Traceback (most recent call last):
File "code.py", line 37, in <module>
File "adafruit_portalbase/network.py", line 505, in fetch
File "adafruit_requests.py", line 864, in get
File "adafruit_requests.py", line 710, in request
File "adafruit_requests.py", line 563, in _get_socket
RuntimeError: Sending request failed
Currently running Circuitpython Adafruit CircuitPython 7.2.5 (EDIT: Also tested with 7.3.1 with no improvement)