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
Example code in WiFiDiscoveringServices not working on Arduino MKR WiFi 1010, found "\r\n" in serial input. #12
The example code for WiFiDiscoveringServices.ino has a bug. When user inputs a service type from prompt the input will contain "\r\n" and that causes the startDiscoveringService to not return any services.
Steps to Reproduce
Start a mDNS service locallyband start for example a _mqtt._tcp service.
Run the example WiFiDiscoveringServices.ino
Input "_mqtt" in the serial prompt.
Expected behavior
The user should be able to input any service name such as "_mqtt" or "_http" in the serial prompt and get an answer back with the service found.
Actual behavior
When user inputs "_http" or "_mqtt" in the serial prompt the mDNS service returns with nothing only showing this text, "Finished discovering services of type ".
Information
IDE: Platform.io version 3.4.3
Board: Arduino MKR Wifi 1010
OS: Windows 11
Perquisites: Run a mDNS service locally like this: "dns-sd.exe -R mqttb _mqtt._tcp . 1883"
Additional context
Found that this part in the example code, WiFiDiscoveringServices.ino, might hold the bug.
Variable serviceName will contain "\r\n" after user inputs service name to serial prompt and that causes the startDiscoveringService to not work properly.
Describe the bug
The example code for
WiFiDiscoveringServices.ino
has a bug. When user inputs a service type from prompt the input will contain "\r\n" and that causes thestartDiscoveringService
to not return any services.Steps to Reproduce
_mqtt._tcp
service.WiFiDiscoveringServices.ino
Expected behavior
The user should be able to input any service name such as "_mqtt" or "_http" in the serial prompt and get an answer back with the service found.
Actual behavior
When user inputs "_http" or "_mqtt" in the serial prompt the mDNS service returns with nothing only showing this text, "Finished discovering services of type ".
Information
IDE: Platform.io version 3.4.3 Board: Arduino MKR Wifi 1010 OS: Windows 11 Perquisites: Run a mDNS service locally like this: "dns-sd.exe -R mqttb _mqtt._tcp . 1883"
Additional context
Found that this part in the example code,
WiFiDiscoveringServices.ino
, might hold the bug. VariableserviceName
will contain "\r\n" after user inputs service name to serial prompt and that causes thestartDiscoveringService
to not work properly.I've fixed it with replacing the code with this instead.