Skip to content

Change the amount of time it scans for a wifi signals #10082

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

Closed
1 task done
brandonfake69 opened this issue Jul 27, 2024 · 4 comments · Fixed by #10083
Closed
1 task done

Change the amount of time it scans for a wifi signals #10082

brandonfake69 opened this issue Jul 27, 2024 · 4 comments · Fixed by #10083
Assignees
Labels
Status: In Progress ⚠️ Issue is in progress Type: Feature request Feature request for Arduino ESP32
Milestone

Comments

@brandonfake69
Copy link

Related area

Wifi

Hardware specification

ESP32

Is your feature request related to a problem?

I am following the example from https://github.com/espressif/arduino-esp32/tree/0fa4aa632c6dcb7736a291a33fb9f0a25614d6d0/libraries/WiFi/examples/WiFiScan

It seems there is not a way to change the amount of time the ESP32 scans for a signal. For this, I am missing a LOT of access points I can find via other means. I would like to scan for 5 minutes but this seems to scan for about 5 seconds then return the results. How to fix?

Describe the solution you'd like

Scan for a longer time period.

Describe alternatives you've considered

Flipper zero

Additional context

No response

I have checked existing list of Feature requests and the Contribution Guide

  • I confirm I have checked existing list of Feature requests and Contribution Guide.
@brandonfake69 brandonfake69 added the Type: Feature request Feature request for Arduino ESP32 label Jul 27, 2024
@brandonfake69
Copy link
Author

Setting this seems to make no difference in the amount of time it scans:

  int n = WiFi.scanNetworks(false, true, false, 30000000);

@brandonfake69 brandonfake69 reopened this Jul 27, 2024
@lbernstone
Copy link
Contributor

lbernstone commented Jul 27, 2024

From esp-idf doco

The values of maximum active scan time and passive scan time per channel are limited to 1500 milliseconds. Values above 1500ms may cause station to disconnect from AP and are not recommended.

Just a note. This is not a tutorial site. It is a forum for errors in the code here. Please ask general questions at https://esp32.com

@P-R-O-C-H-Y P-R-O-C-H-Y added Type: Question Only question and removed Type: Feature request Feature request for Arduino ESP32 labels Jul 29, 2024
@P-R-O-C-H-Y
Copy link
Member

P-R-O-C-H-Y commented Jul 29, 2024

Hi @brandonfake69, as Ibernstone wrote, there is this note in docs of recommended maximum scan time per channel.
Can you test the scan with: int n = WiFi.scanNetworks(false, true, false, 1500); if you get better scan results?

@P-R-O-C-H-Y P-R-O-C-H-Y added Type: Feature request Feature request for Arduino ESP32 and removed Type: Question Only question labels Jul 29, 2024
@P-R-O-C-H-Y P-R-O-C-H-Y self-assigned this Jul 29, 2024
@P-R-O-C-H-Y
Copy link
Member

@brandonfake69 Can you take a look and test the changes in the PR I linked?
I have added an option to specify minimum active time for scanning. So now if I assume and use maximum recommended scan time 1500 ms, I ca was able to get from 5s scan time to 17,5 seconds of scan time. You can check the new example or run it directly. Thanks for any feedback.

@VojtechBartoska VojtechBartoska added this to the 3.0.4 milestone Jul 29, 2024
@VojtechBartoska VojtechBartoska added the Status: In Progress ⚠️ Issue is in progress label Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: In Progress ⚠️ Issue is in progress Type: Feature request Feature request for Arduino ESP32
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants