if I have understand well, esp32 always start in wifi mode and after if "SYSTEM_EVENT_ETH_CONNECTED" event is raised you can manage it.
Now I start in this way:
Code: Select all
WiFi.mode(WIFI_MODE_STA);
WiFi.onEvent(WiFiEvent);
WiFi.begin(_SSID_STA.c_str() , _PASSW_STA.c_str());
while (WiFi.status() != WL_CONNECTED) {}
thanks