IsDefault is not ok since it tells me if it is the default, but it doesnt grant that is the connection being used for internet (you can be connected to that network but that network could no have internet access).
I would like to know which is the local ip being used , with that I would be able to know that interface I'm using.
good day @Juraj i have tried WiFi.setDefault(), WiFi.isDefault() , ETH.setDefault(), ETH.isDefault() both ETH works but for the WiFi it doesnt work. I am using esp32 on arduino ide with its wifi and lan8720.
MY CODE:
void loop() {
if (elapsed > 1000) {
ETH.setDefault();
udpSend("LAN test message");
WiFi.setDefault();
udpSend("WiFi test Message");
elapsed = 0;
}
}
ERROR CODE:
my_thesis:78:10: error: 'class WiFiClass' has no member named 'setDefault'
78 | WiFi.setDefault();
| ^~~~~~~~~~