Skip to content

Conversation

martinmmi
Copy link

Hello, iam martin from germany and i like to develop a tcp interface for an esp32 application.

How can i start with your AsyncTCP lib 1.2.1 or the new fork for esphome AsyncTCP lib 2.0.0?

I have this tcp sequences from a tcp server:

OFF:
80 30 41 42 43 44 45 46 47 20 20 20 20 20 20 20 20 20

GREEN:
80 31 41 42 43 44 45 46 47 20 20 20 20 20 20 20 20 20

RED:
80 33 41 42 43 44 45 46 47 20 20 20 20 20 20 20 20 20

How can I evaluate this sequences in a tcp client? Are some examples availble?

Many thanks
Martin

Maurice Makaay and others added 8 commits May 5, 2021 23:56
After my first attempt at fixing the client disconnects
(OttoWinter#4) got merged
into AsyncTCP, it turned out that there was regression
for some devices: the connection stability actually went
down instead of up.

After a lot of debugging and discussion with @glmnet (some of
the results can be found in the above pull request discussion),
we came up with an improved fix for the disconnect issues.

**Changed:**

The code that checks for ACK timeouts has been simplified in
such way, that only two timestamps are now used to determine if
an ACK timeout has happened: the time of the last sent packet
(this was already recorded), and the time of the last received
ACK from the client (this has been added).

Using these timestamps, there is no more need for a separate field
to keep track if we are waiting for an ACK or not (`_pcb_busy`).
Therefore, this field was completely removed from the code.

While I was at it, I renamed a few variables to make the code
easier to read and more consistent.

**Results:**

I connected Home Assistant plus 8 OTA loggers at the same time,
using very verbose logging output. This normally was an easy way
to trigger the disconnect errors.

It turned out, this solution runs as solid for me, as when disabling
the ACK timeout checks completely
(using `AsyncClient::setAckTimeout(0)`).
Better fix for "ack timeout 4" client disconnects.
@jesserockz jesserockz deleted the branch OttoWinter:master September 1, 2023 02:20
@jesserockz jesserockz deleted the master branch September 1, 2023 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants