Wifi AP scanning in AP mode

kcl7746
Posts: 2
Joined: Fri Jul 28, 2017 8:36 pm

Wifi AP scanning in AP mode

Postby kcl7746 » Fri Jul 28, 2017 8:40 pm

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.

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Wifi AP scanning in AP mode

Postby kolban » Sat Jul 29, 2017 5:33 pm

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.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: Wifi AP scanning in AP mode

Postby snahmad75 » Tue Jun 05, 2018 4:29 pm

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.

markwj
Posts: 90
Joined: Tue Mar 08, 2016 5:03 am

Re: Wifi AP scanning in AP mode

Postby markwj » Wed Jun 06, 2018 1:48 am

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).

Who is online

Users browsing this forum: No registered users and 287 guests