New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tcp connection timeout every ~4hours #386
Comments
This is not a known issue. Let us try to trace it down:
|
It's hard to tell with the trace I have. I would need to do another one with only one ESPurna device connected to the repeater and logging enabled on mosquitto, repeater and ESPurna. In one of the case, I get: mosquitto broker log:
Wireshark:
In other case, I get mosquitto broker log:
Wireshark:
|
I reproduced the issue this afternoon with only one ESPurna device connected to the repeater and to the broker. From the mosquitto broker log, I can see PINGREQ and PINGRESP every 300 seconds as excepted (this is the keepalive timeout in ESPurna config) And at 15:04:19, there is this error:
On the ESPurna console, I got this at the same time:
And on the wireshark trace, I get below packets:
I have added packets before and after to give some context. The problem is still that we get a TCP [FIN, ACK] packet from the broker followed by the TCP [RST, ACK] packet from the ESPurna. I don't get why I have this issue only when connected to the repeater. |
I managed to capture a trace with the monitor mode of the repeater. The issue starts when the ESPurna try to publish its status. When the broker sends the ACK to this status, it doesn't get transmitted to the ESPurna because the esp relay doesn't manage to connect to the allocated port. The error is a ICMP Port unreachable. Here is the interesting part:
Any idea why the port would be closed after ~4 hours ? |
I have found the issue and sent a fix for it in esp-open-lwip. (martin-ger/esp-open-lwip#28) |
Thanks a lot! Great analysis and thank you for the patch! |
Happy to help! Thanks for merging it. |
Hi Martin,
Thanks for all the work you have done on this project, it's really amazing!
I'm currently running the esp wifi repeater with multiple ESPurna enabled Sonoff devices connected to it.
All devices are communicating with a MQTT broker directly connected to my router.
Every ~4hours I can see all devices disconnecting from the MQTT broker with Mosquitto broker saying:
"Client ESPURNA-BE9FA4 has exceeded timeout, disconnecting."
So I decided to do a tcpdump of this issue and found out that when the disconnect happens, we get a TCP Reset packet.
The tcpdump runs from the raspberry where the broker runs.
It's like the esp wifi repeater is closing TCP connection every ~4hours.
To ensure that my ESPurna devices was correctly configured, I connected it directly to my router and didn't see any disconnect or TCP reset.
Is this a know issue?
The text was updated successfully, but these errors were encountered: