Skip to content

Version 1.7.x breaks use with MatrixPortal projects because it can't read JSON #39

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

Closed
makermelissa opened this issue Oct 5, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@makermelissa
Copy link
Collaborator

makermelissa commented Oct 5, 2020

When trying out the OpenWeather Demo (https://learn.adafruit.com/weather-display-matrix/code-the-weather-display-matrix), it works as expected with version 1.6.0 and breaks when updating to 1.7.x.

The lines I noticed related to the error that keep repeating:

Free mem:  31664
Retrieving data...Socket missing recv_into. Using more memory to be compatible
Reply is OK!
{"coord":{"lon":-118.24,"lat":34.05},"weather":[{"id":721,"main":"Haze","description":"haze","icon":"50d"}],"base":"stations","main":{"temp":27.55,"feels_like":30.38,"temp_min":21,"temp_max":31.11,"pressure":1016,"humidity":64},"visibility":6437,"wind":{"speed":1.31,"deg":212},"clouds":{"all":1},"dt":1601921273,"sys":{"type":1,"id":3694,"country":"US","sunrise":1601905840,"sunset":1601947886},"timezone":-25200,"id":5368361,"name":"Los Angeles","cod":200}
Some error occured, retrying! - Cannot access json after getting text or content
@makermelissa makermelissa added the bug Something isn't working label Oct 5, 2020
@makermelissa
Copy link
Collaborator Author

Ok, I looked into this. The issue is we are grabbing request.text and then request.json() and this causes the error. I'll update the MatrixPortal library to not do this.

@makermelissa
Copy link
Collaborator Author

This issue likely affects Adafruit_CircuitPython_PyPortal and possibly Adafruit_Blinka_PyPortal as well.

@tannewt
Copy link
Member

tannewt commented Oct 5, 2020

I did this to avoid holding onto the full string memory between the text call and the json call.

@makermelissa
Copy link
Collaborator Author

That's fine. It was a clear enough message that I figured it out pretty quickly. I would have probably released it as 2.0.0 though. :)

@tannewt
Copy link
Member

tannewt commented Oct 6, 2020

@makermelissa Ya, fair. I was trying my best to be backwards compatible and maybe I was too optimistic. :-)

@makermelissa
Copy link
Collaborator Author

No problem. I have updated the Portal libraries and am unaware of any others this change affects, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants