🎁📬❄️📦 Holiday Shipping Deadlines are approaching! International customers and domestic ground - get your orders in 12/9/2020 📦❄️📬🎁
0

Showing AIO data on a Pyportal
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Re: Showing AIO data on a Pyportal

by brubell on Tue Oct 13, 2020 10:11 am

HarpDude wrote:I'm also seeing this error when using the PyPortal library's push_to_io() function.


adafruit-circuitpython-bundle-6.x-mpy-20201009
Adafruit CircuitPython 6.0.0-beta.2 on 2020-10-05; Adafruit PyPortal with samd51j20


You may want to try downgrading to the Adafruit circuitpython requests library version 1.6.0, requests.get isn't working in the latest build. I'd also downgrade from CircuitPython 6.0 beta to 5.3.1 stable

brubell
 
Posts: 1116
Joined: Fri Jul 17, 2015 10:33 pm

Re: Showing AIO data on a Pyportal

by HarpDude on Tue Oct 13, 2020 11:53 am

Thank you brubell. Do you have a link to that version handy?

FYI, I also tested it with the latest 5.3.1 distribution. Confirmed the same issue.

HarpDude
 
Posts: 180
Joined: Mon Dec 07, 2015 2:52 am

Re: Showing AIO data on a Pyportal

by HarpDude on Tue Oct 13, 2020 3:26 pm

It looks like the version that was included in the 5.3.0 2020-06-23 bundle is working nicely. Thanks!

HarpDude
 
Posts: 180
Joined: Mon Dec 07, 2015 2:52 am

Re: Showing AIO data on a Pyportal

by axelmagnus on Tue Oct 20, 2020 3:17 pm

HarpDude wrote:I'm also seeing this error when using the PyPortal library's push_to_io() function.


adafruit-circuitpython-bundle-6.x-mpy-20201009
Adafruit CircuitPython 6.0.0-beta.2 on 2020-10-05; Adafruit PyPortal with samd51j20


Could you share your code? Has anything changed with the recent the release of 6.0.0 candidate?

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

Re: Showing AIO data on a Pyportal

by HarpDude on Tue Oct 20, 2020 11:27 pm

Here's an extract of the code that instantiates the pyportal class and its push_to_io() function. Regardless of the surrounding code, it fails when using push_to_io.

Code: Select all | TOGGLE FULL SIZE
# Import the PyPortal class; includes ESP32 and IO_HTTP client modules
import adafruit_pyportal as pp

# Instantiate the PyPortal class
pyportal = pp.PyPortal(url=ADAFRUIT_IO_DATA_SOURCE,
                       json_path=ADAFRUIT_IO_DATA_LOCATION,
                       status_neopixel=pp.board.NEOPIXEL,
                       default_bg=0x000000)

pyportal.push_to_io(SHOP_HUMIDITY, humidity)


No, I haven't had the time to check it against the latest candidate or bundle, but hope to in the next few days after the project's sensors are received.

HarpDude
 
Posts: 180
Joined: Mon Dec 07, 2015 2:52 am

Re: Showing AIO data on a Pyportal

by brubell on Wed Oct 21, 2020 11:08 am

HarpDude wrote:Thank you brubell. Do you have a link to that version handy?

FYI, I also tested it with the latest 5.3.1 distribution. Confirmed the same issue.

Yes, please remove the Requests library from your lib folder and replace it with this one

https://github.com/adafruit/Adafruit_Ci ... /tag/1.6.0

brubell
 
Posts: 1116
Joined: Fri Jul 17, 2015 10:33 pm

Re: Showing AIO data on a Pyportal

by HarpDude on Thu Oct 22, 2020 12:33 am

Thank you!

HarpDude
 
Posts: 180
Joined: Mon Dec 07, 2015 2:52 am

Re: Showing AIO data on a Pyportal

by brubell on Fri Oct 23, 2020 9:57 am

HarpDude wrote:... and adafruit-circuitpython-bundle-6.x-mpy-20201010

Could you try replacing the Requests library on your device with this version of the library?
https://github.com/adafruit/Adafruit_Ci ... /tag/1.6.0

brubell
 
Posts: 1116
Joined: Fri Jul 17, 2015 10:33 pm

Re: Showing AIO data on a Pyportal

by HarpDude on Fri Oct 23, 2020 2:52 pm

I replaced the code you most recently referenced on a PyPortal running CircuitPython 6.0.0-beta.2 (2020-10-05). It worked much better than the 1.6.0 version I found; the found version would retransmit about 25% of the time. Your referenced version ran with no retransmissions during an hour of testing.

Results were the the same with CircuitPython 6.0.0-rc.0 (2020-10-20) and the latest bundle (sans the bundled Requests library, of course).

Thank you for your help Brent. This puts the workshop corrosion monitor project back on track just in time for the seasonal change when the corrosion potential increases dramatically.

BTW, it would be extremely useful to have a companion pyportal.pull_from_io(feed) function to retrieve a feed's latest data point. Would an addition like that be possible?

HarpDude
 
Posts: 180
Joined: Mon Dec 07, 2015 2:52 am

Please be positive and constructive with your questions and comments.