-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Using Wi-Fi to publish MQTT data, transport timeout, then stuck. (IDFGH-13901) #14743
Comments
Hello, Anyway, attach the verbose-level log. According to the verbose level log, when stuck, BLE still seems to be receiving data normally. This problem is very serious and requires a manual reboot to return to normal. |
Hi @Sky-Soo-Ap, the MQTT client will try to reconnect, unless you set it not to. |
Hi Euripedesrocha, How to set mqtt client to verbose level log? |
Hi, about the logs from the code sent, you should use lower case tags to set the logs. |
Hi, about the logs from the code sent, migrated from old esp-idf v5.0.x.
|
About the logs: The first line set it to all the tags, the following |
I turned on the verbose log level of "mqtt_client" and did not see any more logs. |
Hi euripedesrocha,
|
Hi euripedesrocha, |
@Sky-Soo-Ap sorry for the delay, this seems to be unlikely an issue on the MQTT client, but I'm having a hard time identifying the root cause. |
Hi euripedesrocha, Following are the reproducible steps: |
I see. Have you considered using |
Hi euripedesrocha, |
@Sky-Soo-Ap from reading your code you sent, the only thing I see is the
|
Hi @Sky-Soo-Ap I just tried the reproducer sent and wasn't able to reproduce the issue. Is there something missing in the code? |
Hi euripedesrocha, void suspendNotifyTask() { How does the API esp_mqtt_client_enqueue behave when the outbox is full? It will drop the current data or the first queued data? |
@Sky-Soo-Ap I wasn't able to reproduce on my side using the code you sent. There were other parts of your system that you omitted in this reproducer that might affect the behavior? When you have outbox memory exhausted, either by system without enough memory or outbox memory usage limit, you get an error, no messages are dropped from the outbox. |
@euripedesrocha
So, the get an error data will drop, right? |
@Sky-Soo-Ap I retried and noticed that I had one step incorrect and was able to reproduce it, thanks for the help. Not exactly. The message is not created, your data isn't touched, so no data is lost/drop. You'll not be able to publish/enqueue at that point, but that is because your system memory is exhausted. |
@Sky-Soo-Ap we were able to identify the source of your problem. |
@euripedesrocha |
@Sky-Soo-Ap you are partially correct. I didn't follow your thoughts on relevance of the disconnected/published events. Could you elaborate? Events will most of the time be dispatched from the mqtt task, I'll check other points where this could happen and improve the documentation about it. Have you experimented with enqueue function? Does it solve your original problem? |
What I mean is that the API and event tasks must be disconnected; in this example, the upper layer calls the API, returns an error after time out, and the event generated by time out is processed by the mqtt task.
The queuing function does not meet the functional requirements. What I need is that when the queue is full, the oldest data is discarded and the latest is saved. |
The published event is dispatched only by the mqtt task. I still need to double-check, but I believe this behavior is only for the disconnection event.
Could still be a solution. The outbox behavior can be fully customized. |
Will you solve this problem? Disconnect event dispatched by the mqtt task.
I didn't find the relevant APIs or structural data to customize it. |
This behavior isn't likely to change at the moment. I'll work on it later though.
You can find the relevant example here |
Answers checklist.
IDF version.
v5.3.1
Espressif SoC revision.
ESP32-D0WDR2-V3-V3 (revision v3.1)
Operating System used.
Windows
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
None
Development Kit.
Custom Board
Power Supply used.
USB
What is the expected behavior?
I expected Wi-Fi or MQTT disconnected would not be stuck here.
It will keep re-connecting Wi-Fi or MQTT;
What is the actual behavior?
Using Wi-Fi to publish MQTT data, transport timeout, then stuck.
Steps to reproduce.
...
Debug Logs.
More Information.
No response
The text was updated successfully, but these errors were encountered: