tzapu / WiFiManager

ESP8266 WiFi Connection manager with web captive portal
http://tzapu.com/esp8266-wifi-connection-manager-library-arduino-ide/
MIT License
6.55k stars 1.97k forks source link

WiFi Scan ASYNC not always works #1649

Closed Dario-Ciceri closed 11 months ago

Dario-Ciceri commented 1 year ago

On esp32: WiFi Scan ASYNC started and then nothing... sometimes it works after 6 seconds or 5... sometimes it doesn't at all....

Dario-Ciceri commented 1 year ago

I searched for WiFi.scanNetworks and found this one: res = WiFi.scanNetworks(true); which is weird ... (?)

Why using true? These are the possible overrides:

  1. bool WiFi_scanNetworks();
  2. bool WiFi_scanNetworks(bool force, bool async);
  3. bool WiFi_scanNetworks(unsigned int cachetime, bool async);
  4. bool WiFi_scanNetworks(unsigned int cachetime);

Is it intentional to use WiFi_scanNetworks(unsigned int cachetime); with cachetime = true = 1 ????

georgevbsantiago commented 1 year ago

I have the same problem. I also identified that the ESP32 (devkit with Platformio) is taking time to map the Routers signal. And it doesn't always work. Sometimes I have to click the Refresh button for it to work.

platform = espressif32@6.3.2
board = esp32doit-devkit-v1
framework = arduino
lib_deps =
    WiFiManager@2.0.16-rc.2
tablatronix commented 1 year ago

ESP WiFi.scanNetworks(true); WM WiFi_scanNetworks(true);

are 2 different things, not overrides

Dario-Ciceri commented 1 year ago

ESP WiFi.scanNetworks(true); WM WiFi_scanNetworks(true);

are 2 different things, not overrides

uhm ok, I checked these days and tried to understand, I changed to match async call and it works

tablatronix commented 1 year ago

I am not sure this is the async scanning that is the issue, I am seeing 0 scans also sometimes.

you can go into the .h and change this to false to disable it

boolean       _asyncScan              = true; // perform wifi network scan async