You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New issue opened here based on a comment in #32. This issue may be better moved to Requests.
Current versions of Wiznet5k do not work with recent versions of Requests.
CircuitPython 5.3.1 through CircuitPython 6.2.0-beta.4 work with the 20200714 library bundle that was current as of CirPy 5.3.1 (Requests 1.4.3), but not with recent Requests versions, so it appears to be a library issue.
Old stuff:
Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit Feather M4 Express with samd51j19
>>> # CS on board.A5
>>> # library bundle 20200714
>>> import wiznet5k_simpletest.py
Wiznet5k WebClient Test
Chip Version: w5500
MAC Address: ['0xde', '0xad', '0xbe', '0xef', '0xfe', '0xed']
My IP address is: 192.168.6.223
IP lookup adafruit.com: 104.20.39.240
Fetching text from http://wifitest.adafruit.com/testwifi/index.html
----------------------------------------
This is a test of Adafruit WiFi!
If you can read this, its working :)
----------------------------------------
Fetching json from http://api.coindesk.com/v1/bpi/currentprice/USD.json
----------------------------------------
{'time': {'updated': 'Mar 23, 2021 20:32:00 UTC', 'updatedISO': '2021-03-23T20:32:00+00:00', 'updateduk': 'Mar 23, 2021 at 20:32 GMT'}, 'disclaimer': 'This data was produced from the CoinDesk Bitcoin Price Index (USD). Non-USD currency data converted using hourly conversion rate from openexchangerates.org', 'bpi': {'USD': {'code': 'USD', 'description': 'United States Dollar', 'rate_float': 54869.0, 'rate': '54,868.9933'}}}
----------------------------------------
Done!
Newer stuff, after a long wait:
Adafruit CircuitPython 6.1.0 on 2021-01-21; Adafruit Feather M4 Express with samd51j19
>>> # CS on board.A5
>>> # library bundle 20210320
>>> import wiznet5k_simpletest.py
Wiznet5k WebClient Test
Chip Version: w5500
MAC Address: ['0xde', '0xad', '0xbe', '0xef', '0xfe', '0xed']
My IP address is: 192.168.6.223
IP lookup adafruit.com: 104.20.39.240
Fetching text from http://wifitest.adafruit.com/testwifi/index.html
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "wiznet5k_simpletest.py", line 38, in <module>
File "adafruit_requests.py", line 681, in get
File "adafruit_requests.py", line 586, in request
OutOfRetries: Repeated socket failures
Same behavior CircuitPython 6.0.0 through CircuitPython 6.2.0-beta.4, with recent versions of Requests.
Likely a Requests issue or how newer requests interacts with the Wiznet5k socket: The only libraries needed for the simpletest code are: Requests and Wiznet5k (plus native or library adafruit_bus_device). 6.2.0-beta.4 works with 20210324 wiznet5k + 20200714 requests
From a little print-debugging... Requests appears to be failing because recv from the wiznet socket repeatedly times out before detecting the magic "H" in HTTP/1.1 200 OK.
The text was updated successfully, but these errors were encountered:
Adafruit CircuitPython 7.2.0-alpha.1-224-gac7a80753 on 2022-01-26; Adafruit Feather RP2040 with rp2040 adafruit-circuitpython-bundle-7.x-mpy-20220128
Test code:
importboardfromdigitalioimportDigitalInOut, Directionfromadafruit_wiznet5k.adafruit_wiznet5kimportWIZNET5Kimportadafruit_wiznet5k.adafruit_wiznet5k_socketaswiznet5k_socketimportadafruit_requests# localfromsecretsimportsecretsTEXT_URL="http://wifitest.adafruit.com/testwifi/index.html"spi=board.SPI()
## WIZNET5K - W5500 FeatherWing#MAC_ADDR_5500= (0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED)
# customized CS pin b/c ESP32 needs GPIO0 available for reboots:eth_5500_cs=DigitalInOut(board.D25)
eth_5500=WIZNET5K(spi, eth_5500_cs, mac=MAC_ADDR_5500)
print("W5500 IP Address:", eth_5500.pretty_ip(eth_5500.ip_address))
# Initialize a requests object with an ethernet socket and interfaceadafruit_requests.set_socket(wiznet5k_socket, eth_5500)
print("Fetching text via W5500 from", TEXT_URL)
withadafruit_requests.get(TEXT_URL) asr:
print(r.text)
print("Done!")
Result:
code.py output:
W5500 IP Address: 192.168.6.250
Fetching text via W5500 from http://wifitest.adafruit.com/testwifi/index.html
This is a test of Adafruit WiFi!
If you can read this, its working :)
Done!
Code done running.
New issue opened here based on a comment in #32. This issue may be better moved to Requests.
Current versions of Wiznet5k do not work with recent versions of Requests.
CircuitPython 5.3.1 through CircuitPython 6.2.0-beta.4 work with the 20200714 library bundle that was current as of CirPy 5.3.1 (Requests 1.4.3), but not with recent Requests versions, so it appears to be a library issue.
Old stuff:
Newer stuff, after a long wait:
Same behavior CircuitPython 6.0.0 through CircuitPython 6.2.0-beta.4, with recent versions of Requests.
Likely a Requests issue or how newer requests interacts with the Wiznet5k socket: The only libraries needed for the simpletest code are: Requests and Wiznet5k (plus native or library
adafruit_bus_device
). 6.2.0-beta.4 works with 20210324 wiznet5k + 20200714 requestsFrom a little print-debugging... Requests appears to be failing because recv from the wiznet socket repeatedly times out before detecting the magic "H" in
HTTP/1.1 200 OK
.The text was updated successfully, but these errors were encountered: