-
Notifications
You must be signed in to change notification settings - Fork 127
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
No wifi reconnection after connection loss - Heishamon Large (ESP32) #621
Comments
I can confirm this behavior, i noticed after updating rebooting my AP heishamon will go to failsafe hotspot mode, and will not reconnect, just rebooted heishamon and it connect's back. |
No there is something else weird going on with ESP32 wifi. I haven't figured it out yet. Will keep searching when I have some more spare time |
I have found the problem. It is a logical error in the function check_wifi(). The ESP32 also loses the IP address at the same time as the connection. This means that result of line 173 is always false: On the ESP32 you get the correct information WL_CONNECTION_LOST as wifistatus if the connection is lost. I suggest the following change: void check_wifi() { } else if ((wifistatus != WL_CONNECTED) || (!WiFi.localIP())) { |
No that is not it. That if statement is specially written for the ESP8266 which can be in this state. I know that for the ESP32 it will never go in that statement. |
Sometimes my Heishamon loses the wifi connection, but there is no reconnection.
Has this been forgotten for the ESP32?
void check_wifi() {
int wifistatus = WiFi.status();
if ((wifistatus != WL_CONNECTED) && (WiFi.localIP())) {
// special case where it seems that we are not connect but we do have working IP (causing the -1% wifi signal), do a reset.
#ifdef ESP8266
log_message(_F("Weird case, WiFi seems disconnected but is not. Resetting WiFi!"));
setupWifi(&heishamonSettings);
#else // here for ESP32
log_message(_F("WiFi just got disconnected, still have IP addres."));
#endif
...
Or can a reconnection be triggered with a rule?
The text was updated successfully, but these errors were encountered: