0

Pyportal Nasa Photo of the day
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Pyportal Nasa Photo of the day

by saltpoint3289 on Sat Mar 06, 2021 6:55 pm

This program has been working for me for about five months. Once in a while I get an error because the image of the day is not a jpeg but is a movie or some other format. Now the display is just not working. I get the
File "Adafruit_pyportal.py", line 1077, in fetch
File "Adafruit_pyportal.py", line 781, in wget Http Error: CODE 422: UNPROCESSIBLE ENTITY. AND then it waits for reboot.

I have checked the line of code which gets to the image and that works correctly. I checked the secrets file. I have run the test internet connection file and that is good.

I reloaded the project files in case I had missed an edit - but it had been working quite flawlessly.

Before I reload Circuit Python libraries - - is there something else that I am missing? One of the last images I received was the Mars landing.

Thank you, Cynthia

Thank you,

saltpoint3289
 
Posts: 9
Joined: Thu Jan 31, 2019 10:47 pm

Re: Pyportal Nasa Photo of the day

by NeutralDensity on Sun Mar 07, 2021 2:45 pm

I am having a similar issue with the Cleveland Museum of Art demo. I now always end up with this error message: File "adafruit_portalbase/network.py", line 258, in wget
HttpError: Code 422: Unprocessable Entity

Every few days I update to the latest UF2 file and the latest version 6 libraries, but same error shows up. I also have this problem with the "New New New" products demo.

I don't know what would need to change in the program code, so assume it has something to do with a library?

NeutralDensity
 
Posts: 7
Joined: Sat Feb 23, 2019 5:44 pm

Re: Pyportal Nasa Photo of the day

by jliu70 on Sat Mar 13, 2021 10:11 pm

Same for me with the Cleveland Museum of Art demo.

Code: Select all | TOGGLE FULL SIZE
original URL: https://openaccess-cdn.clevelandart.org/2009.276.110.a/2009.276.110.a_web.jpg
convert URL: https://io.adafruit.com/api/v2/jliu70/integrations/image-formatter?x-aio-key=somekey&width=480&height=305&output=BMP16&url=https://openaccess-cdn.clevelandart.org/2009.276.110.a/2009.276.110.a_web.jpg
Fetching stream from https://io.adafruit.com/api/v2/jliu70/integrations/image-formatter?x-aio-key=somekey&width=480&height=305&output=BMP16&url=https://openaccess-cdn.clevelandart.org/2009.276.110.a/2009.276.110.a_web.jpg
Traceback (most recent call last):
  File "code.py", line 57, in <module>
  File "code.py", line 46, in <module>
  File "adafruit_pyportal.py", line 1106, in fetch
  File "adafruit_pyportal.py", line 1103, in fetch
  File "adafruit_pyportal.py", line 1083, in fetch
  File "adafruit_pyportal.py", line 1077, in fetch
  File "adafruit_pyportal.py", line 781, in wget
HttpError: Code 422: Unprocessable Entity

Code done running.


This was with CircuitPython 6.1.0 and adafruit-circuitpython-bundle-6.x-mp6-20210103

Then I tried to install the latest CircuitPython Beta 3, but then in adafruit-circuitypython-bundle-6.x-mpy-20210313 I see that the "adafruit_pyportal.mpy" is replaced by the adafruit_pyportal directory. Then the code.py stops with an error and doesn't even get to download the artwork.

jliu70
 
Posts: 64
Joined: Wed Oct 21, 2020 9:27 pm

Re: Pyportal Nasa Photo of the day

by jliu70 on Sun Mar 14, 2021 11:02 am

So after playing with it some more, I think this may be related to the Adafruit IO service which is being called to convert the images from JPG to BMP16.

In addition to the error code 422, I received an error 429.
Code: Select all | TOGGLE FULL SIZE
HttpError: Code 422: Unprocessable Entity


Code: Select all | TOGGLE FULL SIZE
Retrieving data...Reply is OK!
original URL: https://openaccess-cdn.clevelandart.org/1940.672/1940.672_web.jpg
convert URL: https://io.adafruit.com/api/v2/jliu70/integrations/image-formatter?x-aio-key=secretKey&width=480&height=305&output=BMP16&url=https://openaccess-cdn.clevelandart.org/1940.672/1940.672_web.jpg
Fetching stream from https://io.adafruit.com/api/v2/jliu70/integrations/image-formatter?x-aio-key=secretKey&width=480&height=305&output=BMP16&url=https://openaccess-cdn.clevelandart.org/1940.672/1940.672_web.jpg
Traceback (most recent call last):
  File "code.py", line 58, in <module>
  File "code.py", line 47, in <module>
  File "adafruit_pyportal.py", line 1106, in fetch
  File "adafruit_pyportal.py", line 1103, in fetch
  File "adafruit_pyportal.py", line 1083, in fetch
  File "adafruit_pyportal.py", line 1077, in fetch
  File "adafruit_pyportal.py", line 781, in wget
HttpError: Code 429: Too Many Requests



So the API call is for the "Fetching stream from ....." line.

When I attempt to call the URL directly in the browser, I receive the following:

Code: Select all | TOGGLE FULL SIZE
{"error":"request failed - failed to load and process image"}



And if I call too frequently, since I'm still on the free Tier, I get the error that I have made too many requests:

Code: Select all | TOGGLE FULL SIZE
{"error":"request failed - you have exceeded the rate limit of 1 request per 60 seconds, please wait before making another request"}


If I call the original URL from the Cleveland Museum of Art within the browser, it still works.

Code: Select all | TOGGLE FULL SIZE
https://openaccess-cdn.clevelandart.org/1940.672/1940.672_web.jpg


So since fetching the original Cleveland Museum of Art image image works, and that this is also affecting NASA Photo of the Day, that implies that there could be something wrong with the AIO conversion to BMP16 service.

Not sure if someone at Adafruit can help check and see if that's the case?

Thanks!

jliu70
 
Posts: 64
Joined: Wed Oct 21, 2020 9:27 pm

Re: Pyportal Nasa Photo of the day

by jwcooper on Mon Mar 15, 2021 6:10 pm

Hi, could you give this a try again? This service should be repaired now.

Thanks!

Justin

jwcooper
 
Posts: 802
Joined: Tue May 01, 2012 9:08 pm

Re: Pyportal Nasa Photo of the day

by jliu70 on Mon Mar 15, 2021 7:11 pm

Confirm that it works. Thanks!

jliu70
 
Posts: 64
Joined: Wed Oct 21, 2020 9:27 pm

Re: Pyportal Nasa Photo of the day

by NeutralDensity on Mon Mar 15, 2021 7:40 pm

I can confirm the Cleveland Museum of Art demo and the New New New demo both work for me again. Yeah!!

Thank you jliu70 for all of your troubleshooting!

And thank you jwcooper for coming up with the fix.
Last edited by NeutralDensity on Mon Mar 15, 2021 7:42 pm, edited 1 time in total.

NeutralDensity
 
Posts: 7
Joined: Sat Feb 23, 2019 5:44 pm

Re: Pyportal Nasa Photo of the day

by saltpoint3289 on Mon Mar 22, 2021 12:42 am

Thank you for that fix. All is well.

saltpoint3289
 
Posts: 9
Joined: Thu Jan 31, 2019 10:47 pm

Please be positive and constructive with your questions and comments.