-
Notifications
You must be signed in to change notification settings - Fork 267
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
Delay between MQTT messages #270
Comments
In the current implementation, messages are put in a queue and sent one by one. This means, if you send messages with QoS > 0 (which Homie does), the messages do have a delay because the mqtt client waits for the acknowledgement before sending the next. Hence the delay. I've been thinking to improve this but I currently don't have time to do this. |
Hey Bert, |
Are you running this on esp8266 or esp32? Option in this lib are really limited. 1 second however is very slow. Can you wireshark the traffic on your WiFi? |
It is a esp8266. I have a look at my Mosquitto config, but I changed nothing to the default IOTStack installation... |
Hi @bertmelis I have realized that this is due to the fact that this version of your lib explicitly waits for the TCP ack before sending the next message. On ESP8266, the TCP ack very frequently only comes after several 100ms. Not sure, if this is a problem of the underlying ESPAsyncTCP lib. However, I noticed that in v0.9.0 of your lib all MQTT ack functions ( If I add
Please let me know if you see any problems that could arise from adding this line. Regards, |
Hi,
I'm using the lib with homie-esp8266.
It works quite stable since the last bugfixes.
I just have a question about the delay (about 1 sec.) between each MQTT message send from the device,
e.g. on start-up.
Is there a reason why that delay have to be that long?
Is that a homie or async-tcp-client thing?
I have a device with 4 inputs, if they are toogled at the same time, the messages need 4 seconds to send.
Maybe I missed something...
Thanks for your great work on this lib.
Regards
The text was updated successfully, but these errors were encountered: