Skip to content
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

[HTTP] lost in client with a timeout #209

Open
louisvarley opened this issue Dec 10, 2022 · 3 comments
Open

[HTTP] lost in client with a timeout #209

louisvarley opened this issue Dec 10, 2022 · 3 comments

Comments

@louisvarley
Copy link

louisvarley commented Dec 10, 2022

Expected behavior

Downloading of Forecast Data

Actual behavior

I've been using this library in a project for some time, unsure if due to a change at OpenWeather but suddenly i get
[HTTP] lost in client with a timeout and box restarts,

Test code

My Get Data Code here, current weather is fine, but Forecast will always fail, i'm only doing a max of 3 days

void getWeatherData()                             
{
 
  Serial.println("Getting Weather from OpenWeather");  

  Serial.println("Getting Current Forecast from OpenWeather"); 
  currentWeatherClient.setMetric(IS_METRIC);
  currentWeatherClient.setLanguage(OPEN_WEATHER_MAP_LANGUAGE);
  currentWeatherClient.updateCurrentById(&currentWeather, OPEN_WEATHER_MAP_APP_ID, OPEN_WEATHER_MAP_LOCATION_ID);

  Serial.println("Getting Future Forecast from OpenWeather"); 

  forecastClient.setMetric(IS_METRIC);
  forecastClient.setLanguage(OPEN_WEATHER_MAP_LANGUAGE);
  uint8_t allowedHours[] = {0,12};
  forecastClient.setAllowedHours(allowedHours, 2);
  uint8_t foundForecasts = forecastClient.updateForecastsById(forecasts, OPEN_WEATHER_MAP_APP_ID, OPEN_WEATHER_MAP_LOCATION_ID, MAX_FORECASTS);

  Serial.println("Done Getting Weather from OpenWeather"); 
  
}

Changing this in OpenWeatherMapForecast.cpp and it runs as expected again

unsigned long lostTest = 20000UL;

I know that the speed it will be downloading the JSON response would be due to speed of WiFi / Internet, i have Ubiquti APs, Fibre and ESP8266 is in the same room as an AP. Started very suddenly about a week ago

Maybe make it so we can change this value outside of the library?

Weather Station version

Master

Hardware

Custom Hardware, a Clone ESP8266, with a matrix display

@marcelstoer
Copy link
Member

We sure would object to a PR making the OWM HTTP timeout - that's what the oddly named lostTest really is - available as a user setting with a sensible default.

@marcelstoer
Copy link
Member

We sure would object

Oh bummer, only just noticed. That should of course be "would NOT object".

@louisvarley
Copy link
Author

louisvarley commented Jan 19, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants