-
Notifications
You must be signed in to change notification settings - Fork 639
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
MQTT on -> off freezes the device #1115
Comments
Cannot reproduce the issue... can you check the debug log to see if there is any useful info there? |
The problem is the library async-mqtt-client. ESP just restarts and the web loses connection. You need to refresh the explorer. |
How did you get to that conclusion? What version/revision of the library are you using? |
Hi @jsponz , @xoseperez The problem is function _sendDisconnect closes connection on line 661, so _client.send() on line 707 crashes. I will send a pull request to https://github.com/marvinroger/async-mqtt-client |
Please, let me know when you send the PR. |
@pniaps did You send PR for this? |
@pniaps any news? |
Hi. Sorry for the delay |
@pniaps I'll wait for someone to answer the pr you proposed, but isn't that the case of having network request inside system callback? Inside WiFi event callback that is. If you change the callbacks to set boolean flags and do the connection inside loop() instead everything works ok. And, in espurna case, that is exactly what it does. I did track this for some time but could not reproduce the original issue :/ 2.3.0 ... 2.4.2 did ok switching mqtt on / off / on again. Switching ESPAsyncTCP version did not change a thing too. |
Will try, but callback or not, |
Yep, by "connection" i meant doing both .connect() and .disconnect() calls on mqttClient. Maybe this is related? me-no-dev/ESPAsyncTCP#75 Line 83 in 88a7076
to this Line 83 in 9ddbcb2
will help. Wiki too mentions older version in Arduino IDE instructions |
cc @jsponz @Misiu Lines 74 to 76 in 9ddbcb2
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
This issue will be auto-closed because there hasn't been any activity for two months. Feel free to open a new one if you still experience this problem. |
Some notes, since PR was never merged and this is still a possible bug:
|
With the last version, when switching off the MQTT, device freezes. I have to plug it off and plug it on again.
When switching on the MQTT, there is no problem.
Any hint?
The text was updated successfully, but these errors were encountered: