Page 1 of 1

Wifi AP scanning in AP mode

Posted: Fri Jul 28, 2017 8:40 pm
by kcl7746
Is it possible to use the esp_wifi_scan_start() while in WIFI_MODE_AP? This works fine for me in STA mode but in AP mode I get a timeout error if blocking is enabled or a failure error if blocking is not enabled.

Re: Wifi AP scanning in AP mode

Posted: Sat Jul 29, 2017 5:33 pm
by kolban
Just thinking out loud ... but in Access Point (AP) mode, you are declaring that you are being an access point and hence only willing to receive incoming WiFi associations. In Station (STA) mode, you are declaring that you are being a station and wish to connect with a remote access point. Since performing a WiFi scan is a common preamble when in station mode but not apparently meaningful in access point mode, could you not declare that your ESP32 is in BOTH AP+STA modes? Being in a station mode while simultaneously being in an access point mode is (I believe) an allowable combination. If you don't actually form a connection to an access point from your ESP32, I'm not seeing any obvious harm in allowing your ESP32 to be both an AP+STA to allow a WiFi scan.

Re: Wifi AP scanning in AP mode

Posted: Tue Jun 05, 2018 4:29 pm
by snahmad75
ok,

We can do both an AP+STA to allow a WiFi scan.

I guess I can create two instance of WIFI C++ class. one for AP and other for STA.

I can switch between them depends using web rest calls.

Re: Wifi AP scanning in AP mode

Posted: Wed Jun 06, 2018 1:48 am
by markwj
Scan can be done in AP+STA mode, but it will interrupt the AP activity while scan is in progress.

AP+STA in general works well. You can even leave the STA side idle (just used for scanning, etc) while the AP is running. Only issue is that you can't leave the AP idle (if unconfigured, it just starts an AP with an empty SSID).