You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I saw in the FAQ and some comments that mDNS issues currently prevent HomeSpan from supporting Ethernet. Could the following help get this implemented? I don't have the deep knowledge required to give this a try....
I found I had some time last night to investigate and I have mDNS working with w5500 spi ethernet on esp-idf 4.4.4.
I looked in the mdns source code (components/mdns/mdns.c) and I can see that mDNS is enabled in only 3 situations.
You have DHCP Client Enabled and you get assign an IP address.
You have had DHCP Client Enabled, and its been stopped before the event ETHERNET_EVENT_CONNECTED is fired.
You mdns_init() after the Ethernet interface is already connected.
In my situation I started mdns_init() first (as the examples and documentation suggest you should) and then started the ethernet interface with a static IP address and DHCP Server enabled. This meant that when ETHERNET_EVENT_CONNECTED fired, the mdns code checked if if the DHCP Client had been stopped (this check errors out if the DHCP Server is running) so it never started mdns on the interface.
Interestingly enough if you had a static IP and were not running the DHCP Server (i.e you initialise the interface without DHCP Client and go directly to the static IP as opposed to the default of turning DHPC Client off and assigning an IP) this would also fail as the DHCP Client Check would not be ESP_NETIF_DHCP_STOPPED but ESP_NETIF_DHCP_INIT.
There are 2 solutions to this:-
Patch the mdns.c code to handle the condition of ETHERNET_EVENT_CONNECTED with DHCP Server running. I initially did this as a test and all was good.
Don't mdns_init() until after Ethernet is already connected. This is an easier method as it does not require any patching to the mdns code. I took my patch out and just did this, as it works fine for my situation where the ethernet will always be running, always connected and that will never change.
The text was updated successfully, but these errors were encountered:
Thanks for the info -- fortunately I've been able to resolve the issue (see #738). Problem was my use of the Arduino Ethernet driver libraries. The ESP libraries do not seem to have the MDNS issue.
I saw in the FAQ and some comments that mDNS issues currently prevent HomeSpan from supporting Ethernet. Could the following help get this implemented? I don't have the deep knowledge required to give this a try....
From: https://www.reddit.com/r/esp32/comments/vwegz5/comment/jd70zrd/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
The text was updated successfully, but these errors were encountered: