esp_wifi_scan_start() always returns -1

jhinkle
Posts: 19
Joined: Wed Aug 29, 2018 3:17 pm

esp_wifi_scan_start() always returns -1

Postby jhinkle » Sun Feb 16, 2025 4:50 pm

I'm upgrading an application I made back in 2017 that used an ESP8266 to use a ESP32 today.

Application starts in AP mode only. When a User connects a web page listing the Access Points found by esp_wifi_scan_start() are displayed and the user selects one and provides its password. Then the application switches to APSTA mode and provides web services based on the network associated with the Access Point selected.

I have tried issuing esp_wifi_scan_start() when the event Connect and IP_Assigned occur but in both cases esp_wifi_scan_start() returns a -1. I've tried blocking and non-blocking - same results.

I tried to find the source code but it appears to be part of the ESP binary blob.

What has changed from 2017 ESP8266 IDF and the ESP-IDF of today that this capability does not work?

Any insight on how to make esp_wifi_scan_start() function?

Does esp_wifi_scan_start() work in ESP32 AP mode (it did on 8266)?

NOTE: WIFI Event WIFI_EVENT_SCAN_DONE never fires as I don't think esp_wifi_scan_start() ever starts.

Thanks.

MicroController
Posts: 2048
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: esp_wifi_scan_start() always returns -1

Postby MicroController » Sun Feb 16, 2025 5:45 pm

jhinkle wrote:
Sun Feb 16, 2025 4:50 pm
Does esp_wifi_scan_start() work in ESP32 AP mode (it did on 8266)?
No: https://docs.espressif.com/projects/esp ... wi-fi-scan

jhinkle
Posts: 19
Joined: Wed Aug 29, 2018 3:17 pm

Re: esp_wifi_scan_start() always returns -1

Postby jhinkle » Mon Feb 17, 2025 12:27 am

Thanks. I have read the documents about 6 times -- NEVER saw or comprehended THAT single sentence. Thanks again.

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 161 guests