nerves-networking/mdns_lite

Can't find MDNS device from Android Phones and ESP32 Devices

MikaAK opened this issue · 3 comments

Issue

I'm having an issue where my nerves device is not found by Android Phones or ESP32 devices. I've tested a total of 7 devices with the following results:

Devices That Worked

IPad, Mac Book Pro, Windows 10 Laptop, Windows 10 PC

Devices That Didn't Work

Galaxy S10 Android, Huawei P10 Android, ESP32 module

Info

@fhunleth Mentioned

It could be that mdns_lite’s advertisements are RFC legal, but perhaps slightly different from everyone else’s so the mDNS stack on a constrained device like the ESP32 doesn’t like them

Config

The only config for mdns_lite I've done is setting the host

Steps Taken

I used this android app Network Analyzer to try and sniff out a bit more info.

Doing a LAN Scan, I do see the device listed under the proper name however I'm unable to find it in Chrome it just shows an NXDOMAIN error.

I've tried adding a new service for HTTP as well but that didn't work.

config :nerves_pack, :services, [%{
  name: "Web Server",
  protocol: "http",
  transport: "tcp",
  port: 80,
}, %{
  name: "SSH Remote Login Protocol",
  protocol: "ssh",
  transport: "tcp",
  port: 22
}, %{
  name: "Secure File Transfer Protocol over SSH",
  protocol: "sftp-ssh",
  transport: "tcp",
  port: 22
}, %{
  name: "Erlang Port Mapper Daemon",
  protocol: "epmd",
  transport: "tcp",
  port: 4369
}]

I wasn't able to figure out MDNS logging with the ESP32, though I'm sure there has to be a way to turn it on, I'm just using Arduino to code it. If anyone has any ideas that would be great!!

Is it the service discovery part of mDNS that's not working or a mDNS name lookup that's not working? I.e., are you trying to resolve nerves.local or nerves-wxyz.local or are you trying to discover the ssh service on your network?

Unfortunately, I don't have any Android or ESP32 devices so I can't reproduce.

Well, this is an interesting issue. It turns out Android and mDNS in the browser are not friends https://bugs.chromium.org/p/chromium/issues/detail?id=405925.

For ESP32 it seems you can't use raw nerves.local URLs, you must resolve the IP first then do a lookup using the following docs:
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/protocols/mdns.html#mdns-query

I'll leave both those here for anyone looking at this in the future 😄

Thanks for following up and that link to the chromium thread.