-
Notifications
You must be signed in to change notification settings - Fork 308
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
Question: Delay between MQTT messages #724
Comments
I am not looking at the current implementation of async-mqtt-client, but having that queue is a great improvement. Before that queue was implemented, messages not fitting into the TCP send buffer have just been dropped and have not been sent at all. Devices with larger amounts of properties did not work at all. |
OK, since I changed nothing to the default IOTStack installation I have a closer look what might be the problem with Mosquitto. I'm glad it is not a general problem. |
What do you mean with "not a general problem"? Is it just one device, or a couple? Perhaps bad WiFi reception? |
Sorry, that was not quite clear. I mean "a general homie/asyc-mqtt-client problem that affects everyone" I tested now with different devices, different homie-projects, all show the same behavior. As said, it is not a real showstopper for me. But I was curious if someone else has seen that behavior. By now I don't know how to optimize the mosquitto broker, I turned off persistance with no effect. |
Persistance is not the problem. Maybe setting
Especially for the Ack messages: they are small and the TCP stack might queue them, or in case no further data is coming, sent after (typically) 500msec. |
I do not see a change with nodelay set to true. 20211130_105622.mp4 |
I have several devices using the homie framework which send more than 20 messages on startup. None of them shows the behaviour of yours. |
OK, I created a test-project, doing nothing except the homie setup. It stays the same.... |
I did see the same behaviour. It doesn't surprise me. Goal is still to speed up sending: "more than 1 message in-the-air". |
Ok, I'll double-check. Maybe I was wrong. I noticed that since the update to asyncmqtt it takes longer to send a bunch of messages but I never had the impression that there was a 500ms delay between messages. |
BTW, the Mosquitto version is 2.0.14, in case that matters. |
It turns out that this could be a problem in daily life. |
Is it possible to have a look on your code? |
Yes, but the test project contains nothing but the homie setup and loop, and one advertised node. #include <Arduino.h> HomieNode debugNode(DEBUGNODE_TYPE, DEBUGNODE_TYPE, DEBUGNODE_TYPE); void setup() void loop() Maybe the "Delayed ACK"-issue is located in the used ESPAsyncTCP/lwip stack. |
OK, after hours of reading about LWIP etc. I was not able to track that problem down. |
Hello,
i wonder if anybody have the same "problem":
With the latest async-mqtt-client used by Homie there is a delay between every send MQTT message.
I already asked in the async-mqtt-client GIT, and Bert answered that it is the current implentation...He wants to optimize it but is currently out of time.
The outgoing messages are queued and for QOS>0 the client waits for the acknowledge before sending the next one.
So I have a delay of 1s between every outgoing message, you can see it e.g. during startup.
My device has 4 inputs, if they are toggled at once, the last message is send after 4 seconds.
I have a IOT-Stack Docker (with mosquitto) installed on a RPI4.
If anybody have an idea or suggestion how to avoid that delays I would be glad.
The text was updated successfully, but these errors were encountered: