khoih-prog / MDNS_Generic

mDNS Library for nRF52, SAMD21, SAMD51, SAM DUE, STM32F/L/H/G/WB/MP1, AVR Mega, RP2040-based boards, etc. using Ethernet W5x00. Supports mDNS (Registering Services) and DNS-SD (Service Discovery). Ethernet_Generic library is used as default for W5x00
GNU General Public License v3.0
38 stars 12 forks source link

ESP32 - WiFiResolvingHostNames #9

Closed patricksebastien closed 2 years ago

patricksebastien commented 2 years ago

Hi,

I am trying to use this library on a ESP32 to search for a software listening on port 12101 UDP. I want to get the IP. So trying to use the example WiFiResolvingHostNames, I get an error whatever the hostname I try. It works using avahi: avahi-browse -r _touchoscbridge._udp

Output is something like this: + wlp4s10f4 IPv4 DESKTOP-OOOO _touchoscbridge._udp local

So what I should search in the Serial terminal? I tried all combo: touchoscbridge, _touchoscbridge, _touchoscbridge._udp.

Also I have an issue with the last character being stipped. I think we can safely remove this?

if (length > 1)
    length = (length - 2) % 256;

https://github.com/khoih-prog/MDNS_Generic/blob/master/examples/WiFi/WiFiResolvingHostNames/WiFiResolvingHostNames.ino#L276 _Resolving '_touchoscbridge.ud' error.

Thanks

khoih-prog commented 2 years ago

For ESP32, it's better to use ESP32-native mDNS service.

Check

  1. mDNS Service
  2. ESPmDNS library

If still not successful, post an issue on ESP32 issues. Remember to post Minimal, Reproducible Example

Without ways to duplicate, it's impossible to know where is wrong to fix and the issue will be ignored.

I'm closing this issue now, and won't reopen until you prove there is a bug of this library.

Good Luck,