esp-rs / esp-idf-svc

Type-Safe Rust Wrappers for various ESP-IDF services (WiFi, Network, Httpd, Logging, etc.)
https://docs.esp-rs.org/esp-idf-svc/
Apache License 2.0
330 stars 183 forks source link

Change default eth key #502

Closed DaneSlattery closed 1 month ago

DaneSlattery commented 1 month ago

According to this issue, https://github.com/espressif/esp-idf/issues/10359

The default name for an ethernet netif is ETH_DEF, but it is hardcoded as ETH_CL_DEF. The mDNS service attempts to look up the netif based on the name during initialisation, but it won't find it unless the user wraps their own netif with the new name.

ivmarkov commented 1 month ago

Hmmmm, what about WIFI? Is there any "default" key which is expected there? We currently have "WIFI_STA_DEF" and "WIFI_AP_DEF". Are these correct?

What about the so called "router" Eth, which is nothing else but a fixed-conf Eth?

DaneSlattery commented 1 month ago

Looking at the code here, https://github.com/espressif/esp-protocols/blob/85202456578019689f8d3527042df5462da010f9/components/mdns/mdns.c#L151 it seems like the WIFI names are good defaults.

The Ethernet router, PPP or thread interfaces don't seem to be considered in this case.

This change will bring the esp-idf-svc to parity with https://github.com/espressif/esp-idf/blob/a97a7b0962da148669bb333ff1f30bf272946ade/components/esp_netif/include/esp_netif.h#L116 and https://github.com/espressif/esp-idf/blob/a97a7b0962da148669bb333ff1f30bf272946ade/components/esp_netif/include/esp_netif_defaults.h#L92

ivmarkov commented 1 month ago

What about the so called "router" Eth, which is nothing else but a fixed-conf Eth?

What about this? I think you should change it there as well.

DaneSlattery commented 1 month ago

It doesn't seem to interact with the DNS system at all, so I'm not sure what it should be. The ETH_RT_DEF name seems fine to me

ivmarkov commented 1 month ago

OK fine, I'll merge as is, and will change the RT key if necessary later.