Request clarification of esp_wifi_connect() note in docs

vonnieda
Posts: 145
Joined: Tue Nov 07, 2017 3:42 pm

Request clarification of esp_wifi_connect() note in docs

Postby vonnieda » Tue Oct 02, 2018 3:47 pm

Hi all,

In the docs at https://docs.espressif.com/projects/esp ... _wifi.html, for esp_wifi_connect() there is the following note:
3. The scanning triggered by esp_wifi_start_scan() will not be effective until connection between ESP32 and the AP is established. If ESP32 is scanning and connecting at the same time, ESP32 will abort scanning and return a warning message and error number ESP_ERR_WIFI_STATE. If you want to do reconnection after ESP32 received disconnect event, remember to add the maximum retry time, otherwise the called scan will not work. This is especially true when the AP doesn’t exist, and you still try reconnection after ESP32 received disconnect event with the reason code WIFI_REASON_NO_AP_FOUND.
I'm particularly interested in the part that I bolded. Can someone provide some clarification on this? I'm wondering if this is related to an issue where sometimes I get WIFI_REASON_NO_AP_FOUND even though the AP is clearly there and other devices can connect to it just fine.

In particular, what does "add the maximum retry time" refer to? And does this apply when making a simple connection, or is it specific to running a scan?

Thanks,
Jason

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Request clarification of esp_wifi_connect() note in docs

Postby WiFive » Tue Oct 02, 2018 8:55 pm

Specific to scanning, if you don't delay your connect retry you will block your scan.

vonnieda
Posts: 145
Joined: Tue Nov 07, 2017 3:42 pm

Re: Request clarification of esp_wifi_connect() note in docs

Postby vonnieda » Wed Oct 03, 2018 2:14 pm

WiFive wrote:Specific to scanning, if you don't delay your connect retry you will block your scan.
Thanks WiFive, I think I got it.

Jason

Who is online

Users browsing this forum: Bing [Bot], Vineethad and 212 guests