-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
(ESP32) Support for larger MQTT payloads #6
Comments
I'm a bit confused, Is this an enhancement for esp32 or esp8266 or both?
I find this option only for esp8266: https://docs.platformio.org/en/latest/platforms/espressif8266.html#lwip-variant for esp32 there seems not to be such a option? https://docs.platformio.org/en/latest/projectconf/section_env_platform.html Is this also a limit for esp32?
The v3 uses dynamic 4k buffer, static 1k is only in esp8266. |
it is confusing! I wanted to create an issue so we have all the details in one place. It's also a place holder for an updated version of asyncmqttclient that supports chunking, to go over the lwip buffer limit for large payloads. That's what I'm playing around with now |
updated the mqtt libs for v3 only. |
@proddy : I see a issue with this new lib, after a mqtt-message is sent to ems-esp ( After some tests/retries and reconnects the message is received 9 times and mqtt sending is also stopped. I installed the old mqtt lib and it works again without these issues. Can you reproduce this? |
haven't seen that on my side and have been running fine for the last days. I'll do some deep diving and see what I can find. We can always roll back to the previous lib. |
I've tested now with the prebuilt bin to make sure it is not on my side. I can reproduce the issue, but it may be only with my mqtt-broker. Btw: the broker shows last-will message "offline". |
With qos 0 it's working ok, But qos 1/2 hang after on_message. Switching back to qos 0 reconnects, but i tstill hang, i have to reboot the esp. |
ok, I think I may know where its failing. I'll reproduce here too with qos1 |
It's failing in process_queue, line 694 (debug message inserted to check).
The messages after the incoming message are not sent and we do not receive the ack in |
yes I expected it was in that piece of code. In the old library there was no good support for qos1+2 so I implemented in code. I think all this can be removed now. I'm working on some big changes so hold of on any PRs until I've done this push |
I did reproduce this as well - I'll look into what needs fixing tonight |
I've removed the qos-code and the on_publish callback, but it does not help. With qos 1: After the on_message (works) the next messages get a pid back but are not sent out. Mqtt-queue is always empts then.
After some time mqtt reconnects
and next messages works ok until next incoming message. |
interesting, does this happen only after an incoming message is received by EMS-ESP? I don't have time to write a sketch to reproduce it but can post a report to mqttasyncclient outlining the steps
is that correct? |
Yes, exactly. |
Does the client disconnect after a while? That is, after the keepalive times out. Or is it just stuck? |
thanks for the quick fix @bertmelis . @MichaelDvP I've made the change, so we can test |
@bertmelis Yes it have disconnected after ~30sec. With your fix all is working well now. Thanks. @proddy Tested qos 0, 1, 2 and all is ok now. I've gone back to your original mqtt.ccp with some extra debug messages. You can close the issues here and there. And we should add in |
@MichaelDvP I don't mind if we go with your version of mqtt.cpp. We can never have enough debug messages, just wrap them in |
small changes, use commands to change dashboard values
As noticed with emsesp/EMS-ESP#715 with setups containing multiple heating circuits on a single thermostat, the MQTT payload may exceed the EMS-ESP buffer limit of 1024 bytes. The threshold for the TCP lwip stack is 1072 for (or 2090 if using lwip2 and compiling with
-DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
). See emsesp/EMS-ESP#556 (comment).In theory we can up the EMS-ESP buffer and possibly switch from static to dynamic heap, if there is room.
But I'd also like to explore MQTT chunking again so will experiment with the asyncMqttclient libs
The text was updated successfully, but these errors were encountered: