- 
                Notifications
    
You must be signed in to change notification settings  - Fork 99
 
On Android phone ConfigPortal is unresponsive #23
Description
Hello,
First i would like to thank you for the GREAT lib (I use it for my ESP-32 projects).
So off to the problem:
My SETUP function:
void WiFiSetup() {
  if (WiFi.getAutoConnect() == 0) { WiFi.setAutoConnect(1); }
  ESP_WiFiManager ESP_wifiManager("AAAAA");
#ifdef DEBUG_WIFI
  ESP_wifiManager.setDebugOutput(true);
#else
  ESP_wifiManager.setDebugOutput(false);
#endif
  ESP_wifiManager.setAPStaticIPConfig(IPAddress(192, 168, 10, 1), IPAddress(192, 168, 10, 1), IPAddress(255, 255, 255, 0));
  ESP_wifiManager.setMinimumSignalQuality(38);                                                     //38% = -81
  Router_SSID = ESP_wifiManager.WiFi_SSID();
  Router_Pass = ESP_wifiManager.WiFi_Pass();
#ifdef DEBUG_WIFI_CREDENTIALS
  Serial.println("    Stored: SSID = " + Router_SSID + ", Pass = " + Router_Pass);
#endif
  String AP_SSID = "xxxxxx";
  String AP_PASS = "zzzzzzzzzzz";
  if (Router_SSID != "") {
    WiFi.mode(WIFI_STA);
    WiFi.begin();
    byte _i = 0;
    while(!WiFi.isConnected() && _i < 100) {
      _i++;
      delay(100);
    }
    if (WiFi.isConnected()) {
#ifdef DEBUG_WIFI
      Serial.println("    WiFi OK!");
#endif
    } else {
#ifdef DEBUG_WIFI
      Serial.println("    WiFi NOT connected! Config portal and AP! 120s Timeout");
#endif
      ESP_wifiManager.setConfigPortalTimeout(120);
      ESP_wifiManager.autoConnect(AP_SSID.c_str(), AP_PASS.c_str());
    }
  } else {
#ifdef DEBUG_WIFI
    Serial.println("     No stored Credentials. 120s timeout");
#endif
    ESP_wifiManager.setConfigPortalTimeout(120);
    ESP_wifiManager.autoConnect(AP_SSID.c_str(), AP_PASS.c_str());
  }
}and when i have no credentials stored it starts ConfPortal BUT the problem is that when i try accessing it from my Note10+ (Chrome or builtin browser and latest fw) page takes AGES to load (more than 5 mins or it doesnt at all) from PC (Chrome browser, win 10) it works as should.
sometimes i get back error in Serial monitor other times i dont: [E][WebServer.cpp:617] _handleRequest(): request handler not found
and usually after a few refreshes it loads the page quite quickly :)
is there any idea what is going on? and mainly how to solve it?
I was thinking that i might have messed some of config part? like IP addresses (had to change it as one of my networks i connect over VPN is 192.168.4.x)
There is also a question i would like to ask ...... is there a way i can change the portal html code? i would like to use one that suits me more? Or perhaps if that part of the code could be a separate file so it would be easy to change it (just a hint perhaps for some future updates) :) and perhaps not being affected when you update your lib (or at least just being able to copy html related files over and you are done :) )?
BR
Ales
EDIT: like email :) when I click send, I remember to attach file :) so the file here is .... after portal is loaded if i click on any button .... we start from beginning no page loaded ..... need to refresh a few times and then it starts working or i need to wait a minute or a few :)