Page 1 of 1

Priority interface while using Ethernet and WiFi in STA mode together

Posted: Fri Mar 22, 2019 11:15 am
by rahul.b.patel
Hello,

I am initializing Ethernet and WiFi in STA mode from main, then ESP32 is getting connected to cloud once both Ethernet and WiFi STA gets IP. I checked by disconnecting Ethernet and WiFi one by one to check which interface is being used for cloud connection, and I found that there is no effect of disconnecting Ethernet cable, only disconnecting WiFi router disconnects cloud from ESP32.

So my concern is, If AP is connected to ESP32, Ethernet connection will not come into picture. ESP32 will always use WiFi interface on priority than Ethernet. Is it expected behavior.?

Thanks.

Re: Priority interface while using Ethernet and WiFi in STA mode together

Posted: Fri Mar 22, 2019 12:08 pm
by WiFive

Re: Priority interface while using Ethernet and WiFi in STA mode together

Posted: Fri Mar 22, 2019 12:56 pm
by rahul.b.patel
Hi WiFive,
Thanks for the quick response,
Now I am able to set default interface Eth/wifi with setting default netif.

Thanks.

Re: Priority interface while using Ethernet and WiFi in STA mode together

Posted: Mon May 25, 2020 9:11 am
by phuongpkh
Hi all,
How about the IDF 4.0?
I modified tcpip_adapter_lwip.c
if (esp_netif[TCPIP_ADAPTER_IF_ETH] != NULL && netif_is_up(esp_netif[TCPIP_ADAPTER_IF_ETH])) {
netif_set_default(esp_netif[TCPIP_ADAPTER_IF_ETH]);
But it not effected.

Re: Priority interface while using Ethernet and WiFi in STA mode together

Posted: Wed Dec 09, 2020 3:17 pm
by technosphere
Hi, Is it possible in Arduino environnement?
Thanks!