. Variables and constants in RAM (global, static), used 28700 / 80192 bytes (35%)
║ SEGMENT BYTES DESCRIPTION
╠══ DATA 1512 initialized variables
╠══ RODATA 1428 constants
╚══ BSS 25760 zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 59747 / 65536 bytes (91%)
║ SEGMENT BYTES DESCRIPTION
╠══ ICACHE 32768 reserved space for flash instruction cache
╚══ IRAM 26979 code in IRAM
. Code in flash (default, ICACHE_FLASH_ATTR), used 260324 / 1048576 bytes (24%)
║ SEGMENT BYTES DESCRIPTION
╚══ IROM 260324 code in flash
Is there a question?
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <ArduinoJson.h>
const char* ssid = "Good";
const char* password = "sangjin8820";
const char* apiKey = "d04621f6269c3d4eb007d2d26942818f";
const float lat = 37.5665; // 서울의 위도
const float lon = 126.9780; // 서울의 경도
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
}
void loop() {
if (WiFi.status() == WL_CONNECTED) {
HTTPClient http;
WiFiClient client;
String url = "https://api.openweathermap.org/data/3.0/onecall?lat=" + String(lat) + "&lon=" + String(lon) + "&appid=" + apiKey;
http.begin(client, url);
int httpCode = http.GET();
if (httpCode > 0) {
String payload = http.getString();
DynamicJsonDocument doc(1024);
deserializeJson(doc, payload);
bool willRain = false;
for (JsonObject hourly : doc["hourly"].as<JsonArray>()) {
int weatherId = hourly["weather"][0]["id"];
if (weatherId >= 200 && weatherId < 600) {
willRain = true;
break;
}
}
if (willRain) {
Serial.println("It will rain within the next 24 hours.");
} else {
Serial.println("No rain expected in the next 24 hours.");
}
} else {
Serial.println("Error on HTTP request");
}
http.end();
} else {
Serial.println("WiFi not connected");
}
delay(60000);
}
my code was this. I tried to compile this, but that error got happened.
Could you please tell me how to handle this error?
That does not look like an error.
In IDE 2.x, you should get a popup if there is an error, in IDE 1.x the bar above the output pane will turn orange/red and will have a button "Copy error messages".
Please show a error message in full
What you posted isn't an error message but an info about memory usage - even if it is printed in red.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.