-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
ESP32 connection failed (rc = -2) after 20 minutes aprox and can´t reconnect. #947
Comments
Have you tried setting your KeepAlive to somethjng longer? Perhaps 45? Also, I was having issues with PubSub and the current version of espressif32. In the platformio.ini file, I set my platform to: platform = espressif32@^3.5.0 and my connection issues resolved. Good luck! |
Hi! I´ve tried setting KeepAlive to bigger values, but not changes. I will try changing my platformio.ini file, thank you for the advice! |
Same, will not reconnect.. Oct 3 19:45:35 ESP_env 192.168.20.58 ESP:[INFO]- [MQTT] try client re-connect |
did you get any news on this @IgnacioCipo ? |
Same issue, MQTTBox and my other servers can connect to the broker just fine, esp can not. |
I have tried to debug this but it seems to be deep in the wificlient library and since these are all abstracted classes, I could not really follow it to where it was failing. I basically gave up as I spent too much time on it. Someone with knowledge of these classes might have better luck tracing it, or have actual debuggers setup. I have a suspicion its a socket issue in the esp lib |
I ended up moving away from |
@ZanzyTHEbar checking it out now, thanks! |
I'm using ESP32 with Platformio in Arduino code. I am sending information with a SIM800 through MQTT using Pubsubclient and TinyGSM to a .net broker using FreeRTOS. ESP32 starts and all works fine, I have a function to check if the MQTT connection is still ON, and if it disconnects, reconnects it. This is working, but after some time the MQTT connection is lost and it is not able to reconnect anymore. The only way to connect the ESP32 back to MQTT is rebooting it.
I´ve checked if the problem comes from the server side where the MQTT broker is, but it is not. When ESP32 is trying to reconnect, I´ve reset the server and the problem persist.
I´ve checked SIM800 connectivity and it algo is good.
This is my task that checks for MQTT connection each half minute.
This are the function calling to check MQTT:
I´ve been dealing with this problem too much time. I would appreciate any tips. Thanks!
The text was updated successfully, but these errors were encountered: