if (!TcpServerClient.connected()) {
TcpServerClient = TcpServer.available();
} else {
Serial.println("Incoming connection");
while (TcpServerClient.connected())
{
Serial.println("Connection available");
while (TcpServerClient.available())
{
Serial.println("Receiving incomming TCP packet");
TcpServerClient.read(TCPpacketBuffer, TCP_TX_PACKET_MAX_SIZE);
None of the Serial.println's get displayed upon the initial connection, only when receiving a complete data packet.
I found a project on GitHub to implement sockets https://github.com/i-n-g-o/esp-socket/tree/master/examples/esp8266ServerCallbacks but to get it to work like it is, is way over my head ...
Does someone know if there's a callback or something similar to: server.onConnected() ?
Attached is a screenshot of the sequence.