Skip to content
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

Intermittent Disconnects with TinyGSM + SSLClient + PubSubClient during MQTT Ping #1060

Open
k3341095 opened this issue Jun 26, 2024 · 1 comment

Comments

@k3341095
Copy link

k3341095 commented Jun 26, 2024

Hello,

I am experiencing an issue with my project using TinyGSM, SSLClient, and PubSubClient libraries where the MQTT connection randomly disconnects. The disconnects seem to occur specifically when the 15-second MQTT ping interval happens. Until the ping, the MQTT communication works fine.

Below is a snippet from the stream writer log showing the issue:

18:13:52.390 > AT+CIPSEND=0,31
18:13:52.393 >
18:13:52.393 > >������h[׵͑� [295404][E][ssl__client.cpp:193] client_net_send(): write failed
18:13:53.403 > [295410][E][ssl__client.cpp:46] _handle_error(): [send_ssl_data():900]: (-78) Failed to send data - underlying network layer error
18:13:53.414 > [295422][E][SSLClient.cpp:384] write(): Error sending data to SSL connection. Stopping SSLClient...
18:13:53.423 > AT+CIPCLOSE=0
18:13:53.600 >

From what I understand, the error happens when trying to send the ping packet, leading to the connection being dropped. This issue does not occur at any other time, so I suspect it's related to the ping mechanism.

Questions:
What could be causing the failure specifically during the ping interval?
Should I consider increasing the keepalive interval or adjusting the timeout values?
Are there specific areas or settings in TinyGSM, SSLClient, or PubSubClient that I should investigate to resolve this issue?
Additional Information:
The network connection itself seems stable as there are no disconnects during regular MQTT operations, only during the ping.
I have already tried different baud rates and checked for hardware issues, but the problem persists.
Any help or guidance on this issue would be greatly appreciated.

Thank you!

@cloakedch
Copy link

I am facing the same issue. Did you find a way to fix this?

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

No branches or pull requests

2 participants