-
Notifications
You must be signed in to change notification settings - Fork 308
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 reconnect fails after Wifi-disconnect #736
Comments
Probably related to #320 ? |
Solved it with the workaround
|
OK, that's the sledgehammer method :) |
Hi, After some test, it appears that it's because I use AsyncMqttClient 0.9.0 instead of the 0.8.2 packaged with Homie. Was that your case as well? Unfortunately my home assistant auto discovery payload seems too big for 0.8.2, so I really need to stick to 0.9.0 |
I was indeed using the version 0.9.0 of the AsyncMqttClient library. I have not tested with an older version and I'm still relying on my sledgehammer workaround resetting the device on WIFI_DISCONNECTED. |
@bertmelis has developed a much more stable mqtt library (https://github.com/bertmelis/espMqttClient). It is long on my todo list to replace asyncmqtt with bert's library in homie. |
I use the same kind of tricks but on the WIFI_CONNECTED event as doing the reboot in the WIFI_DISCONNECTED event somehow made the esp reboot again and again untill the Wifi is back. |
That sounds like a lot of works. I was under the impression that Homie development has kind of stopped. I was looking for a tiny synchronous MQTT Client that I could use to publish my HomeAssistant Autodiscovery message when the esp boot and then shut it down and let Homie works with 0.8.2. But all I could find it "huge" async mqtt client that requires an update loop and I didn't feel like having two Mqtt client working in parallel even if it's just during setup. |
Wel actually, you only need Homie. Let Homie do the work and use its mqtt client to send the discovery messages: |
yes, that's what I do, but Homie Mqtt Client doesn't support "big" payload (my payload are actually quite small). That's why I upgrade it to 0.9 in the first place. And now I got this reconnection issue. So I was looking for a solution to rollback to AsyncMqttClient 0.8.2 and use another client for my "big" payload. |
When rebooting the Wifi-AP or temporarily shutting down Wifi for any other reason the device does not reconnect to the MQTT broker but gets stuck in an endless reconnection loop
If only the connection to the MQTT broker is lost a reconnect works without any problems.
I'm using latest e0347c0 from develop on an esp32 (M5StickPlus).
The text was updated successfully, but these errors were encountered: