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

Moderator: igrr

User avatar
By Denisio
#24732 I write simple project, connect to WIFI and open TCP connection to my computer (I wrote also small console TCP server).

Code: Select allvoid loop()
{
   TCPCheckCommands();
   delay(50);
   ESP.wdtFeed();
}
...
bool TCPCheckConnection() {
   if (!WIFICheckConnection()) return false; // no wifi available
   if (client.connected()) return true; // already connected
   
   Serial.print("TCP: No connection, trying connect to host [" + HOST + "]");
   char host[EEPROM_CONFIG_HOST_LENGTH];
   HOST.toCharArray(host, sizeof(host));
   Serial.println();
   int lastResult = client.connect(host, HOST_PORT);
   if (lastResult) Serial.println("TCP: Connected to host");
   else {
      Serial.println("TCP: No connection to host");
      client.stop();
   }
   return lastResult;
}


I TCP server not running, I have console output:

Check commands
TCP: No connection, trying connect to host [192.168.0.10]
TCP: No connection to host
Check commands
TCP: No connection, trying connect to host [192.168.0.10]
TCP: No connection to host
Check commands
TCP: No connection, trying connect to host [192.168.0.10]
TCP: No connection to host

Exception (9):
epc1=0x40101822 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000003 depc=0x00000000

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

>>>stack>>>
3fffff00: 00000001 00000000 4020194c 000000fa
3fffff10: 3ffea134 3fff5410 3ffecf41 3ffecf5b
3fffff20: 4020bbf2 00000000 3ffe99d0 40203ae1
3fffff30: 3ffec444 4010198b 00000000 3ffeb9a4
3fffff40: 00000001 00000000 40217edf 3ffebdd8
3fffff50: 3fffdcb0 00000000 3ffe99d0 40203bf9
3fffff60: 40217f48 3ffec444 00000000 3ffebdd8
3fffff70: 3fffdcb0 00000000 3ffe99d0 40202757
3fffff80: 402124ee 00000000 3fff5068 402124bb
3fffff90: 4021250e 3fffdab0 3ffeb22c 402020f1
3fffffa0: 40000f49 3fffdab0 3fffdab0 40000f49
<<<stack<<<

ets Jan 8 2013,rst cause:2, boot mode:(1,3)


How I can check connection and how I can establish TCP connection to my server? I look to wireshark and found [RST,ACK] immediately packets on SYN packet received.

And I have some queestions:

Why exception occured? What wrong? I play with delay period, but no solution found.
How I can check server alive?
How I can setup keepalive packets and is current SDK support this feature (without AT commands)?

Another questions:

If I call "available" method of WiFiClient (connection successfully established) too often (3-5 times per second) I also have exception after some seconds of working. Is WiFiClient stable and working?