Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

PyPortal Learning Guides internet code fail
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PyPortal Learning Guides internet code fail

by gmeader on Sat Sep 19, 2020 8:06 pm

I am trying to get code from the PyPortal Learning Guides working.
On a Titano.
I am running unchanged CircuitPython code from the zip files referenced in each Learning Guide.
The code that is failing is related to Internet access - typically in the adafruit_pyportal.mpy module.
I have tried this with both the 5.3.1 and 6.0.0-alpha.3 UF2 files loaded (with the latest appropriate versions of the libraries loaded into the CIRCUITPY /lib folder)

adafruit-circuitpython-bundle-5.x-mpy-20200810/examples/esp32spi_simpletest.py works fine.
adafruit-circuitpython-bundle-6.x-mpy-20200919/examples/esp32spi_simpletest.py works fine.

Code from the following Learning Guides fail:
Pyportal_Cutefuzz
PyPortal_Tides
Pyportal_AirQuality (works sometimes)
PyPortal_CMA_Art_Frame
PyPortal_NASA

I tried this on several different WiFi networks.

Has this stuff been tested recently? Or do I have a hardware problem?

Here are a couple of typical error reports:

Code: Select all | TOGGLE FULL SIZE
ESP firmware: bytearray(b'1.6.1\x00')
Set background to  /background_480.bmp
retrieving url: https://openaccess-api.clevelandart.org/api/artworks?cc0=1&has_image=1&indent=2&limit=1&skip=8789
Connecting to AP MySpectrumWiFi92-2G
Retrieving data...Socket missing recv_into. Using more memory to be compatible
Reply is OK!
image dim: 564 900
original URL: https://openaccess-cdn.clevelandart.org/1964.40.225.a/1964.40.225.a_web.jpg
convert URL: https://io.adafruit.com/api/v2/gmeader/integrations/image-formatter?x-aio-key=<secret>&width=193&height=305&output=BMP16&url=https://openaccess-cdn.clevelandart.org/1964.40.225.a/1964.40.225.a_web.jpg
Fetching stream from https://io.adafruit.com/api/v2/gmeader/integrations/image-formatter?x-aio-key=<secret>&width=193&height=305&output=BMP16&url=https://openaccess-cdn.clevelandart.org/1964.40.225.a/1964.40.225.a_web.jpg
Socket missing recv_into. Using more memory to be compatible
An error occured, retrying! - content-length


or

Code: Select all | TOGGLE FULL SIZE
code.py output:
ESP firmware: bytearray(b'1.6.1\x00')
Connecting to AP MySpectrumWiFi92-2G
Set background to  0
Retrieving data...Socket missing recv_into. Using more memory to be compatible
Reply is OK!
original URL: https://apod.nasa.gov/apod/image/2009/Orion3Ddavison1024.jpg
convert URL: https://io.adafruit.com/api/v2/gmeader/integrations/image-formatter?x-aio-key=<secret>&width=320&height=240&output=BMP16&url=https://apod.nasa.gov/apod/image/2009/Orion3Ddavison1024.jpg
Fetching stream from https://io.adafruit.com/api/v2/gmeader/integrations/image-formatter?x-aio-key=<secret>&width=320&height=240&output=BMP16&url=https://apod.nasa.gov/apod/image/2009/Orion3Ddavison1024.jpg
An error occurred, retrying in 60 seconds - wget didn't write a complete file
Last edited by tannewt on Mon Sep 21, 2020 1:55 pm, edited 1 time in total.
Reason: remove aio keys

gmeader
 
Posts: 16
Joined: Sun Dec 06, 2015 6:25 pm

Re: PyPortal Learning Guides internet code fail

by tannewt on Mon Sep 21, 2020 1:58 pm

Hi gmeader,
I did a large change to Adafruit_Requests that was released as 1.7.0. Please try an older version of that. I know it's broken with CircuitPython 5.3.1 but expect it to work with the latest 6.0.0 alpha. (I have a fix that I hope to check in today for 5.3.1 incompatibility.)

You included your Adafruit IO in your output. I edited it out but you'll want to regenerate the key in case someone else copied it already.
~Scott

tannewt
 
Posts: 1837
Joined: Thu Oct 06, 2016 8:48 pm

Re: PyPortal Learning Guides internet code fail

by gmeader on Mon Sep 21, 2020 2:17 pm

Thanks, Scott.
I’m hoping someone tests these Learning Guide projects as part of the CircuitPython 6 release process.

At least a simple test using wget to fetch a few large files (maybe over 1MB) and store them on the SD card should be part of your test suite?

gmeader
 
Posts: 16
Joined: Sun Dec 06, 2015 6:25 pm

Re: PyPortal Learning Guides internet code fail

by axelmagnus on Tue Sep 22, 2020 4:38 pm

gmeader wrote:Thanks, Scott.
I’m hoping someone tests these Learning Guide projects as part of the CircuitPython 6 release process.

At least a simple test using wget to fetch a few large files (maybe over 1MB) and store them on the SD card should be part of your test suite?



We succesfully got PP_tides & graphical working today by using everything 6.0.0. but reverting to

https://github.com/adafruit/Adafruit_Ci ... /tag/1.6.0 (would be from adafruit-circuitpython-bundle-6.x-mpy-20200917) .

axelmagnus
 
Posts: 13
Joined: Thu Oct 20, 2016 5:20 pm

Re: PyPortal Learning Guides internet code fail

by axelmagnus on Tue Sep 22, 2020 5:01 pm

this row need to be changed (to this) as well
DATA_SOURCE = "https://api.tidesandcurrents.noaa.gov:443/api/prod/datagetter?date=today&product=predictions&datum=mllw&format=json&units=metric&time_zone=lst_ldt&station=9447130"

and get rid of refresh.soon

axelmagnus
 
Posts: 13
Joined: Thu Oct 20, 2016 5:20 pm

Please be positive and constructive with your questions and comments.