Comments on: ESP8266 Weather Forecaster https://randomnerdtutorials.com/esp8266-weather-forecaster/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Sat, 31 Aug 2024 15:40:13 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Hans harbeck https://randomnerdtutorials.com/esp8266-weather-forecaster/#comment-952872 Sat, 31 Aug 2024 15:40:13 +0000 http://randomnerdtutorials.com/?p=43469#comment-952872 This did work for me a long time.
But since a month or two it only says “Connecting to server” and no more.
What must I do?

]]>
By: Ed https://randomnerdtutorials.com/esp8266-weather-forecaster/#comment-874541 Mon, 27 Nov 2023 13:55:14 +0000 http://randomnerdtutorials.com/?p=43469#comment-874541 I know this is already an old post, but I stumbled upon it as I needed a quick API call to OWM. As stated in one of the comments, this code could be a bit simpler with rtegard to the http request as well as with the json parser.
Foolish as I am, I first tried ‘converting’ the code to ArduinoJson6, but decided it would be simpler to just start from scratch.
It is a quick and simple (quick and dirty) code that pulls the items I need and that works with ArduinoJson version 6. Though I do not need it, I added the ‘weather id” that the code in this article relies upon to light op the LED’s. So if that is all one needs, it is simple to add the LEDs in the program.
The http request in my program uses London, GB as place to sample, so when using it one would need to change it to another location, also one needs to add one’s own apiKey as well as SSID and PW.
Location and apikey all need to be put directly in the request url. I did not bother to build it from variables as I was in a hurry…and do not need it.
The program can be found here: https://gitlab.com/diy_bloke/openweathermap/

]]>
By: Ed https://randomnerdtutorials.com/esp8266-weather-forecaster/#comment-874528 Mon, 27 Nov 2023 12:24:20 +0000 http://randomnerdtutorials.com/?p=43469#comment-874528 For those having problems with converting to JSON6. There is an assistent that can generate the right code for you:
https://arduinojson.org/v6/assistant/#/step1

]]>
By: Ed https://randomnerdtutorials.com/esp8266-weather-forecaster/#comment-874392 Sun, 26 Nov 2023 18:09:24 +0000 http://randomnerdtutorials.com/?p=43469#comment-874392 In reply to Michael Shu.

Michael,
Given that you gave your reply in 2019, I guess that is still for the ArduinJson version 5 library.
I think that for the ArduinoJson library, the entite parse section can be replaced by the following:

DynamicJsonDocument jsonDocument(capacity);
// Parse JSON
DeserializationError error = deserializeJson(jsonDocument, json);

// Check for parsing errors
if (error) {
Serial.print(“Error parsing JSON: “);
Serial.println(error.c_str());
return;
}

// Access the “id” value within the first element of the “weather” array

int list_1_weather_0_id = jsonDocument[“list”][0][“weather”][0][“id”];

I think the reading of the JSON can be simplified too (as was suggested before) by
c=client.readStringUntil(‘\n’);
but I have not tried that

]]>
By: Sara Santos https://randomnerdtutorials.com/esp8266-weather-forecaster/#comment-802929 Tue, 13 Dec 2022 20:13:45 +0000 http://randomnerdtutorials.com/?p=43469#comment-802929 In reply to Steven Elves.

Please make sure you have version 5 of the ArduinoJson library so that it is compatible with this code.
Regards,
Sara

]]>
By: Steven Elves https://randomnerdtutorials.com/esp8266-weather-forecaster/#comment-802119 Sun, 11 Dec 2022 06:19:02 +0000 http://randomnerdtutorials.com/?p=43469#comment-802119 I get the following message:

DynamicJsonBuffer is a class from ArduinoJson 5. Please see https://arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6

Can you advise how to fix this? The link they provide is not particularly helpful.

Thank you.

]]>
By: Ted https://randomnerdtutorials.com/esp8266-weather-forecaster/#comment-649190 Tue, 20 Jul 2021 21:42:31 +0000 http://randomnerdtutorials.com/?p=43469#comment-649190 In reply to Ethan Tabler.

Thanks, Ethan. Two years later and it still works great!

]]>
By: Ruben Cretegny https://randomnerdtutorials.com/esp8266-weather-forecaster/#comment-614252 Tue, 25 May 2021 17:53:39 +0000 http://randomnerdtutorials.com/?p=43469#comment-614252 In reply to ULi.

Hello ULi,
You made my day ! Thank you
Ruben

]]>
By: Mark https://randomnerdtutorials.com/esp8266-weather-forecaster/#comment-460780 Wed, 27 May 2020 12:47:59 +0000 http://randomnerdtutorials.com/?p=43469#comment-460780 In reply to Michael Shu.

Thank you Michael. You fixed it all !!!

Works great now to adjust it for all those new status codes. Thinking of testing ranges of weather codes instead.

]]>
By: Åskar Andersson https://randomnerdtutorials.com/esp8266-weather-forecaster/#comment-371344 Sun, 09 Jun 2019 07:24:12 +0000 http://randomnerdtutorials.com/?p=43469#comment-371344 In reply to Michael Shu.

Thank you for this! However it seems to pull data every second, can I make it do it perhaps once a minute or so?

]]>