Wiznet / RP2040-HAT-MicroPython

54 stars 22 forks source link

OSError: -7 while trying HTTP Client example #15

Closed JPZV closed 2 years ago

JPZV commented 2 years ago

Hi, for some reason I always get an OSError -7 when doing the HTTP Client Example. This happens when I do the urequests.get call.

After looking to the code, I found out the error raises when the code tries to read the last line (maybe the last character?). Saddly there is no description whatsoever about the error anywhere.

This is the output from my Raspberry Pi Pico:

Traceback (most recent call last):
  File "<stdin>", line 37, in <module>
  File "<stdin>", line 34, in main
  File "<stdin>", line 22, in request
  File "/lib/urequests.py", line 180, in get
  File "/lib/urequests.py", line 125, in request
OSError: -7

And Boot info:

MPY: soft reboot
MicroPython v1.18-10-g5db278f1d-dirty on 2022-05-10; Raspberry Pi Pico with RP2040
Type "help()" for more information.
JPZV commented 2 years ago

This is embarrassing. The error comes because I was using the oficial urequest.py instead of the included one.

I think there should be some kind of comment at the start of the urequests.py in order to avoid this, as there is almost no visible difference between both urequests