ESP8266 - Catch incoming TCP SYN / ACK packets
Posted: Thu Jul 06, 2017 3:07 pm
Hi everyone! For a project I am looking for a way to see when I get in incoming TCP connection packet without receiving actual data. I am trying to receive data from an alarm panel and upon connection from the panel, I need to send the first packet as a reply to get transmission going.
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.
Code: Select all
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.