0

Debugging incomplete returned from weather api
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Debugging incomplete returned from weather api

by scottcall925 on Mon Apr 22, 2019 6:41 pm

Apologies for cross posting but my posting on the products section (viewtopic.php?f=60&t=150260) has not received any replies so I wanted to follow up here.

As my original posting said, I'm adapting the demo code for the pyportal to use the dark skies adafruit.io weather api and so far it seems to be working.

The problem I'm running into is that anywhere from 25-75% of the API calls return truncated JSON. (that then fails to load with a json.loads call)

I'm trying to determine if the fault is in the PyPortal (either in the library doing the HTTP fetch or circuitpython itself) or at the API end.

Is there any way to debug this further from the API end?

Thanks!

scottcall925
 
Posts: 3
Joined: Wed Apr 10, 2019 1:30 pm

Re: Debugging incomplete returned from weather api

by brubell on Thu Apr 25, 2019 9:58 am

This is an issue in the PyPortal library, not Adafruit IO's API. It uses a library called ESP32SPI (https://github.com/adafruit/Adafruit_Ci ... n_ESP32SPI) to fetch the JSON which may not have a large enough receive buffer for the DarkSkies response and is returning a truncated JSON as a result.

Could you post up on the issues repository for this library: https://github.com/adafruit/Adafruit_Ci ... SPI/issues

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

Re: Debugging incomplete returned from weather api

by scottcall925 on Thu Apr 25, 2019 8:46 pm

Thanks! I'll collect some info and open an issue tonight or tomorrow when I get a chance.

scottcall925
 
Posts: 3
Joined: Wed Apr 10, 2019 1:30 pm

Please be positive and constructive with your questions and comments.