[GH-ISSUE #1649] WiFi Scan ASYNC not always works #1403

Closed
opened 2026-02-28 01:29:56 +03:00 by kerem · 5 comments
Owner

Originally created by @Dario-Ciceri on GitHub (Aug 28, 2023).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1649

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

Originally created by @Dario-Ciceri on GitHub (Aug 28, 2023). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1649 On esp32: `WiFi Scan ASYNC started` and then nothing... sometimes it works after 6 seconds or 5... sometimes it doesn't at all....
kerem 2026-02-28 01:29:56 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Dario-Ciceri commented on GitHub (Aug 28, 2023):

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 ????

<!-- gh-comment-id:1696292797 --> @Dario-Ciceri commented on GitHub (Aug 28, 2023): 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` ????
Author
Owner

@georgevbsantiago commented on GitHub (Aug 29, 2023):

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
<!-- gh-comment-id:1696670534 --> @georgevbsantiago commented on GitHub (Aug 29, 2023): 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 ```
Author
Owner

@tablatronix commented on GitHub (Aug 31, 2023):

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

are 2 different things, not overrides

<!-- gh-comment-id:1701774733 --> @tablatronix commented on GitHub (Aug 31, 2023): ESP WiFi.scanNetworks(true); WM WiFi_scanNetworks(true); are 2 different things, not overrides
Author
Owner

@Dario-Ciceri commented on GitHub (Aug 31, 2023):

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

<!-- gh-comment-id:1701781428 --> @Dario-Ciceri commented on GitHub (Aug 31, 2023): > 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
Author
Owner

@tablatronix commented on GitHub (Sep 16, 2023):

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
<!-- gh-comment-id:1722220184 --> @tablatronix commented on GitHub (Sep 16, 2023): 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
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#1403
No description provided.