-
Notifications
You must be signed in to change notification settings - Fork 258
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
[v4.4.2] Doing start + stop + start triggers an error (IDFGH-8543) #239
Comments
any feedback? |
Hi @KonssnoK thanks for reporting.
|
hello @euripedesrocha ,
|
Hi @KonssnoK, from your information we identified the issue, and we have a fix for it. Yet I wasn't able to reproduce the scenario. Could you share more about your configuration and client usage? Do you have API_LOCKS disabled? |
no, standard configuration. We have a MESH networking,
on IP received we do
once we do
|
- In some situations client could be left in a state where it's impossible to restart due to a state change while waiting for the stop. This guarantee that it's possible to start after calling stop. Closes #239
@david-cermak could you please notify when the esp-mqtt component is pushed on esp-idf v4.4? |
@KonssnoK Will reference this fix in IDF So, does the af58f5f fix your issue? Please comment or reopen if not. |
@david-cermak we haven't checked yet, working on other issues with your colleagues. |
I cannot find the fix in esp-idf v4.x branches (v4.4 and v4.3), would you please update the esp-idf submodule and push the fix? |
@AxelLin the back porting process is ongoing. It takes a little to be available due to the testing process to avoid regressions. |
* Fixes keepalive calculation to use esp-timer (previously used system timer that might get updated by NTP sync and failing keepalive mechanism) * Fixes start() -> stop() -> start() client's transitions, due to wrong state of stopped client (could endup in WAIT_RECONNECT state and thus never allowed to be started again) * Update submodule: git log --oneline 60983d1dd54196b1e3f399c6f928d77256ec742a..bb9c8af9d552b608dd3aabf9617bde757a538ebe Detailed description of the changes: * Backport Moves state change when stopping the client - See merge request espressif/esp-mqtt!151 - Closes espressif/esp-mqtt#239 - Moves state change when stopping the client (espressif/esp-mqtt@af58f5f) * fix: MQTT tick not starting on connect and switch to esp_timer - See merge request espressif/esp-mqtt!146 - Closes #9492 - See commit espressif/esp-mqtt@166741f * ci: Fix CI build using public IDF images - See merge request espressif/esp-mqtt!148 - See commit espressif/esp-mqtt@530fe3a Closes #9492
* Update submodule: git log --oneline ae53d799da294f03ef65c33e88fa33648e638134..fde00340f19b9f5ae81fff02ccfa9926f0e33687 Detailed description of the changes: * Fix the default configuration for event queue - See merge request espressif/esp-mqtt!153 - See commit espressif/esp-mqtt@fb42588 * Adds missing header. - See merge request espressif/esp-mqtt!152 - See commit espressif/esp-mqtt@8a60057 * Moves state change when stopping the client - See merge request espressif/esp-mqtt!150 - Closes espressif/esp-mqtt#239 - See commit espressif/esp-mqtt@3738fcd * Adds error code to MQTT_EVENT_SUBSCRIBED in case of failure - See merge request espressif/esp-mqtt!143 - - Closes espressif/esp-mqtt#233 - See commit espressif/esp-mqtt@9af5c26 * Adds debug information on sending dup messages - See merge request espressif/esp-mqtt!145 - See commit espressif/esp-mqtt@47b3f9b * ci: Fix qemu build - See merge request espressif/esp-mqtt!147 - See commit espressif/esp-mqtt@68e8c4f * ci: Build and Test QEMU on v5.0 - See merge request espressif/esp-mqtt!142 - See commit espressif/esp-mqtt@9db9ee7 * client: Add support for user events - See merge request espressif/esp-mqtt!140 - Closes espressif/esp-mqtt#230 - See commit espressif/esp-mqtt@97503cc * Adds unregister event API - See merge request espressif/esp-mqtt!139 - Closes #9194 - See commit espressif/esp-mqtt@a9a9fe7
- In some situations client could be left in a state where it's impossible to restart due to a state change while waiting for the stop. This guarantee that it's possible to start after calling stop. Closes espressif#239
- In some situations client could be left in a state where it's impossible to restart due to a state change while waiting for the stop. This guarantee that it's possible to start after calling stop. Closes espressif#239
esp-idf-v4.3 still does not include this one-line-fix. |
As per title,
if i do
esp_mqtt_client_start
esp_mqtt_client_stop
esp_mqtt_client_start
the last start returns an error.
I had to modify the code to see what was the error (please make significant error messages).
The internal state machine of the MQTT client is stuck on MQTT_STATE_WAIT_RECONNECT.
the issue is in esp_mqtt_client_stop, where the state of the machine is put before waiting for the task to end, which means that any call to esp_mqtt_abort_connection() will put the reconnect status after being disconnected.
The text was updated successfully, but these errors were encountered: