Skip to content
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

MDNS connection failed after router restarts. #166

Closed
hitenlulla opened this issue Mar 13, 2022 · 8 comments
Closed

MDNS connection failed after router restarts. #166

hitenlulla opened this issue Mar 13, 2022 · 8 comments

Comments

@hitenlulla
Copy link

Hello,
I found this small problem, When the ESP8266 is on and the router goes off, on reconnection with router the Homekit accessories become 'not responding'. And when I restart the ESP, the accessories are back online.
ps, I have used MDNS.announce() for every 10 seconds and everything works properly except this edge case.

I found a temporary solution though, it looks like when the connection is found after being disconnected, the MDNS service starts but the connection to the client is not made, I removed the line 3169 in arduino_homekit_server.cpp which is a return statement, to make the function always start making connection to the client when the device gets reconnected.

// arduino_homekit_server.cpp : line 3164
if (homekit_mdns_started) {
		MDNS.close();
		MDNS.begin(name->value.string_value, staIP);
		INFO("MDNS restart: %s, IP: %s", name->value.string_value, staIP.toString().c_str());
		MDNS.announce();
		// return;                                                      **<- Remove this line**
}

But this leads to blocking of Loop when the internet in the router is lost and I cannot afford that. Hence this workaround was a big flop. Can anyone help me solve this problem?

@ruleechen
Copy link

I encountered this issue before. My solution is to comment out this line.
// MDNS.close();

@hitenlulla
Copy link
Author

I encountered this issue before. My solution is to comment out this line.

// MDNS.close();

Is this solution stable? Have you tested it in the long run?

@ruleechen
Copy link

0DA81267-845D-4C72-AAB0-7D5287519386

@ruleechen
Copy link

#139

@hitenlulla
Copy link
Author

#139

Hello sir, do you mind connecting on any social media? I'm new into this technology and I want to learn more about it.

@ruleechen
Copy link

#139

Hello sir, do you mind connecting on any social media? I'm new into this technology and I want to learn more about it.

Sorry I don't have a global social media. Github would be fine for us.

@ivishaltejwani
Copy link

0DA81267-845D-4C72-AAB0-7D5287519386

hey would you be able to share which app is this, have been struggling with ota

@ruleechen
Copy link

hey would you be able to share which app is this, have been struggling with ota

Please refer to this repo. It is a framework build base upon esp8266. It includes some common used functionalities as you can see them in the top menu of the screenshot.
https://github.com/ruleechen/home-esp8266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants