-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
MDNS/Zeroconfig Stops Working #2009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Some WLED users have had success by periodically scheduling some always-on (hopefully low-power) device to ping WLED's IP address. This type of problem is difficult to reproduce unless someone has the same networking hardware, distance from wifi router or AP, or obstacles between WLED's ESP and router/AP. If you are interested, there are some interesting developments over at https://quinled.info around using ESP32 & ethernet instead of wifi. If you have a home automation system, you could schedule a ping to that WLED IP address and look for the response. If there is no response after some number of pings, have it cycle power to WLED for a few seconds so it automatically restarts. If you have confidence it will last at least 2 days between power cycles, you could install a timer switch and schedule it to loose power every day at noon and power back up ~10m later. |
I know MDNS is nice and all but would still like to know a use case why this is an issue? On a troubleshooting side I haven't noticed this behaviour, though I'm running mine for over 30+ days without reboot. |
I totally understand what you're saying about being difficult to diagnose...but it sounds like "the team" is already aware of the issue...and that it's just hard to reproduce? While not impossible for me...setting up "something" that has to regularly ping my WLED devices and tell them to reboot if their discovery service has failed sounds...hacky. If we know that MDNS can sometimes go stupid intermittently without much other rhyme or reason...why not do something in WLED itself to periodically restart the MDNS advertisement? Seems like - whether or not it's a regular failure - a regular restart of the MDNS service every day or two would be the "right" fix...short of finding what's killing/freezing/breaking it.
I have an app that streams color data to one or more WLED devices via UDP over the network...I use MDNS to discover the WLED instances. And...my app also has a companion mobile app that is just a modded version of the WLED mobile app...and AFAIK, all that is using for discovery is MDNS. I wold assume that any "node-to-node" discovery would also leverage MDNS to find other devices. If not - then what else can I do to discover WLED devices on the LAN? If there's another way to discover them all, I'm all for it. |
After a brief glance through the code, it looks like some kind of loop/timer would just need to be set up in wled.cpp that runs MDNS.begin(... every once in a while... |
Continuing my thought...I would think a loop like this would work to keep restarting the service...
And then also add lastMdnsConnect = millis(); at line 404 in wled.cpp However, looking more at the code, I'm curious why MDNS.update(); is only called under #ifdef ESP8266 at line 98. My C-foo is not the greatest, but shouldn't this be called regularly? |
One more update - since my last post, I've not rebooted any devices, and presently, none of them are discoverable via MDNS, neither with my application, or using the node list in the WLED app... |
@d8ahazard sorry for the issue! There should be no need to restart the MDNS service periodically, as it is re-started after each WiFi reconnect (so losing WiFi temporarily shouldn't be a problem) and What are you using to discover the devices? If you are using the WLED app, you could try if the board is discovered with a different app (I like |
My primary method of discovery is using the "Makaretu.Dns.Multicast" library for .net. It's a pretty basic setup, and works fine for other devices that use MDNS (Nanoleaf, Hue) using the exact same methodology to discover them...I'm just changing the service/domain name I'm searching for. But, to further troubleshoot the issue, I also use "Bonjour Browser" on windows, and have tried the "avahi-browse -a" command on RasPi. When the issue occurs, none of these methods will return the devices that are acting up. One thought - when the devices are "Live"/streaming - does the MDNS responder still work? I'm suddenly wondering if they can't be discovered when streaming over UDP...which is primarily how I use them with my application... |
You very likely found the issue here! Realtime/streaming mode disables some stuff that either would not work with it active (rendering built-in effects) or might cause performance problems (ArduinoOTA, among others). I thought of mDNS and put it outside the block that is disabled in realtime mode. However, in the case ArduinoOTA is enabled, the MDNS library is not directly interfaced, rather I let ArduinoOTA do it for me (it relies on mDNS as well and adds its |
Hey there, I have pretty much the same issue: I have a Raspberry Pi connecting to WLED via UDP to connect it to Apple HomeKit, and it all works pretty much fine, but after a day and a half: boom, gone. WLED vanishes from all bonjour/mDNS lists, isn't accessible via *.local address in the network, and needs to be rebooted manually or via IP address. :( |
Also, wanted to add that I disabled ArduinoOTA on all of my devices, and this issue still persists... |
Right now fixed both this and another issue with using npm bonjour - yes, pretty old package, but still works well with Nodejs14. The Node app now looks up the WLED IP from it's hostname, and uses that until restart fyi: The other issue was that the LEDs randomly turned off for a few seconds and on again for another few seconds, which was pretty annoying when you're using them as a main room illumination - my idea was that maybe because of the mDNS issue some UDP packages are lost - which apparently exactly was the case. Now the LED's work like a charm :) |
this is a similar issue: espressif/arduino-esp32#4406 if you look at the last comment,
|
Nice find. |
So, looks like this was fixed version 4.2? Does that mean that just building a new version of WLED using the latest MDNS libraries would fix this? That was published in July... |
hi everyone, I think I've found a fix (at least a workaround). |
Just curious - did you try building with the latest espressif libraries? Looks like a fix was published already. |
@d8ahazard WLED uses Arduino libraries, this has nothing to do with the ESP-IDF |
Scroll up, look at the issue mentioned by @pbolduc. It's specifically an issue with the MDNS library used by...arduino/esp32. Maybe I'm completely wrong, but I have a very strong feeling that these are the same issue. |
The mentioned issue is for ESP32 and for the ESPmDNS library. So this maybe cause issues for ESP32 users, but definitely not for you, because Wemos D1 Mini = ESP8266 = ESP8266mDNS library You could try the my fork and see if it also works for you |
Short update, I don't have/had any MDNS issues since I use my fork :) |
Master or dev? |
Yes, seen the change. |
@satrik tested your code. Seems to be working fine without side effects. |
The possible fix @satrik suggested has now been included in latest beta release. |
Describe the bug
After being on for "some time", devices stop responding to MDNS, and will not respond again until being rebooted. Web UI and UDP control still works.
To Reproduce
Boot device, connect device to wifi network.
Leave it sit for a few days.
Try MDNS discovery. No response.
Reboot. Discovery works again.
Expected behavior
Consistend replies to MDNS queries, even after weeks of uptime.
WLED version
Wemos D1 Mini
0.12.0
Downloaded from releases on github.
Additional context
Anything else you'd like to say about the problem?
Thank you for your help!
The text was updated successfully, but these errors were encountered: