Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By Henning
#61408 I reduced your code to a simple tcp open/close - test:

Code: Select allvoid loop()
{
  WiFiClient client;

  client.connect(host, 80);
  client.stop();
}

I don`t know a reason why this is crashing after a few seconds (~30s) ? Possibly someone else can help us ?
User avatar
By Henning
#61420 Hi pablo,
I assumed the TIME_WAIT problem too and already did a netstat-a on my server ... but the number of connections in TIME_WAIT status was not so high.

But you are right ... the heap decreases in every round :

Code: Select all2344
2160
2096
1792
1608
1424
1360
1056
992
808
504
440
136
Exception (29):
epc1=0x4000e1c3 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000018 depc=0x00000000

ctx: sys
sp: 3ffffc80 end: 3fffffb0 offset: 01a0

>>>stack>>>
3ffffe20:  4010235d 3ffec758 3ffed8a0 00000014 
3ffffe30:  4020db01 4020da3e 3fff036c 401024ec 
3ffffe40:  00000018 3ffed1a8 3ffed124 00000000 
3ffffe50:  4020db9c 3ff20a00 3fff036c 3ffe95e6 
3ffffe60:  3ffe95cc 3ffe9570 3ffe9570 3ffe95cc 


Do you have an idea about what happens here ?
User avatar
By Pablo2048
#61425 Hmm, I'm not sure, but try to move WiFiClient client; to global section (probably this will not help, but confirms that there is something inside tcp stack left on heap). Then replace .stop() with abort() from ClientContext class. Maybe this help...