Merge pull request #3698 from BennyE/disablesoftap

esp32s2: Set station mode early to avoid SoftAP on startup
This commit is contained in:
Scott Shawcroft 2020-11-16 14:51:57 -08:00 committed by GitHub
commit f4fd236605
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -72,6 +72,8 @@ void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled) {
return;
}
if (!self->started && enabled) {
// esp_wifi_start() would default to soft-AP, thus setting it to station
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
ESP_ERROR_CHECK(esp_wifi_start());
self->started = true;
return;