Skip to content

Commit d4ab00f

Browse files
BennyEBennyE
authored andcommitted
Set station mode early to avoid SoftAP on startup
1 parent f2e911a commit d4ab00f

File tree

1 file changed

+2
-0
lines changed
  • ports/esp32s2/common-hal/wifi

1 file changed

+2
-0
lines changed

ports/esp32s2/common-hal/wifi/Radio.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled) {
7272
return;
7373
}
7474
if (!self->started && enabled) {
75+
// esp_wifi_start() would default to soft-AP, thus setting it to station
76+
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
7577
ESP_ERROR_CHECK(esp_wifi_start());
7678
self->started = true;
7779
return;

0 commit comments

Comments
 (0)