We should make some tooling for mDNS/local nerves devices

Half the problems of figuring out if a device is up during dev is about figuring out if a device came up and with what hostnames?

For pis you get nerves.local or whatever you set plus a nerves-1234.local. When juggling devices you sometimes get collisions, sometimes you unwittingly switch hostname.

I guess we could do a mix command to check mDNS info locally. Would need some different implementation between platforms but…

Good idea?

1 Like

I’ve been using ‎Discovery - DNS-SD Browser on the Mac App Store on mac to browse mDNS data.

Wouldn’t mdns-lite be able to handle that?

3 Likes

I know mdns-lite can do it on Linux because I have used it for that. I don’t am not sure if the story is the same on other platforms…

Given there’s no C code I’d naively expect it to work cross platform. By my understanding it’s UDP/TCP underneight mDNS, which should just work on the beam.

1 Like

That makes some sense. I’ve mostly used mdns_lite with Nerves and VintageNet and VintageNet needs Linux.

Travelling now but want to try this.

@fhunleth what do you think about mix upload maybe checking what appropriate mdns hosts are around and listing them if no hostname is given?

If only one shows up it could try that one as long as it indicates clearly it is going for that particular one. I asusme the current logic is default to nerves.local?

I definitely think easier and better device discovery would be super helpful to anyone using Nerves.

As for mDNS (or SSDP which some people have used with Nerves too), I’ve gotten a little discouraged with Elixir-based CLI tool usage. The main reason being that ideally the tools would query the system responders and there’s no cross-platform API. Starting a new responder (e.g., using mdns_lite on MacOS) conflicts the the system one and can lead to surprises - like the system and CLI are out of sync.

If I could propose an alternative strategy and that’s to implement a really simple discovery protocol that won’t conflict with existing responders, doesn’t do any caching, doesn’t use a privileged port number, and can be implemented in pure Elixir. I haven’t done a review of all that’s out there, but the Mikrotik Neighbor Discovery Protocol seems like it could be made to work really well. Wireshark decodes it so debugging would be easier.

1 Like

Super useful input :slight_smile: