Priority interface while using Ethernet and WiFi in STA mode together

rahul.b.patel
Posts: 62
Joined: Wed Apr 19, 2017 6:35 am

Priority interface while using Ethernet and WiFi in STA mode together

Postby rahul.b.patel » Fri Mar 22, 2019 11:15 am

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.


rahul.b.patel
Posts: 62
Joined: Wed Apr 19, 2017 6:35 am

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

Postby rahul.b.patel » Fri Mar 22, 2019 12:56 pm

Hi WiFive,
Thanks for the quick response,
Now I am able to set default interface Eth/wifi with setting default netif.

Thanks.

phuongpkh
Posts: 1
Joined: Fri Feb 28, 2020 7:54 am

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

Postby phuongpkh » Mon May 25, 2020 9:11 am

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.

technosphere
Posts: 1
Joined: Mon Dec 07, 2020 2:38 am

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

Postby technosphere » Wed Dec 09, 2020 3:17 pm

Hi, Is it possible in Arduino environnement?
Thanks!

Who is online

Users browsing this forum: ESP_Sprite and 347 guests