Report Bugs Here

Moderator: Mmiscool

User avatar
By cicciocb
#41283 Hi Mmiscool,
I'm just playing around with your latest version (1.81) and I discovered that, each time the wget() function is called, there are around 200 bytes of memory gone; this cause the ESP to crash after a while.
Looking inside your code, I discovered that the problem comes from the function FetchWebUrl() that, in turns, calls the function client.connect(), where the leak is generated.
Searching on internet, I discovered that there is a patch available on the framework; in particular the file "ClientContext.h" in the framework needs to be patched as below :
Code: Select allline 64 err = tcp_close(_pcb);
line 65 tcp_abort(_pcb); // that line needs to be included //
line 66 if(err != ERR_OK) {
line 67 DEBUGV(":tc err %d\r\n", err);
line 68 tcp_abort(_pcb);
line 69 err = ERR_ABRT;


That file is located at :
C:\Documents and Settings\YOUR_NAME\Application Data\Arduino15\packages\esp8266\hardware\esp8266\2.0.0-rc1\libraries\ESP8266WiFi\src\include

You can find all the details here :
http://www.esp8266.com/viewtopic.php?f=28&t=3003&start=8

Hope you can include this into your next version.

Regards,
Cicciocb
User avatar
By Mmiscool
#41327 just tried this. still seem to have the same problem. hmmm
User avatar
By psc-esp8266
#45004 To me it seems this bug is still present at version Basic 2.0.Alpha 7
I have done some logging (1 call per minute) and quite constantly each wget call waists between 240-258 byte of memory.
It crashes the unit after 12 calls (or when freeram() memory drops below 15600).
Can anybody confirm this bug is considered to be fixed? If so I might look into the command I used:
let OPString = "api.thingspeak.com/update?api_key=xxxxxxxxxxx&field1=" & t & s & u & DevID & "&field5=" & Uptime
let w = wget(OPString)
You do not have the required permissions to view the files attached to this post.