knolleary / pubsubclient

A client library for the Arduino Ethernet Shield that provides support for MQTT.
http://pubsubclient.knolleary.net/
MIT License
3.78k stars 1.46k forks source link

Very Slow - HELP! #1014

Open fabltd opened 1 year ago

fabltd commented 1 year ago

Hi All

I am bagging my head.

ESP32 - Publish message its quick. I can publish as fast as I like.

Subscribe to topic. Its slow the call back appears to lag. Its as if there is a delay in it.

Is there any debug mode to see if the messages arrive and its a call back issue?

I currently have 1 ESP32 publishing the other subscribing. With a count. Its constantly missing messages.

Where is the delay? Any thoughts any one seen it. HELP!!!

Call back has been set as minium the code is crashing for some reason:

Call Back Message length: 
17
Call Back Message length: 
17
[ 88034][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 2 bytes...
[103038][V][ssl_client.cpp:321] stop_ssl_socket(): Cleaning SSL connection.
Session Reconnect
Attempting MQTT connection...[103039][V][ssl_client.cpp:62] start_ssl_client(): Free internal heap before TLS 183828
[103045][V][ssl_client.cpp:68] start_ssl_client(): Starting socket
[103076][V][ssl_client.cpp:146] start_ssl_client(): Seeding the random number generator
[103077][V][ssl_client.cpp:155] start_ssl_client(): Setting up the SSL/TLS structure...
[103080][V][ssl_client.cpp:178] start_ssl_client(): Loading CA cert
[103090][V][ssl_client.cpp:254] start_ssl_client(): Setting hostname for TLS session...
[103094][V][ssl_client.cpp:269] start_ssl_client(): Performing the SSL/TLS handshake...
[104252][V][ssl_client.cpp:290] start_ssl_client(): Verifying peer X.509 certificate...
[104252][V][ssl_client.cpp:298] start_ssl_client(): Certificate verified.
[104255][V][ssl_client.cpp:313] start_ssl_client(): Free internal heap after TLS 145144
[104263][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 234 bytes...

connected!
[106045][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 29 bytes...
Call Back Message length: 
17
HamzaHajeir commented 11 months ago

If any need, you can checkout H4AsyncMQTT and see whether it fits your needs.