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

[Feature request] Use mdns (avahi/zeroconf) for re-discovering a device on the network #806

Closed
pitsi opened this issue Jul 2, 2021 · 5 comments

Comments

@pitsi
Copy link

pitsi commented Jul 2, 2021

Feature suggestion

Detailed Description
As the title suggests, kore could use mdns so as to rediscover a device from the network that is already registered in it.
The following screenshot is from a device that was already added on kore. It is the third one on my network that runs kodi and (right now) it is the only one without a static ip.
I don't know how, but when I first set it up on kore, it showed up instantly, without having to enter an ip etc, so I think mdns is the reason. I use mdns on my networked devices (avahi/zeroconf under linux, bonjour on windows) since last year, so that I no longer have to look up for every device's ip (from the ones that don't use static).

Context

The reason is simple. Kodi has built in mdns capabilities (via avahi/zeroconf) and, usually, the devices that it runs on get their ip via dhcp. So, when one is added in kore, it is registered through its ip. And when that ip changes, it's settings inside kore must be changed as well so it can discover the device again.

Possible Implementation

No idea, but I know that android does not implement mdns at system level (unlike other oses), so any solution will be specific for kore.

Additional context, screenshots or links

Screenshot of the "issue"

Screenshot_20210627-114206

A few days later, the ip was changed to e.g. 192.168.1.131, so I had to change it inside kore. If kore was using mdns, setting its hostname as mxqpro4k.local (= name of the device + .local suffix, easy discovery via mdns), it would find the device regardless of its ip.

@SyncedSynapse
Copy link
Member

Kore does use mDNS, as implemented by [jmDNS](https://github.com/jmdns/jmdns in https://github.com/xbmc/Kore/blob/master/app/src/main/java/org/xbmc/kore/ui/sections/hosts/AddHostFragmentZeroconf.java

I find that mDNS is somewhat fickle, but the fact that you're not seeing it is most likely an issue on your network.

@pitsi
Copy link
Author

pitsi commented Jul 5, 2021

I can see (= ssh to it, ping it, connect via web browser etc) it from my pc(s) which runs avahi/bonjour, so it is not an issue of the box or the network.

@pitsi
Copy link
Author

pitsi commented Jul 6, 2021

Will kore re-discover a device that is already registered in it? For instance, my pc that uses a static ip and was registered manually in kore with this static ip, can it be rediscovered again via zeroconf as mypc.local?
I tried it now, for both my pc and an old laptop running libreelec (both using static ip, already registered in kore and discoverable via zeroconf) and kore did not find any of the 2.

On the other hand, a skin (bello 7) borked my kodi installation on the tvbox I mentioned above, so I had to set it again from scratch. I removed it from kore and readded it, so now I am waiting for it to get a fresh ip so as to recheck.

@pitsi
Copy link
Author

pitsi commented Jul 6, 2021

I tried substituting the ips with their .local hostnames, e.g. 192.168.1.2 became mypc.local, but kore failed to find them when I pressed test, so I reverted back to their ips.
Are you sure it does use mdns when it comes to re-discovering the devices on the network?

As usual, all of them are pingable, ssh-able, browsable via samba and connectable though their web interfaces with their .local names. Proofs

$ ping -c 4 mxqpro4k.local
ping: socket: Address family not supported by protocol
PING mxqpro4k.local (192.168.1.127) 56(84) bytes of data.
64 bytes from 192.168.1.127 (192.168.1.127): icmp_seq=1 ttl=64 time=3.43 ms
64 bytes from 192.168.1.127 (192.168.1.127): icmp_seq=2 ttl=64 time=4.07 ms
64 bytes from 192.168.1.127 (192.168.1.127): icmp_seq=3 ttl=64 time=2.75 ms
64 bytes from 192.168.1.127 (192.168.1.127): icmp_seq=4 ttl=64 time=3.88 ms

--- mxqpro4k.local ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 2.746/3.530/4.068/0.508 ms

2021-07-06-135144_1280x1024_scrot

2021-07-06-135317_638x480_scrot

2021-07-06-135431_813x485_scrot

@pitsi
Copy link
Author

pitsi commented Aug 25, 2021

I tried kore on a friend's network and devices. Different phones, different tvbox, different router.
On Saturday that I first set up kore, the tvbox had 192.168.1.9 and kore lists this as its ip. Today, 5 days later, the tvbox is on 192.168.1.11 and kore can not find it anymore. It can not re-discover it via its .local domain, exactly as it does for my network.
And it happened on both his phones, not on just one.

Thus, I assume mdns is not actually working for kore and it is not an issue of my network.

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

2 participants