-
Notifications
You must be signed in to change notification settings - Fork 35
request.get isn't working in 1.7.x #41
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
Comments
Can you print the server headers? It's probably related to a known issue. |
No, at least not in the PyPortal library. It fails before the response is returned. |
I'm going to try within parse_headers. |
It doesn't appear there are any headers for the image for some reason. |
Sorry, I thought you meant response headers. I don't have access to the server headers. |
Oh, I realized I can get these with the 1.6.0 version. Here you go:
|
haha, I was just about to suggest that. Are there trace lines pointing to where in Requests it's failing? |
There is a |
I'm still a perplexed about exactly where it's failing and have been trying to trace this down. It seems like maybe like it's a parsing issue. |
Probably it's just using the image converter, but I didn't want to post my AIO key for everyone to see. |
Ok, I'm suspecting this may be related to the fact that there are 2 calls going on. It does a call to get JSON and that's successful. Then it does a call to download the image and perhaps something isn't resetting that should be between the calls. |
@makermelissa 1.7.0 tries to reuse sockets to servers. I see that there is a (I leave sockets open because TCP has a start up cost I was hoping to avoid.) |
Ok cool. I had to move off of this for the time being. Hopefully it's something simple. |
Multiple Adafruit Learn Guides examples do not work accessing the Internet on 6.0.0-rc.0 on my PyPortal Titano with the latest libraries (6.x-mpy-20201019) ESP firmware: bytearray(b'1.6.1\x00') These do not work: PyPortal_CMA_ART_FRAME Suggest that tests that are run as part of CI include one of these more complex uses of the pyportal library, downloading multiple large files. |
@gmeader I believe it's requests 1.7.x which is a different from the 1.6.1 version of NINA. We don't have a way currently to test on device so automating these tests is a bit tough. I did add CPython compatibility in 1.7.0 and unittests as well. So, as we fix these issues, we can add tests to make sure we don't regress again. |
i think this is resolved - if folks in the thread can try the latest release here (its not in bundle yet) please let us know any broken URLs :) |
Next week I will test: |
This is still an issue though it is much less frequent. I have been trying out various things, but it still fails at least a quarter of the time. I have noticed when it does fail, it needs to reconnect to the Access Point, so that may be related. |
@gmeader did you have a chance to do more tests? |
I suspect this issue is fixed at this point. @gmeader were you able to test? |
Hey @gmeader were you able to test again? I'm thinking we can close this. |
I tested They both work, but occasionally get an error on CMA_ART_FRAME |
Thanks @gmeader ! |
I'm not sure of the exact issue, but in the PyPortal library, it works fine in 1.6.0, but in 1.7.x it fails. The line in the PyPortal library that it seems to fail on is: https://github.com/adafruit/Adafruit_CircuitPython_PyPortal/blob/master/adafruit_pyportal.py#L731
which is
r = requests.get(url, stream=True)
.The URL is an image https://io.adafruit.com/api/v2/MakerMelissa/integrations/image-formatter?x-aio-key=[redacted]&width=320&height=240&output=BMP16&url=https://apod.nasa.gov/apod/image/2010/VLA_Moonset_NIK_0991_1024.jpg.
More possibly related errors. I'm not sure where they're all generated:
Honestly not sure what's going on here, but I thought I'd post the issue.
The text was updated successfully, but these errors were encountered: