OpenWeather
OpenWeather copied to clipboard
OpenWeather's One Call 3.0 API change
OpenWeather's One Call 3.0 API changed element "timezone_offset" to "timezone". The changes to OpenWeather.cpp are:
62,62c61,62 < String url = "https://api.openweathermap.org/data/3.0/onecall?lat=" + latitude + "&lon=" + longitude + "&exclude=minutely" + exclude + "&units=" + units + "&lang=" + language + "&appid=" + api_key;
String url = "https://api.openweathermap.org/data/2.5/onecall?lat=" + latitude + "&lon=" + longitude + "&exclude=minutely" + exclude + "&units=" + units + "&lang=" + language + "&appid=" + api_key; 519c518 < if (currentKey == "timezone") timezone = value;
if (currentKey == "timezone_offset") timezone = value;
I made this changes and it gives errors on ESP32-S3
The connection to server is secure (https). Certificate not checked.
Sending GET request to api.openweathermap.org port 443
Header end found
Parsing JSON
[ 8670][E][NetworkClient.cpp:319] setSocketOption(): fail on 0, errno: 9, "Bad file number"
Done in 4018 ms
I also had to change the URL String on line 61 in OpenWeather.cpp to reflect the latest version of the Onecall API, I changed 2.5 to 3.0.
// One call API now subscription
String url = "https://api.openweathermap.org/data/3.0/onecall?lat=" + latitude + "&lon=" + longitude + "&exclude=minutely" + exclude + "&units=" + units + "&lang=" + language + "&appid=" + api_key;
The URL string on line 91 should also be changed from 2.5 to 3.0.