W5500 ethernet priority over Wifi
Posted: Thu Jun 01, 2023 4:54 pm
ESP-IDF v4.3.2
We're adding a w5500 chip to one of our long established pieces of hardware. I've got everything working correctly, but despite the interface priority of the w5500 being the default of 50, and the wifi interface priority being the default of 100, it ALWAYS attempts to use the wifi before the ethernet. The only way I can get traffic to flow over ethernet is by running esp_wifi_stop(), which seems ridiculous as it adds a ton of complexity to all the connectivity code and having to enable/disable wifi if the link state of ethernet changes.
I feel like I'm missing something. Why is the wifi interface a priority over ethernet?
Here's the code to init the w5500 config
Here's the code to init wifi config
Happy to provide other code it necessary. Thanks!
We're adding a w5500 chip to one of our long established pieces of hardware. I've got everything working correctly, but despite the interface priority of the w5500 being the default of 50, and the wifi interface priority being the default of 100, it ALWAYS attempts to use the wifi before the ethernet. The only way I can get traffic to flow over ethernet is by running esp_wifi_stop(), which seems ridiculous as it adds a ton of complexity to all the connectivity code and having to enable/disable wifi if the link state of ethernet changes.
I feel like I'm missing something. Why is the wifi interface a priority over ethernet?
Here's the code to init the w5500 config
Code: Select all
esp_netif_config_t cfg = ESP_NETIF_DEFAULT_ETH();
eth_netif = esp_netif_new(&cfg);
ESP_ERROR_CHECK(esp_eth_set_default_handlers(eth_netif));
Code: Select all
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));