-
Notifications
You must be signed in to change notification settings - Fork 140
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
EspMQTTClient disconnects my WiFi if fails to connect to broker #96
Comments
I saw the issue area:
There are 2 possibilities, one is to be able to change the reconnection attempts (Maybe add a variable and if it is 0 we continue trying) and another one is to be able to have a function:
and change the above to:
To allow the end user to decide whether MQTT failure will reset WiFi or not. Hope this helps |
I understand you issue. |
Thank you, happy to test when implemented |
The fix is now applied. I haven't tested it though. Please, give it a try if you can and let me know if it work. If so, I will release the fix to be available in Arduino IDE and PlatformIO library manager. Regards. |
Confirmed that it is working correctly, now it shows that MQTT fails past the 8th attempt and does not manage the WiFi as expected. Thanks a lot. Awesome quick fixing!
Thanks, |
Thanks for the great effort on the library!
I am recently finding an issue (Running on ESP32) where MQTT client is disconnecting my WiFi if it fails to connect to broker:
This is quite an unwanted feature as I don't want the client to handle the WiFi connectivity.
I launch the client this way:
Then if for whatever reason there is a connectivity issue to MQTT server:
11:06:04.729 -> MQTT: Connecting to broker "mymqttserver.com" with client name "MyDeviceName" ... (129.665000s)unable to connect (129.681000s), reason: MQTT_CONNECT_FAILED
11:06:04.729 -> MQTT: Retrying to connect in 15 seconds.
11:06:04.729 -> MQTT!: Failed MQTT connection count: 7
11:06:19.723 -> MQTT: Connecting to broker "mymqttserver.com" with client name "MyDeviceName" ... (144.681000s)unable to connect (144.692000s), reason: MQTT_CONNECT_FAILED
11:06:19.756 -> MQTT: Retrying to connect in 15 seconds.
11:06:19.756 -> MQTT!: Failed MQTT connection count: 8
11:06:19.756 -> MQTT!: Can't connect to broker after too many attempt, resetting WiFi ...
11:06:19.756 -> WiFi! Lost connection (144.708000s).
And this is the end of it...
Why is WiFi being reset if MQTT fails? I have not setup the client to manage WiFi.
I have been using the library for quite some time and I don't think this was happening in the past...
Thanks!
The text was updated successfully, but these errors were encountered: