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

Change mdns flooding approach into a real bonjour strategy #32

Closed
HomeACcessoryKid opened this issue Oct 15, 2017 · 9 comments
Closed

Comments

@HomeACcessoryKid
Copy link
Owner

HomeACcessoryKid commented Oct 15, 2017

ESPHKD#12 gives initial reason for opening this issue.

@HomeACcessoryKid
Copy link
Owner Author

Once an iPhone returns to the WiFi hotspot it first of all queries the accessories it hopes to control.
It is our task to recognise this request and respond to it while shouting our own info in an exponential backoff scheme.
NetServices section "Exponential Back-off and Service Announcement"

Internet Protocol Version 4, Src: 192.168.178.4, Dst: 224.0.0.251
User Datagram Protocol, Src Port: 5353, Dst Port: 5353
Multicast Domain Name System (query)
    Transaction ID: 0x0000
    Flags: 0x0000 Standard query
    Questions: 7
    Answer RRs: 1
    Authority RRs: 0
    Additional RRs: 1
    Queries
        _hap._tcp.local: type PTR, class IN, "QU" question
        _airplay._tcp.local: type PTR, class IN, "QU" question
        _raop._tcp.local: type PTR, class IN, "QU" question
        HomeACcessory._hap._tcp.local: type TXT, class IN, "QU" question
        HomeACcessory._hap._tcp.local: type SRV, class IN, "QU" question
        HK_22:34:56:78:9A:BC.local: type AAAA, class IN, "QU" question
        HK_22:34:56:78:9A:BC.local: type A, class IN, "QU" question
    Answers
        _hap._tcp.local: type PTR, class IN, HomeACcessory._hap._tcp.local
            0... .... .... .... = Cache flush: False
            Time to live: 4500
            Data length: 2
            Domain Name: HomeACcessory._hap._tcp.local
    Additional records
        <Root>: type OPT

@HomeACcessoryKid
Copy link
Owner Author

I have started to encode this in a short-cut strategy.
Seems easier than expected... if all you want to do is the essential.
Stay tuned

@HomeACcessoryKid
Copy link
Owner Author

pushed branch real-mdns
Please test??

@maccoylton
Copy link

Tested some today, so far no issues, positive differences I've seen:-

  • didn't have to delete my home before re-adding the accessory

  • accessory seems to be consistently accessible from both Wifi and Cellular networks

  • accessory seems to be more responsive, quite often in the past it would say updating for a while when you opened the home app

will continue to test but so far good step forward

Thanks

maccoylton

@HomeACcessoryKid
Copy link
Owner Author

HomeACcessoryKid commented Nov 9, 2017 via email

@maccoylton
Copy link

Yes, I’d agree, so far so good on my end, plan to update my other devices this weekend, many thanks for your continued efforts

@HomeACcessoryKid
Copy link
Owner Author

That bug is a real one, stopping good messages in more complex environments
Would advice you to not update yet (unless you do not mind doing it again)
OTA updating is my next target, so we can do it remotely.

@maccoylton
Copy link

Thanks, held off updating, happy to test when you are ready.

@HomeACcessoryKid
Copy link
Owner Author

HomeACcessoryKid commented Nov 12, 2017 via email

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

No branches or pull requests

2 participants