-
Notifications
You must be signed in to change notification settings - Fork 271
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
setWill() cause mqtt could not connect with SSL enable #107
Comments
I am also having this problem. I can connect over SSL perfectly but when using the SetWill command it will not connect with an disconnect with reason 0 |
I'm working without SSL but can't connect after |
I figured out my problem. AsyncMqttClient doesn't copy the last will topic or value but only saves a pointer. And after I've marked topic and payload |
@bertmelis |
You're using mosquitto? What does the log of your broker say? FYI, my code is in https://github.com/bertmelis/TreeLight I don't use SSL though. |
1536078725: Socket error on client , disconnecting. |
Without SSL it is working? It sure seems like some buffer got overwritten. |
It is working without SSL and it is working without the |
Same problem, setwill doesn't work with SSL |
Sadly ATM I lack time to investigate, but I will try to... When I can |
For some reason I now have the same problem when not using SSL. When I remove setwill from code I can connect, with setwill connection will fail, and the mosquitto logging says: 1545571378: New connection from 192.168.2.153 on port 1883. |
Try change the lwIP to v2 Higher Bandwidth |
My error was caused because the setwill function doesn't copy the *topic data but just stores the pointer. Because I called this from a separate mqttinit function, the topic was lost because the variable containing the topic was not static. But SSL is still not working though... |
Hi |
I would love to know, what I can do for MQTTClient::setwill() with TLS/SSL.. Is there a chance to get it working? |
The solution is here: https://github.com/256dpi/arduino-mqtt
|
Is this really non-blocking asynchronous and for esp8266? |
The problem is that the _onconnect function calls _client.add for each piece of data to send to the mqtt server. When setwill is used, there is to much data to be send by the ASyncTCP module because it also add ssl data to each packet, causing it to drop the password. After changing the code to send less packets setwill works with SSL! |
…oger#107 (#1) marvinroger#107 Co-authored-by: Jeroen <[email protected]>
…#166 (marvinroger#165) * Solved setWill() cause mqtt could not connect with SSL enable marvinroger#107 marvinroger#107 * Fixed marvinroger#160 * Fixed bug marvinroger#147 * Fixed marvinroger#166 - ESP32 now also uses a unique client id - getClientId() fuction added * Solved Minor Flaw marvinroger#147 (comment)
Could you help me, how send less packets? Will topic works sometimes, not always. |
I believe this is ultimately caused by #193. What I've done to get SSL working is implementing a queue and only allowing the packet in the head to be on the wire at any time. This requires QoS2 and popping packets once they're acknowledged |
Hello. Thank you for your answer, but it's for asynchronous code. We use synchronous version, because packets not so much to send/get. But the problem is the same. Server got Will topic in mosquitto log file. But it publishes 50/50 times. Also we can't find a way, when it's happed. It's always different. Will topic can go/it may be lost. Do you know how solve it? |
The issue should be gone using the |
I am switch from PubSubClient becasue it block cpu. But i have a problem.
I enable SSL by change ASYNC_TCP_SSL_ENABLED to 1.
Then i set this line:
after
But it will not connect to my server, remove the line it connected.
I have try to setWill() in onMqttConnect() but it not work.
The text was updated successfully, but these errors were encountered: