Skip to content

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

Closed
@brandonfake69

Description

@brandonfake69

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.

Activity

brandonfake69

brandonfake69 commented on Jul 27, 2024

@brandonfake69
Author

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

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

lbernstone commented on Jul 27, 2024

@lbernstone
Contributor

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 commented on Jul 29, 2024

@P-R-O-C-H-Y
Member

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?

self-assigned this
on Jul 29, 2024
P-R-O-C-H-Y

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

@P-R-O-C-H-Y
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.

added this to the 3.0.4 milestone on Jul 29, 2024

1 remaining item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Change the amount of time it scans for a wifi signals · Issue #10082 · espressif/arduino-esp32