Page 1 of 1

wifi scan in non-blocking mode

Posted: Sat Feb 04, 2017 3:42 am
by ry1234
Hi

I would like to use esp_wifi_scan_start() in non-blocking mode; is there an API or register that allows to check if the scan has completed?

Thanks!

Re: wifi scan in non-blocking mode

Posted: Sat Feb 04, 2017 4:29 am
by WiFive

Re: wifi scan in non-blocking mode

Posted: Wed Feb 08, 2017 4:03 pm
by ry1234
Thanks for that.

Does the wifi_scan_start() api initiate an active scan or a passive scan (or both)? I would like to limit to active scan only, couldn't find a way so far to control the behavior beyond a brief mention in the data sheet.

Thanks!

Re: wifi scan in non-blocking mode

Posted: Wed Feb 08, 2017 4:39 pm
by kolban
Howdy ry1234,
Purely because I are a dummy ... can you explain the distinction between an "Active" WiFi scan and a "Passive" WiFi scan?

Neil

Re: wifi scan in non-blocking mode

Posted: Wed Feb 08, 2017 5:07 pm
by ry1234
Hi Neil,
Passive scanning is where the client listens to the beacon broadcasts (typical beacon interval is 100 msec).
Active scanning is where the client transmits a probe request and waits for a probe response from all SSIDs that received the request.

Re: wifi scan in non-blocking mode

Posted: Wed Feb 08, 2017 5:09 pm
by ry1234
Hi,

Another piece of information: the esp_wifi_scan_start() API takes 200 msec to return, for a single Wifi channel:

wifi_scan_config_t cfg = {NULL, NULL, 1, false};
ESP_ERROR_CHECK( esp_wifi_scan_start(&cfg, true));

So I suspect it is performing a passive scan (?)