Open tacker66 opened 7 months ago
Are you able to provide a URL that shows the issue? So that someone else can reproduce the problem.
This happens when trying to call the local API of an APSystems EZ1 micro-inverter. Perhaps someone from Sonnenladen could help here. I raised an issue there.
I am trying to call
requests.get(some_REST_API_call)
on a Pico W (with v1.22.1) but this call blocks infinitely. Using a timeout or non-blocking mode(timeout=0)
doesn't help. The call works with CPython and in Chrome and returns some small JSON.When using
self._cached = self.raw.recv(10000)
instead ofself._cached = self.raw.read()
inrequests/__init__.py (line 20)
the call works fine.So shouldn't this
read()
be replaced with a loop which tries torecv(num_bytes)
until it read less thannum_bytes
and then stops?Update: Tested this with a different kind of device (calling the ThingSpeak API with
requests.post
) and for that onlyread()
works correctly.recv(num_bytes)
yields no bytes.