-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Description
Basic Infos
- This issue complies with the issue POLICY doc.I have read the documentation at readthedocs and the issue is not addressed there.I have tested that the issue is present in current master branch (aka latest git).I have searched the issue tracker for a similar issue.If there is a stack dump, I have decoded it.I have filled out all fields below.To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Platform
- Hardware: [nodeMCU dev board rev3]
- Core Version: 2.5.2 (from added logs)
- Development Env: [Arduino IDE]
- Operating System: [MacOS]
Settings in IDE
- Module: [Nodemcu]
- Flash Mode: [don't know]
- Flash Size: [4MB]
- lwip Variant: [v2 Lower Memory]
- Reset Method: [nodemcu]
- Flash Frequency: [40Mhz]
- CPU Frequency: [80Mhz]
- Upload Using: [SERIAL]
- Upload Speed: [115200] (serial upload only)
Problem Description
Board crashed when code reaching
String payload = http.getString();
Problem occurs when requesting GET from this host: http://192.168.8.218 - this is my stove webserver. For 1 month it was ok but now i cannot getting response. Other host working properly. I tried to change IP of webserver - nothing changed.
Tell me, what needs to happen for getString() method to crash and reboot board ?
In addtion, response from webserver is correct. All packets and whole response is ok.
MCVE Sketch
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClient.h>
ESP8266WiFiMulti WiFiMulti;
void setup() {
Serial.begin(115200);
// Serial.setDebugOutput(true);
Serial.println();
Serial.println();
Serial.println();
for (uint8_t t = 4; t > 0; t--) {
Serial.printf("[SETUP] WAIT %d...\n", t);
Serial.flush();
delay(1000);
}
WiFi.mode(WIFI_STA);
WiFiMulti.addAP("ABC", "DEF");
}
void loop() {
// wait for WiFi connection
if ((WiFiMulti.run() == WL_CONNECTED)) {
WiFiClient client;
HTTPClient http;
Serial.print("[HTTP] begin...\n");
if (http.begin(client, "http://192.168.8.218")) { // HTTP
Serial.print("[HTTP] GET...\n");
// start connection and send HTTP header
int httpCode = http.GET();
// httpCode will be negative on error
if (httpCode > 0) {
// HTTP header has been send and Server response header has been handled
Serial.printf("[HTTP] GET... code: %d\n", httpCode);
// file found at server
if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {
String payload = http.getString();
Serial.println(payload);
}
} else {
Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
}
http.end();
} else {
Serial.printf("[HTTP} Unable to connect\n");
}
}
delay(10000);
}
Debug Messages
Decoding stack results
0x4021850c: mem_malloc at core/mem.c line 210
0x40206e3c: malloc(size_t) at /Users/mateuszmanaj/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/umm_malloc/umm_malloc.cpp line 1677
0x40210fac: lwip_cyclic_timer at core/timeouts.c line 233
0x4021850c: mem_malloc at core/mem.c line 210
0x4020f8e8: do_memp_malloc_pool at core/memp.c line 254
0x4020f924: memp_malloc at core/memp.c line 356
0x40210f51: sys_timeout_abs at core/timeouts.c line 189
0x40210fac: lwip_cyclic_timer at core/timeouts.c line 233
0x40210fdf: lwip_cyclic_timer at core/timeouts.c line 261
0x4020f94e: memp_free at core/memp.c line 447
0x40211154: sys_check_timeouts at core/timeouts.c line 390
0x4020551f: loop_task(ETSEvent*) at /Users/mateuszmanaj/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/core_esp8266_main.cpp line 133
0x4020f221: glue2esp_linkoutput at glue-esp/lwip-esp.c line 299
0x4020f4a3: new_linkoutput at glue-lwip/lwip-git.c line 235
0x4020f894: ethernet_output at netif/ethernet.c line 312
0x4021702c: etharp_output_LWIP2 at core/ipv4/etharp.c line 885
0x4020555a: esp_yield() at /Users/mateuszmanaj/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/core_esp8266_main.cpp line 88
0x40213dfd: tcp_output_alloc_header at core/tcp_out.c line 1863
0x40214750: tcp_send_empty_ack at core/tcp_out.c line 2057
0x4021483e: tcp_output at core/tcp_out.c line 1319
0x402046c4: String::copy(char const*, unsigned int) at /Users/mateuszmanaj/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/WString.cpp line 211
0x40205564: esp_yield() at /Users/mateuszmanaj/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/core_esp8266_main.cpp line 91
0x40205564: esp_yield() at /Users/mateuszmanaj/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/core_esp8266_main.cpp line 91
0x40205646: __yield() at /Users/mateuszmanaj/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/core_esp8266_main.cpp line 100
0x4020430d: Stream::timedRead() at /Users/mateuszmanaj/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/Stream.cpp line 37
0x4020434b: Stream::readBytes(char*, unsigned int) at /Users/mateuszmanaj/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/Stream.cpp line 211
0x40207380: Stream::readBytes(unsigned char*, unsigned int) at /Users/mateuszmanaj/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/Stream.h line 92
0x40203528: HTTPClient::writeToStreamDataBlock(Stream*, int) at /Users/mateuszmanaj/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp line 1376
0x402035b0: HTTPClient::writeToStream(Stream*) at /Users/mateuszmanaj/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp line 925
0x40204704: String::String(char const*) at /Users/mateuszmanaj/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/WString.cpp line 36
0x40203d7e: HTTPClient::getString() at /Users/mateuszmanaj/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp line 1010
0x4020117f: loop() at /Users/mateuszmanaj/Documents/Arduino/BasicHttpClient/BasicHttpClient.ino line 62
0x402018ac: ESP8266WiFiMulti::addAP(char const*, char const*) at /Users/mateuszmanaj/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.cpp line 39
0x40205614: loop_wrapper() at /Users/mateuszmanaj/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/core_esp8266_main.cpp line 125
Metadata
Metadata
Assignees
Labels
No labels
Activity
devyte commentedon Oct 29, 2019
Why isn't the stack decoded? Please decode it and add it above.
MateuszManaj commentedon Oct 29, 2019
I do not know how :)
devyte commentedon Oct 29, 2019
Just google "decode esp8266 stack". Also, readthedocs.
MateuszManaj commentedon Oct 29, 2019
Ok, thank you. I edited issue. Is this memory leak ?
devyte commentedon Oct 29, 2019
You said:
But from your stack dump, you're using core v2.5.2.
Retesting with latest git is needed before this can be looked at further, because there have been several issues fixed, including interrupt and String issues. In other words, it makes no sense to look at this if the issue is already fixed in the latest code base.
Instructions for installing latest git are in readthedocs.
I am closing for now. If you find more information, please post it here and we can continue to discuss.
MateuszManaj commentedon Oct 30, 2019
@devyte ok, thank you for instructions.
I've updated already ESP8266 lib and there is my another decoded exception stack:
Can you help me with this ?
devyte commentedon Oct 30, 2019
How big is the resource you're trying to GET?
MateuszManaj commentedon Oct 30, 2019
It's very small ~25kb
MateuszManaj commentedon Oct 30, 2019
I must add that this module works perfectly for about 2-3 months and suddenly stopped working (of course on previous git version of board). I tested this code on other same nodeMCU's but nothing change. This is very strange.
The only thing could change is my stove webserver but i do not see any strange notation or differencies. Also head od this document is ok. There is no special signs in code and encoding is UTF-8 wo. BOM.
devyte commentedon Oct 30, 2019
25KB is most definitely NOT very small, it's about half the total amount of available heap of an empty sketch, and yours is not an empty sketch.
My guess is you're oom. Please check available heap right before the call to getString().
MateuszManaj commentedon Oct 30, 2019
Sorry, it's 2.9 - 3.1 kb.
What OOM stands for ?
MateuszManaj commentedon Oct 30, 2019
Ok, I have Exception 3 which stands for: LoadStoreErrorCause
Processor internal physical address or data error during load or store
Free heap before getString() is: 50864
devyte commentedon Oct 30, 2019
3KB should be ok, then I don't think it's oom (out of memory).
I think the only thing missing are the headers sent with your resource. Can you figure out how to get them and post them here? I think that should be enough info for someone to investigate.
MateuszManaj commentedon Oct 30, 2019
Response Headers:
Maybe you reopen this issue ?
19 remaining items