- Important Change from v1.4.0
- Important Notes about Portenta_H7
- Why do we need this MDNS_Generic library
- Changelog
- Prerequisites
- Installation
- Packages' Patches
- 1. For Adafruit nRF52840 and nRF52832 boards
- 2. For Teensy boards
- 3. For Arduino SAM DUE boards
- 4. For Arduino SAMD boards
- 5. For Adafruit SAMD boards
- 6. For Seeeduino SAMD boards
- 7. For STM32 boards
- 8. For RP2040-based boards using Earle Philhower arduino-pico core
- 9. For Portenta_H7 boards using Arduino IDE in Linux
- 10. For RTL8720DN boards using AmebaD core
- 11. For SAMD21 and SAMD51 boards using ArduinoCore-fab-sam core
- 12. For Seeeduino RP2040 boards
- Libraries' Patches
- HOWTO Fix
Multiple Definitions
Linker Error - Important Notes
- Basic Usage
- Examples
- Example ResolvingHostNames
- Debug Terminal Output Samples
- 1. ResolvingHostNames on nRF52 Adafruit NRF52840_FEATHER EXPRESS with W5500 using Ethernet_Generic library
- 2. DiscoveringServices on nRF52 Adafruit NRF52840_FEATHER EXPRESS with W5500 using Ethernet_Generic library
- 3. ResolvingHostNames on SAMD21 Seeeduino SEEED_XIAO_M0 with W5500 using Ethernet_Generic library
- 4. DiscoveringServices on NUCLEO_F767ZI with W5x00 using Ethernet_Generic Library
- 5. ResolvingHostNames on NUCLEO_F767ZI with W5x00 using Ethernet_Generic Library
- 6. ResolvingHostNames on RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library
- 7. DiscoveringServices on MBED RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library
- 8. WiFiRegisteringServices on MBED NANO_RP2040_CONNECT
- 9. WiFiRegisteringServices on ESP32_DEV
- 10. RegisteringServices on NRF52840_FEATHER with W5x00 using Ethernet_Generic Library
- 11. WiFiRegisteringServices on PORTENTA_H7_M7
- 12. RegisteringServices on PORTENTA_H7_M7 using Ethernet using Portenta_Ethernet Library
- Debug
- Troubleshooting
- Issues
- TO DO
- DONE
- Contributions and Thanks
- Contributing
- License
- Copyright
Please have a look at HOWTO Fix Multiple Definitions
Linker Error
Already working in v1.3.0. Check
- 1.1 Portenta H7 UDP Multicast not working - mbed v2.4.1 #321
- 1.2 Portenta H7 MDNS Library compatibility #4
Please use the Packages' Patches for mbed_portenta
Why do we need this MDNS_Generic library
MDNS (Multicast DNS) is a protocol to resolve hostnames to IP addresses within small networks that do not include a local name server. It is a zero-configuration service, using essentially the same programming interfaces, packet formats and operating semantics as the unicast Domain Name System (DNS).
The mDNS protocol, published as RFC 6762, uses IP multicast User Datagram Protocol (UDP) packets, and is implemented by the Apple Bonjour and open source Avahi software packages.
mDNS can work in conjunction with DNS Service Discovery (DNS-SD), a companion zero-configuration networking technique specified separately in RFC 6763.
This MDNS_Generic library is based on and modified from Dario Pennisi's ArduinoMDNS Library to provide support to many more boards, such as ESP32, Portenta_H7, Arduino SAMD21, Adafruit SAMD21/SAMD51, Seeeduino SAMD21/SAMD51, nRF52, STM32F/L/H/G/WB/MP1, Teensy, SAM DUE, AVR Mega, RP2040-based boards, etc. and enable those boards to use MDNS services. The currently supported modules/shield is W5x00 using Ethernet, EthernetLarge, Ethernet2 or Ethernet3 library.
-
The WiFiNINA modules/shields are currently supported from v1.2.0, using WiFiNINA_Generic Library
-
The WiFi101 modules/shields are currently supported from v1.2.0, using WiFi101 Library
-
Ethernet2 Library is also supported only after applying the fix to add Multicast feature. See Libraries' Patches
-
ENC28J60 using EthernetENC or UIPEthernet library is not supported as UDP Multicast is not available by design.
-
LAN8742A using STM32Ethernet / STM32 LwIP libraries is not supported as UDP Multicast is not enabled by design, unless you modify the code to add support.
-
ESP32
-
AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense, Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, NINA_B302_ublox, NINA_B112_ublox etc..
-
Arduino SAMD21 (ZERO, MKR, NANO_33_IOT, etc.).
-
Adafruit SAM21 (Itsy-Bitsy M0, Metro M0, Feather M0, Gemma M0, etc.).
-
Adafruit SAM51 (Itsy-Bitsy M4, Metro M4, Grand Central M4, Feather M4 Express, etc.).
-
Seeeduino SAMD21/SAMD51 boards (SEEED_WIO_TERMINAL, SEEED_FEMTO_M0, SEEED_XIAO_M0, Wio_Lite_MG126, WIO_GPS_BOARD, SEEEDUINO_ZERO, SEEEDUINO_LORAWAN, SEEED_GROVE_UI_WIRELESS, etc.)
-
STM32 (Nucleo-144, Nucleo-64, Nucleo-32, Discovery, STM32F1, STM32F3, STM32F4, STM32H7, STM32L0, etc.).
-
STM32F/L/H/G/WB/MP1 (Nucleo-64 L053R8,Nucleo-144, Nucleo-64, Nucleo-32, Discovery, STM32Fx, STM32H7, STM32Lx, STM32Gx, STM32WB, STM32MP1, etc.) having 64K+ Flash program memory.
-
RP2040-based boards, such as Nano RP2040 Connect, using Arduino mbed OS for Nano boards.
-
RP2040-based boards, such as RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Arduino-mbed RP2040 core or Earle Philhower's arduino-pico core.
-
Portenta_H7
- W5x00 using
Ethernet_Generic
library - W5x00's using Ethernet, EthernetLarge or Ethernet3 Library.
- Ethernet2 Library is also supported only after applying the fix to add Multicast feature. See Libraries' Patches
- ENC28J60 using EthernetENC and UIPEthernet library is not supported as UDP Multicast is not available by design.
- LAN8742A using STM32Ethernet / STM32 LwIP libraries is not supported as UDP Multicast is not enabled by design, unless you modify the code to add support.
- Portenta_H7 Ethernet using
Portenta_Ethernet
library
- WiFiNINA using
WiFiNINA_Generic library
- WiFi101 using
WiFi101 library
- U-Blox W101, W102 using
WiFiNINA_Generic library
- ESP8266-AT command using
WiFiEspAT library
- ESP32 using native WiFi
- Portenta_H7 WiFi using
Portenta_WiFi
library
-
Arduino AVR core 1.8.5+
for Arduino (Use Arduino Board Manager) for AVR boards. -
Teensy core v1.57+
for Teensy (4.1, 4.0, 3.6, 3.5, 3,2, 3.1, 3.0) boards. -
Arduino SAM DUE core v1.6.12+
for SAM DUE ARM Cortex-M3 boards. -
Arduino SAMD core 1.8.13+
for SAMD ARM Cortex-M0+ boards. -
Adafruit SAMD core 1.7.10+
for SAMD ARM Cortex-M0+ and M4 boards (Nano 33 IoT, etc.). -
Seeeduino SAMD core 1.8.3+
for SAMD21/SAMD51 boards (XIAO M0, Wio Terminal, etc.). -
Adafruit nRF52 v1.3.0
for nRF52 boards such as Adafruit NRF52840_FEATHER, NRF52832_FEATHER, NRF52840_FEATHER_SENSE, NRF52840_ITSYBITSY, NRF52840_CIRCUITPLAY, NRF52840_CLUE, NRF52840_METRO, NRF52840_PCA10056, PARTICLE_XENON, NINA_B302_ublox, etc. -
ArduinoCore-mbed mbed_rp2040, mbed_nano, mbed_portenta core 3.3.0+
for Arduino (Use Arduino Board Manager) Portenta_H7, RP2040-based boards, such as Nano_RP2040_Connect, RASPBERRY_PI_PICO. -
Earle Philhower's arduino-pico core v2.6.0+
for RP2040-based boards such as RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, etc. -
Arduino Core for STM32 v2.3.0+
for STM32F/L/H/G/WB/MP1 boards. -
ESP32 Core 2.0.5+
for ESP32-based boards. -
Depending on which Ethernet module/shield you're using :
Ethernet_Generic library v2.6.1+
for W5100, W5200 and W5500/WIZ550io/WIZ850io/USR-ES1 with Wiznet W5500 chip.
-
STM32Ethernet library v1.3.0+
for built-in LAN8742A Ethernet on (Nucleo-144, Discovery). . To be used withLwIP library v2.1.2+
. . Not yet ready in v1.4.1 -
WiFiNINA_Generic library v1.8.14-6+
. To install. check if using WiFiNINA for boards such as Nano 33 IoT, nRF52, Teensy, etc. -
Modified WiFi101 Library v0.16.1+
to use SAMD MKR1000, etc. boards with WiFi101. -
WiFiEspAT library v1.4.1+
if using ESP8288/ESP32-AT shields.
The best and easiest way is to use Arduino Library Manager
. Search for MDNS_Generic, then select / install the latest version.
You can also use this link for more detailed instructions.
Another way to install is to:
- Navigate to MDNS_Generic page.
- Download the latest release
MDNS_Generic-master.zip
. - Extract the zip file to
MDNS_Generic-master
directory - Copy whole
MDNS_Generic-master
folder to Arduino libraries' directory such as~/Arduino/libraries/
.
- Install VS Code
- Install PlatformIO
- Install MDNS_Generic library by using Library Manager. Search for MDNS_Generic in Platform.io Author's Libraries
- Use included platformio.ini file from examples to ensure that all dependent libraries will installed automatically. Please visit documentation for the other options and examples at Project Configuration File
To be able to compile, run and automatically detect and display BOARD_NAME on nRF52840/nRF52832 boards, you have to copy the whole nRF52 Packages_Patches directory into Adafruit nRF52 directory (~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0).
Supposing the Adafruit nRF52 version is 1.3.0. These files must be copied into the directory:
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/platform.txt
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/boards.txt
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/cores/nRF5/Udp.h
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/cores/nRF5/Print.h
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/cores/nRF5/Print.cpp
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/variants/NINA_B302_ublox/variant.h
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/variants/NINA_B302_ublox/variant.cpp
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/variants/NINA_B112_ublox/variant.h
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/variants/NINA_B112_ublox/variant.cpp
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/cores/nRF5/Udp.h
Whenever a new version is installed, remember to copy these files into the new version directory. For example, new version is x.yy.z These files must be copied into the directory:
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/platform.txt
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/boards.txt
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/cores/nRF5/Udp.h
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/cores/nRF5/Print.h
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/cores/nRF5/Print.cpp
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B302_ublox/variant.h
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B302_ublox/variant.cpp
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B112_ublox/variant.h
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B112_ublox/variant.cpp
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/cores/nRF5/Udp.h
To be able to compile and run on Teensy boards, you have to copy the files in Packages_Patches for Teensy directory into Teensy hardware directory (./arduino-1.8.19/hardware/teensy/avr/boards.txt).
Supposing the Arduino version is 1.8.19. These files must be copied into the directory:
./arduino-1.8.19/hardware/teensy/avr/boards.txt
./arduino-1.8.19/hardware/teensy/avr/cores/teensy/Stream.h
./arduino-1.8.19/hardware/teensy/avr/cores/teensy3/Stream.h
./arduino-1.8.19/hardware/teensy/avr/cores/teensy4/Stream.h
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz These files must be copied into the directory:
./arduino-x.yy.zz/hardware/teensy/avr/boards.txt
./arduino-x.yy.zz/hardware/teensy/avr/cores/teensy/Stream.h
./arduino-x.yy.zz/hardware/teensy/avr/cores/teensy3/Stream.h
./arduino-x.yy.zz/hardware/teensy/avr/cores/teensy4/Stream.h
To be able to compile and run on SAM DUE boards, you have to copy the whole SAM DUE directory into Arduino sam directory (~/.arduino15/packages/arduino/hardware/sam/1.6.12).
Supposing the Arduino SAM core version is 1.6.12. This file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/sam/1.6.12/platform.txt
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/sam/x.yy.zz/platform.txt
To be able to compile, run and automatically detect and display BOARD_NAME on Arduino SAMD (Nano-33-IoT, etc) boards, you have to copy the whole Arduino SAMD Packages_Patches directory into Arduino SAMD directory (~/.arduino15/packages/arduino/hardware/samd/1.8.13).
Supposing the Arduino SAMD version is 1.8.13. Now only one file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/samd/1.8.13/platform.txt
Whenever a new version is installed, remember to copy this files into the new version directory. For example, new version is x.yy.zz
This file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/samd/x.yy.zz/platform.txt
Supposing the Arduino SAMD version is 1.8.9. These files must be copied into the directory:
~/.arduino15/packages/arduino/hardware/samd/1.8.9/platform.txt
~/.arduino15/packages/arduino/hardware/samd/1.8.9/cores/arduino/Arduino.h
Whenever a new version is installed, remember to copy these files into the new version directory. For example, new version is x.yy.z
These files must be copied into the directory:
~/.arduino15/packages/arduino/hardware/samd/x.yy.z/platform.txt
~/.arduino15/packages/arduino/hardware/samd/x.yy.z/cores/arduino/Arduino.h
This is mandatory to fix the notorious Arduino SAMD compiler error. See Improve Arduino compatibility with the STL (min and max macro)
...\arm-none-eabi\include\c++\7.2.1\bits\stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
Whenever the above-mentioned compiler error issue is fixed with the new Arduino SAMD release, you don't need to copy the Arduino.h
file anymore.
To be able to compile, run and automatically detect and display BOARD_NAME on Adafruit SAMD (Itsy-Bitsy M4, etc) boards, you have to copy the whole Adafruit SAMD Packages_Patches directory into Adafruit samd directory (~/.arduino15/packages/adafruit/hardware/samd/1.7.10).
Supposing the Adafruit SAMD core version is 1.7.10. This file must be copied into the directory:
~/.arduino15/packages/adafruit/hardware/samd/1.7.10/platform.txt
~/.arduino15/packages/adafruit/hardware/samd/1.7.10/cores/arduino/Print.h
~/.arduino15/packages/adafruit/hardware/samd/1.7.10/cores/arduino/Print.cpp
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied into the directory:
~/.arduino15/packages/adafruit/hardware/samd/x.yy.zz/platform.txt
~/.arduino15/packages/adafruit/hardware/samd/x.yy.zz/cores/arduino/Print.h
~/.arduino15/packages/adafruit/hardware/samd/x.yy.zz/cores/arduino/Print.cpp
To be able to compile, run and automatically detect and display BOARD_NAME on Seeeduino SAMD (XIAO M0, Wio Terminal, etc) boards, you have to copy the whole Seeeduino SAMD Packages_Patches directory into Seeeduino samd directory (~/.arduino15/packages/Seeeduino/hardware/samd/1.8.3).
Supposing the Seeeduino SAMD core version is 1.8.3. This file must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/samd/1.8.3/platform.txt
~/.arduino15/packages/Seeeduino/hardware/samd/1.8.3/cores/arduino/Arduino.h
~/.arduino15/packages/Seeeduino/hardware/samd/1.8.3/cores/arduino/Print.h
~/.arduino15/packages/Seeeduino/hardware/samd/1.8.3/cores/arduino/Print.cpp
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/platform.txt
~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/cores/arduino/Arduino.h
~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/cores/arduino/Print.h
~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/cores/arduino/Print.cpp
To use LAN8720 on some STM32 boards
- Nucleo-144 (F429ZI, NUCLEO_F746NG, NUCLEO_F746ZG, NUCLEO_F756ZG)
- Discovery (DISCO_F746NG)
- STM32F4 boards (BLACK_F407VE, BLACK_F407VG, BLACK_F407ZE, BLACK_F407ZG, BLACK_F407VE_Mini, DIYMORE_F407VGT, FK407M1)
you have to copy the files stm32f4xx_hal_conf_default.h and stm32f7xx_hal_conf_default.h into STM32 stm32 directory (~/.arduino15/packages/STM32/hardware/stm32/2.3.0/system) to overwrite the old files.
Supposing the STM32 stm32 core version is 2.3.0. These files must be copied into the directory:
~/.arduino15/packages/STM32/hardware/stm32/2.3.0/system/STM32F4xx/stm32f4xx_hal_conf_default.h
for STM32F4.~/.arduino15/packages/STM32/hardware/stm32/2.3.0/system/STM32F7xx/stm32f7xx_hal_conf_default.h
for Nucleo-144 STM32F7.
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz, these files must be copied into the corresponding directory:
~/.arduino15/packages/STM32/hardware/stm32/x.yy.zz/system/STM32F4xx/stm32f4xx_hal_conf_default.h
- `~/.arduino15/packages/STM32/hardware/stm32/x.yy.zz/system/STM32F7xx/stm32f7xx_hal_conf_default.h
To use Serial1 on some STM32 boards without Serial1 definition (Nucleo-144 NUCLEO_F767ZI, Nucleo-64 NUCLEO_L053R8, etc.) boards, you have to copy the files STM32 variant.h into STM32 stm32 directory (~/.arduino15/packages/STM32/hardware/stm32/2.3.0). You have to modify the files corresponding to your boards, this is just an illustration how to do.
Supposing the STM32 stm32 core version is 2.3.0. These files must be copied into the directory:
~/.arduino15/packages/STM32/hardware/stm32/2.3.0/variants/STM32F7xx/F765Z(G-I)T_F767Z(G-I)T_F777ZIT/NUCLEO_F767ZI/variant.h
for Nucleo-144 NUCLEO_F767ZI.~/.arduino15/packages/STM32/hardware/stm32/2.3.0/variants/STM32L0xx/L052R(6-8)T_L053R(6-8)T_L063R8T/NUCLEO_L053R8/variant.h
for Nucleo-64 NUCLEO_L053R8.
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz, these files must be copied into the corresponding directory:
~/.arduino15/packages/STM32/hardware/stm32/x.yy.zz/variants/STM32F7xx/F765Z(G-I)T_F767Z(G-I)T_F777ZIT/NUCLEO_F767ZI/variant.h
~/.arduino15/packages/STM32/hardware/stm32/x.yy.zz/variants/STM32L0xx/L052R(6-8)T_L053R(6-8)T_L063R8T/NUCLEO_L053R8/variant.h
8. For RP2040-based boards using Earle Philhower arduino-pico core
To be able to automatically detect and display BOARD_NAME on RP2040-based boards (RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040, GENERIC_RP2040, etc) boards, you have to copy the file RP2040 platform.txt into rp2040 directory (~/.arduino15/packages/rp2040/hardware/rp2040/1.4.0).
Supposing the rp2040 core version is 1.4.0. This file must be copied into the directory:
~/.arduino15/packages/rp2040/hardware/rp2040/1.4.0/platform.txt
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied into the directory:
~/.arduino15/packages/rp2040/hardware/rp2040/x.yy.zz/platform.txt
With core after v1.5.0, this step is not necessary anymore thanks to the PR Add -DBOARD_NAME="{build.board}" #136.
Some libraries, such as Adafruit DHT-sensor-library, require the definition of microsecondsToClockCycles(). To be able to compile and run on RP2040-based boards, you have to copy the files in RP2040 Arduino.h into rp2040 directory (~/.arduino15/packages/rp2040/hardware/rp2040/1.4.0).
Supposing the rp2040 core version is 1.4.0. This file must be copied to replace:
~/.arduino15/packages/rp2040/hardware/rp2040/1.4.0/cores/rp2040/Arduino.h
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied to replace:
~/.arduino15/packages/rp2040/hardware/rp2040/x.yy.zz/cores/rp2040/Arduino.h
With core after v1.5.0, this step is not necessary anymore thanks to the PR Add defs for compatibility #142.
To be able to upload firmware to Portenta_H7 using Arduino IDE in Linux (Ubuntu, etc.), you have to copy the file portenta_post_install.sh into mbed_portenta directory (~/.arduino15/packages/arduino/hardware/mbed_portenta/3.3.0/portenta_post_install.sh).
Then run the following command using sudo
$ cd ~/.arduino15/packages/arduino/hardware/mbed_portenta/3.3.0
$ chmod 755 portenta_post_install.sh
$ sudo ./portenta_post_install.sh
This will create the file /etc/udev/rules.d/49-portenta_h7.rules
as follows:
# Portenta H7 bootloader mode UDEV rules
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="035b", GROUP="plugdev", MODE="0666"
Supposing the ArduinoCore-mbed core version is 3.3.0. Now only one file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/mbed_portenta/3.3.0/portenta_post_install.sh
Whenever a new version is installed, remember to copy this files into the new version directory. For example, new version is x.yy.zz
This file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/mbed_portenta/x.yy.zz/portenta_post_install.sh
To avoid compile error relating to PROGMEM, you have to copy the file Realtek AmebaD core pgmspace.h into Realtek AmebaD directory (~/.arduino15/packages/realtek/hardware/AmebaD/3.1.4/cores/ambd/avr/pgmspace.h).
Supposing the Realtek AmebaD core version is 3.1.4. This file must be copied into the directory:
~/.arduino15/packages/realtek/hardware/AmebaD/3.1.4/cores/ambd/avr/pgmspace.h
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied into the directory:
~/.arduino15/packages/realtek/hardware/AmebaD/x.yy.zz/cores/ambd/avr/pgmspace.h
To avoid compile error relating to SAMD21/SAMD51, you have to copy the file ArduinoCore-fab-sam core pgmspace.h into ArduinoCore-fab-sam
samd directory (~/.arduino15/packages/Fab_SAM_Arduino/hardware/samd/1.7.0/boards.txt).
Supposing the ArduinoCore-fab-sam
samd core version is 1.7.0. This file must be copied into the directory:
~/.arduino15/packages/Fab_SAM_Arduino/hardware/samd/1.7.0/boards.txt
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied into the directory:
~/.arduino15/packages/Fab_SAM_Arduino/hardware/samd/x.yy.zz/boards.txt
To be able to compile, run and automatically detect and display BOARD_NAME on Seeeduino RP2040 (XIAO RP2040, Wio RP2040 Mini) boards, you have to copy the whole Seeeduino RP2040 Packages_Patches directory into Seeeduino samd directory (~/.arduino15/packages/Seeeduino/hardware/rp2040/2.7.2).
Supposing the Seeeduino SAMD core version is 2.7.2. This file must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/rp2040/2.7.2/boards.txt
~/.arduino15/packages/Seeeduino/hardware/rp2040/2.7.2/variants/Seeed_XIAO_RP2040/pins_arduino.h
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/boards.txt
~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/variants/Seeed_XIAO_RP2040/pins_arduino.h
If your application requires 2K+ HTML page, the current Ethernet library
must be modified if you are using W5200/W5500 Ethernet shields. W5100 is not supported for 2K+ buffer. If you use boards requiring different CS/SS pin for W5x00 Ethernet shield, for example ESP32, nRF52, etc., you also have to modify the following libraries to be able to specify the CS/SS pin correctly.
To fix Ethernet library
, just copy these following files into the Ethernet library
directory to overwrite the old files:
To fix EthernetLarge library
, just copy these following files into the EthernetLarge library
directory to overwrite the old files:
To fix Ethernet2 library
, just copy these following files into the Ethernet2 library
directory to overwrite the old files:
To add UDP Multicast support, necessary for the UPnP_Generic library:
- To fix
Ethernet3 library
, just copy these following files into theEthernet3 library
directory to overwrite the old files:
To be able to compile and run on nRF52 boards with ENC28J60 using UIPEthernet library, you have to copy these following files into the UIPEthernet utility
directory to overwrite the old files:
To fix ESP32 compile error
, just copy the following file into the ESP32
cores/esp32 directory (e.g. ./arduino-1.8.12/hardware/espressif/cores/esp32) to overwrite the old file:
The current library implementation, using xyz-Impl.h
instead of standard xyz.cpp
, possibly creates certain Multiple Definitions
Linker error in certain use cases.
You can include this .hpp
file
// Can be included as many times as necessary, without `Multiple Definitions` Linker Error
#include "MDNS_Generic.hpp" //https://github.com/khoih-prog/MDNS_Generic
// Can be included as many times as necessary, without `Multiple Definitions` Linker Error
#include "MDNS_Responder.hpp" //https://github.com/khoih-prog/MDNS_Generic
in many files. But be sure to use the following .h
file in just 1 .h
, .cpp
or .ino
file, which must not be included in any other file, to avoid Multiple Definitions
Linker Error
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include "MDNS_Generic.h" //https://github.com/khoih-prog/MDNS_Generic
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include "MDNS_Responder.h" //https://github.com/khoih-prog/MDNS_Generic
Check the new multiFileProject example for a HOWTO
demo.
Have a look at the discussion in Different behaviour using the src_cpp or src_h lib #80
- For Adafruit nRF52, use the SPI's pin as follows:
- SS/CS = 10
- SPI_MOSI = MO(SI)
- SPI_MISO = MI(SO)
- SPI_SCK = SCK
- For Adafruit SAMD21/SAMD51, use the SPI's CS/SS pin as follows:
- Itsy-Bitsy M0/M4, Feather M0 (Express), Hallowing M0 Express, Zero, Metro M0 => use CS = 16 = pin A2
- Feather M4 (SAMD51) => use SS/CS = 9
- Grand Central M4 => use SS/CS = 53
- Hallowing M4 => use SS/CS = 10
- Metro M4 AirLift => use SS/CS = 36
To know the default CS/SS pins of not listed boards, check the related variant.h
files in
~/.arduino15/packages/adafruit/hardware/samd/x.y.zz/variants/board_name/variant.h
- For Arduino SAM DUE, use the SPI's pin as follows:
- SS/CS = 10
- SPI_MOSI = 75 ( pin 4 @ ICSP connector )
- SPI_MISO = 74 ( pin 1 @ ICSP connector )
- SPI_SCK = 76 ( pin 3 @ ICSP connector )
EthernetUDP udp;
MDNS mdns(udp);
mdns.begin(Ethernet.localIP(), hostname.c_str() /*"arduino"*/);
void loop()
{
mdns.run();
}
mdns.setNameResolvedCallback(nameFound);
void nameFound(const char* name, IPAddress ip)
{
// To process the MDNS resolved name and IP from hostname
}
mdns.setServiceFoundCallback(serviceFound);
void serviceFound(const char* type, MDNSServiceProtocol /*proto*/, const char* name, IPAddress ip,
unsigned short port, const char* txtContent)
{
// To process the MDNS resolved name, IP, port and txtContent (if available)
}
mdns.resolveName(hostName, 5000);
mdns.addServiceRecord("You_Service._http", 80, MDNSServiceTCP);
mdns.startDiscoveringService(serviceName, MDNSServiceTCP, 5000);
- DiscoveringServices
- RegisteringServices
- RegisteringServicesWithTxtRecord
- ResolvingHostNames
- multiFileProject. New
- WiFiDiscoveringServices
- WiFiRegisteringServices
- WiFiRegisteringServicesWithTxtRecord
- WiFiResolvingHostNames
- WiFiMultiFileProject. New
Example ResolvingHostNames
1. File ResolvingHostNames.ino
MDNS_Generic/examples/Ethernet/ResolvingHostNames/ResolvingHostNames.ino
Lines 24 to 373 in 24d88d4
2. File defines.h
MDNS_Generic/examples/Ethernet/ResolvingHostNames/defines.h
Lines 23 to 449 in 24d88d4
1. ResolvingHostNames on nRF52 Adafruit NRF52840_FEATHER EXPRESS with W5500 using Ethernet_Generic library
This is terminal debug output when running ResolvingHostNames on nRF52 Adafruit NRF52840_FEATHER EXPRESS with W5500 Ethernet module using Ethernet_Generic library.
Starting ResolvingHostNames on NRF52840_FEATHER with W5x00 using Ethernet_Generic Library
MDNS_Generic v1.4.2
[MDNS] =========== USE_ETHERNET_GENERIC ===========
[MDNS] Default SPI pinout:
[MDNS] MOSI: 25
[MDNS] MISO: 24
[MDNS] SCK: 26
[MDNS] SS: 5
[MDNS] =========================
[MDNS] Board : NRF52840_FEATHER , setCsPin: 10
[MDNS] =========================
[MDNS] Currently Used SPI pinout:
[MDNS] MOSI: 25
[MDNS] MISO: 24
[MDNS] SCK: 26
[MDNS] SS: 5
[MDNS] =========================
Using mac index = 4
Connected! IP address: 192.168.2.118
Registering mDNS hostname: nrf52840-feather-4
To access, using nrf52840-feather-4.local
Enter a mDNS host name via the Arduino Serial Monitor to have it resolved.
Do not postfix the name with ".local"
Resolving 'raspberrypi-02' via Multicast DNS (Bonjour)...
The IP address for 'raspberrypi-02' is 192.168.2.122
Resolving 'raspberrypi-01' via Multicast DNS (Bonjour)...
The IP address for 'raspberrypi-01' is 192.168.2.120
2. DiscoveringServices on nRF52 Adafruit NRF52840_FEATHER EXPRESS with W5500 using Ethernet_Generic library
This is terminal debug output when running DiscoveringServices on nRF52 Adafruit NRF52840_FEATHER EXPRESS with W5500 Ethernet module using Ethernet_Generic library.
Start DiscoveringServices on NRF52840_FEATHER using W5x00 using Ethernet_Generic Library
MDNS_Generic v1.4.2
[MDNS] =========== USE_ETHERNET_GENERIC ===========
[MDNS] Default SPI pinout:
[MDNS] MOSI: 25
[MDNS] MISO: 24
[MDNS] SCK: 26
[MDNS] SS: 5
[MDNS] =========================
[MDNS] Board : NRF52840_FEATHER , setCsPin: 10
[MDNS] =========================
[MDNS] Currently Used SPI pinout:
[MDNS] MOSI: 25
[MDNS] MISO: 24
[MDNS] SCK: 26
[MDNS] SS: 5
[MDNS] =========================
Using mac index = 4
Connected! IP address: 192.168.2.118
Registering mDNS hostname: nrf52840-feather-4
To access, using nrf52840-feather-4.local
Enter a mDNS service name via Serial Monitor to discover instances on the network.
Examples are "_http", "_afpovertcp" or "_ssh" (Note the underscores).
Discovering services of type '_http' via Multi-Cast DNS (Bonjour)...
Found: 'Arduino Bonjour Webserver Example' at 192.168.2.156, port 4 (TCP)
Found: 'Arduino mDNS Webserver Example, Page 2' at 192.168.2.156, port 4 (TCP)
Found: 'Linksys07265' at 192.168.2.12, port 80 (TCP)
Finished discovering services of type _http
This is terminal debug output when running ResolvingHostNames on SAMD21 Seeeduino SEEED_XIAO_M0 with W5500 Ethernet module using Ethernet_Generic library.
Starting ResolvingHostNames on SEEED_XIAO_M0 with W5x00 using Ethernet_Generic Library
MDNS_Generic v1.4.2
=========================
Default SPI pinout:
MOSI:10
MISO:9
SCK:8
SS:4
=========================
[MDNS] Board : SEEED_XIAO_M0 , setCsPin: 1
=========================
Currently Used SPI pinout:
MOSI:10
MISO:9
SCK:8
SS:4
=========================
Using mac index = 0
Connected! IP address: 192.168.2.165
Registering mDNS hostname: seeed-xiao-m0-0
To access, using seeed-xiao-m0-0.local
Enter a mDNS host name via the Arduino Serial Monitor to have it resolved.
Do not postfix the name with ".local"
Resolving 'raspberrypi-01' via Multicast DNS (Bonjour)...
The IP address for 'raspberrypi-01' is 192.168.2.110
Resolving 'raspberrypi-02' via Multicast DNS (Bonjour)...
The IP address for 'raspberrypi-02' is 192.168.2.112
This is terminal debug output when running DiscoveringServices on STM32 Nucleo-144 NUCLEO_F767ZI with W5x00 using Ethernet_Generic Library.
Starting DiscoveringServices on NUCLEO_F767ZI with W5x00 using Ethernet_Generic Library
MDNS_Generic v1.4.2
=========================
Default SPI pinout:
MOSI:11
MISO:12
SCK:13
SS:10
=========================
[MDNS] Board : NUCLEO_F767ZI , setCsPin: 10
=========================
Currently Used SPI pinout:
MOSI:11
MISO:12
SCK:13
SS:10
=========================
Using mac index = 15
Connected! IP address: 192.168.2.98
Registering mDNS hostname: nucleo-f767zi-15
To access, using nucleo-f767zi-15.local
Enter a mDNS service name via Serial Monitor to discover instances on the network.
Examples are "_http", "_afpovertcp" or "_ssh" (Note the underscores).
Discovering services of type '_http' via Multi-Cast DNS (Bonjour)...
Found: 'Arduino mDNS Webserver Example' at 192.168.2.85, port 0 (TCP)
Found: 'Linksys07265' at 192.168.2.12, port 80 (TCP)
Finished discovering services of type _http
This is terminal debug output when running ResolvingHostNames on STM32 Nucleo-144 NUCLEO_F767ZI with W5x00 using Ethernet_Generic Library.
Starting ResolvingHostNames on NUCLEO_F767ZI with W5x00 using Ethernet_Generic Library
MDNS_Generic v1.4.2
=========================
Default SPI pinout:
MOSI:11
MISO:12
SCK:13
SS:10
=========================
[MDNS] Board : NUCLEO_F767ZI , setCsPin: 10
=========================
Currently Used SPI pinout:
MOSI:11
MISO:12
SCK:13
SS:10
=========================
Using mac index = 15
Connected! IP address: 192.168.2.98
Registering mDNS hostname: nucleo-f767zi-15
To access, using nucleo-f767zi-15.local
Enter a mDNS host name via the Arduino Serial Monitor to have it resolved.
Do not postfix the name with ".local"
Resolving 'raspberrypi-02' via Multicast DNS (Bonjour)...
The IP address for 'raspberrypi-02' is 192.168.2.112
Resolving 'raspberrypi-01' via Multicast DNS (Bonjour)...
The IP address for 'raspberrypi-01' is 192.168.2.110
This is terminal debug output when running ResolvingHostNames on RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library.
Starting ResolvingHostNames on RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library
MDNS_Generic v1.4.2
=========================
Default SPI pinout:
MOSI:19
MISO:16
SCK:18
SS:17
=========================
[MDNS] RPIPICO setCsPin: 17
=========================
Currently Used SPI pinout:
MOSI:19
MISO:16
SCK:18
SS:17
=========================
Using mac index = 6
Connected! IP address: 192.168.2.115
Registering mDNS hostname: raspberry-pi-pico-6
To access, using raspberry-pi-pico-6.local
Enter a mDNS host name via the Arduino Serial Monitor to have it resolved.
Do not postfix the name with ".local"
Resolving 'raspberrypi-01' via Multicast DNS (Bonjour)...
The IP address for 'raspberrypi-01' is 192.168.2.120
Resolving 'raspberrypi-02' via Multicast DNS (Bonjour)...
The IP address for 'raspberrypi-02' is 192.168.2.122
This is terminal debug output when running DiscoveringServices on MBED RASPBERRY_PI_PICO using W5x00 using Ethernet_Generic Library.
Start DiscoveringServices on MBED RASPBERRY_PI_PICO using W5x00 using Ethernet_Generic Library
MDNS_Generic v1.4.2
=========================
Default SPI pinout:
MOSI:19
MISO:16
SCK:18
SS:17
=========================
[MDNS] RPIPICO setCsPin: 17
=========================
Currently Used SPI pinout:
MOSI:19
MISO:16
SCK:18
SS:17
=========================
Using mac index = 13
Connected! IP address: 192.168.2.93
Registering mDNS hostname: mbed_raspberry-pi-pico-13
To access, using mbed_raspberry-pi-pico-13.local
Enter a mDNS service name via Serial Monitor to discover instances on the network.
Examples are "_http", "_afpovertcp" or "_ssh" (Note the underscores).
Discovering services of type '_http' via Multi-Cast DNS (Bonjour)...
Found: 'Linksys08398' at 192.168.2.14, port 80 (TCP)
Found: 'Linksys07265' at 192.168.2.12, port 80 (TCP)
This is terminal debug output when running WiFiRegisteringServices on MBED NANO_RP2040_CONNECT using WiFiNINA_Generic Library.
Start WiFiRegisteringServices on MBED NANO_RP2040_CONNECT
MDNS_Generic v1.4.2
Used/default SPI pinout:
MOSI:11
MISO:12
SCK:13
SS:10
Attempting to connect to SSID: HueNet1
SSID: HueNet1
Local IP address: 192.168.2.111
Signal strength (RSSI):-21 dBm
Registering mDNS hostname: mbed-nano-rp2040-connect
To access, using mbed-nano-rp2040-connect.local
kh@kh-Inspiron-3593:~$ ping mbed-nano-rp2040-connect.local
PING arduino.local (192.168.2.111) 56(84) bytes of data.
64 bytes from arduino-1f98 (192.168.2.111): icmp_seq=1 ttl=255 time=65.1 ms
64 bytes from arduino-1f98 (192.168.2.111): icmp_seq=2 ttl=255 time=48.6 ms
64 bytes from arduino-1f98 (192.168.2.111): icmp_seq=3 ttl=255 time=70.8 ms
64 bytes from arduino-1f98 (192.168.2.111): icmp_seq=4 ttl=255 time=93.0 ms
64 bytes from arduino-1f98 (192.168.2.111): icmp_seq=5 ttl=255 time=116 ms
64 bytes from arduino-1f98 (192.168.2.111): icmp_seq=6 ttl=255 time=35.8 ms
64 bytes from arduino-1f98 (192.168.2.111): icmp_seq=7 ttl=255 time=37.2 ms
64 bytes from arduino-1f98 (192.168.2.111): icmp_seq=8 ttl=255 time=8.45 ms
64 bytes from arduino-1f98 (192.168.2.111): icmp_seq=9 ttl=255 time=36.5 ms
64 bytes from arduino-1f98 (192.168.2.111): icmp_seq=10 ttl=255 time=59.5 ms
64 bytes from arduino-1f98 (192.168.2.111): icmp_seq=11 ttl=255 time=29.0 ms
64 bytes from arduino-1f98 (192.168.2.111): icmp_seq=12 ttl=255 time=48.7 ms
...
This is terminal debug output when running WiFiRegisteringServices on ESP32_DEV
Start WiFiRegisteringServices on ESP32_DEV
MDNS_Generic v1.4.2
Attempting to connect to SSID: HueNet1
SSID: HueNet1
Local IP address: 192.168.2.80
Signal strength (RSSI):-25 dBm
Registering mDNS hostname: esp-9abf498
To access, using esp-9abf498.local
kh@kh-Inspiron-3593:~$ ping esp-9abf498.local
PING arduino.local (192.168.2.80) 56(84) bytes of data.
64 bytes from esp32-090ADC (192.168.2.80): icmp_seq=1 ttl=255 time=29.4 ms
64 bytes from esp32-090ADC (192.168.2.80): icmp_seq=2 ttl=255 time=49.3 ms
64 bytes from esp32-090ADC (192.168.2.80): icmp_seq=3 ttl=255 time=20.7 ms
64 bytes from esp32-090ADC (192.168.2.80): icmp_seq=4 ttl=255 time=42.5 ms
64 bytes from esp32-090ADC (192.168.2.80): icmp_seq=5 ttl=255 time=13.5 ms
64 bytes from esp32-090ADC (192.168.2.80): icmp_seq=6 ttl=255 time=43.4 ms
64 bytes from esp32-090ADC (192.168.2.80): icmp_seq=7 ttl=255 time=12.4 ms
64 bytes from esp32-090ADC (192.168.2.80): icmp_seq=8 ttl=255 time=30.0 ms
64 bytes from esp32-090ADC (192.168.2.80): icmp_seq=9 ttl=255 time=59.5 ms
64 bytes from esp32-090ADC (192.168.2.80): icmp_seq=10 ttl=255 time=24.5 ms
64 bytes from esp32-090ADC (192.168.2.80): icmp_seq=11 ttl=255 time=47.2 ms
64 bytes from esp32-090ADC (192.168.2.80): icmp_seq=12 ttl=255 time=18.5 ms
64 bytes from esp32-090ADC (192.168.2.80): icmp_seq=13 ttl=255 time=39.7 ms
64 bytes from esp32-090ADC (192.168.2.80): icmp_seq=14 ttl=255 time=10.9 ms
64 bytes from esp32-090ADC (192.168.2.80): icmp_seq=15 ttl=255 time=33.5 ms
...
This is terminal debug output when running RegisteringServices on NRF52840_FEATHER with W5x00 using Ethernet_Generic Library
Start RegisteringServices on NRF52840_FEATHER using W5x00 using Ethernet_Generic Library
MDNS_Generic v1.4.2
[MDNS] =========== USE_ETHERNET_GENERIC ===========
[MDNS] Default SPI pinout:
[MDNS] MOSI: 25
[MDNS] MISO: 24
[MDNS] SCK: 26
[MDNS] SS: 5
[MDNS] =========================
[MDNS] Board : NRF52840_FEATHER , setCsPin: 10
[MDNS] =========================
[MDNS] Currently Used SPI pinout:
[MDNS] MOSI: 25
[MDNS] MISO: 24
[MDNS] SCK: 26
[MDNS] SS: 5
[MDNS] =========================
Using mac index = 11
Connected! IP address: 192.168.2.106
Registering mDNS hostname: nrf52840-feather-11
To access, using nrf52840-feather-11.local
AddService : NRF52840_FEATHER_mDNS_Webserver._http
kh@kh-Inspiron-3593:~$ ping nrf52840-feather-11.local
PING NRF52840_FEATHER_11.local (192.168.2.106) 56(84) bytes of data.
64 bytes from WIZnetEFBE0C (192.168.2.106): icmp_seq=1 ttl=128 time=0.253 ms
64 bytes from WIZnetEFBE0C (192.168.2.106): icmp_seq=2 ttl=128 time=0.303 ms
64 bytes from WIZnetEFBE0C (192.168.2.106): icmp_seq=3 ttl=128 time=0.289 ms
64 bytes from WIZnetEFBE0C (192.168.2.106): icmp_seq=4 ttl=128 time=0.256 ms
...
This is terminal debug output when running RegisteringServices on PORTENTA_H7_M7 Murata WiFi
Start WiFiRegisteringServices on PORTENTA_H7_M7
MDNS_Generic v1.4.2
Attempting to connect to SSID: HueNet1
SSID: HueNet1
Local IP address: 192.168.2.94
Signal strength (RSSI):-35 dBm
Registering mDNS hostname: portenta-h7-m7
To access, using portenta-h7-m7.local
[MDNS] ::begin: UDP beginMulticast statusCode= OK
[MDNS] ::_sendMDNSMessage: xid= 0
[MDNS] ::_sendMDNSMessage: queryCount= 0
[MDNS] ::_sendMDNSMessage: answerCount= 1024
[MDNS] ::_sendMDNSMessage: authorityCount= 0
[MDNS] ::_sendMDNSMessage: additionalCount= 256
[MDNS] ::_sendMDNSMessage: statusCode = 1
kh@kh-Inspiron-3593:~$ ping portenta-h7-m7.local
PING portenta-h7-m7.local (192.168.2.94) 56(84) bytes of data.
64 bytes from 192.168.2.94 (192.168.2.94): icmp_seq=1 ttl=255 time=49.4 ms
64 bytes from 192.168.2.94 (192.168.2.94): icmp_seq=2 ttl=255 time=153 ms
64 bytes from 192.168.2.94 (192.168.2.94): icmp_seq=3 ttl=255 time=73.4 ms
64 bytes from 192.168.2.94 (192.168.2.94): icmp_seq=4 ttl=255 time=95.7 ms
64 bytes from 192.168.2.94 (192.168.2.94): icmp_seq=5 ttl=255 time=119 ms
64 bytes from 192.168.2.94 (192.168.2.94): icmp_seq=6 ttl=255 time=22.0 ms
64 bytes from 192.168.2.94 (192.168.2.94): icmp_seq=7 ttl=255 time=30.4 ms
64 bytes from 192.168.2.94 (192.168.2.94): icmp_seq=8 ttl=255 time=47.7 m
...
This is terminal debug output when running RegisteringServices on PORTENTA_H7_M7 using Ethernet using Portenta_Ethernet Library
Start RegisteringServices on PORTENTA_H7_M7 using Ethernet using Portenta_Ethernet Library
MDNS_Generic v1.4.2
=========================
Default SPI pinout:
MOSI:8
MISO:10
SCK:9
SS:7
=========================
[MDNS] Board : PORTENTA_H7_M7 , setCsPin: 10
=========================
Currently Used SPI pinout:
MOSI:8
MISO:10
SCK:9
SS:7
=========================
Using mac index = 11
Connected! IP address: 192.168.2.87
Registering mDNS hostname: portenta-h7-m7-15
To access, using portenta-h7-m7-11.local
[MDNS] ::begin: UDP beginMulticast statusCode= OK
AddService : PORTENTA_H7_M7_mDNS_Webserver._http
[MDNS] ::_sendMDNSMessage: xid= 0
[MDNS] ::_sendMDNSMessage: queryCount= 0
[MDNS] ::_sendMDNSMessage: answerCount= 1024
[MDNS] ::_sendMDNSMessage: authorityCount= 0
[MDNS] ::_sendMDNSMessage: additionalCount= 256
[MDNS] ::_sendMDNSMessage: statusCode = 1
kh@kh-Inspiron-3593:~$ ping portenta-h7-m7-15.local
PING portenta-h7-m7-15.local (192.168.2.87) 56(84) bytes of data.
64 bytes from 192.168.2.87 (192.168.2.87): icmp_seq=1 ttl=255 time=0.964 ms
64 bytes from 192.168.2.87 (192.168.2.87): icmp_seq=2 ttl=255 time=0.216 ms
64 bytes from 192.168.2.87 (192.168.2.87): icmp_seq=3 ttl=255 time=1.07 ms
64 bytes from 192.168.2.87 (192.168.2.87): icmp_seq=4 ttl=255 time=4.40 ms
64 bytes from 192.168.2.87 (192.168.2.87): icmp_seq=5 ttl=255 time=0.314 ms
64 bytes from 192.168.2.87 (192.168.2.87): icmp_seq=6 ttl=255 time=0.635 ms
64 bytes from 192.168.2.87 (192.168.2.87): icmp_seq=7 ttl=255 time=0.996 ms
64 bytes from 192.168.2.87 (192.168.2.87): icmp_seq=8 ttl=255 time=4.47 ms
...
Debug is enabled by default on Serial. To disable, add at the beginning of sketch
/* Comment this out to disable prints and save space */
// Debug Level from 0 to 4
#define MDNS_DEBUG_PORT Serial
// Debug Level from 0 to 4
#define _MDNS_LOGLEVEL_ 1
If you get compilation errors, more often than not, you may need to install a newer version of the board's core, dependent libraries or this library version.
Sometimes, the library will only work if you update the core to the newer or older version because some function compatibility.
Submit issues to: MDNS_Generic issues
- Support more boards.
- Support ENC28J60 Ethernet.
- Support LAN8742A Ethernet.
- Support more non-compatible Ethernet Libraries such as Ethernet_Shield_W5200, EtherCard, EtherSia
- Add more examples
- Add support to Arduino SAMD21 (ZERO, MKR, NANO_33_IOT, etc.)
- Add support to Adafruit SAMD21 (Itsy-Bitsy M0, Metro M0, Feather M0 Express, etc.).
- Add support to Adafruit SAMD51 (Itsy-Bitsy M4, Metro M4, Grand Central M4, Feather M4 Express, etc.).
- Add support to Seeeduino SAMD21/SAMD51: LoRaWAN, Zero, Femto M0, XIAO M0, Wio GPS Board, Wio Terminal, Grove UI Wireless, etc.
- Add support to Adafruit nRF52 ( Feather nRF52832, nRF52840 Express, BlueFruit Sense, Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, NINA_B302_ublox, NINA_B112_ublox, etc..
- Add support to SAM DUE.
- Add support to STM32F/L/H/G/WB/MP1.
- Add support to Ethernet W5x00, using either
Ethernet
orEthernetLarge
library - Add debugging feature.
- Add support to Ethernet W5x00, using
Ethernet2
orEthernet3
library - Add support to RP2040-based boards, such as RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Earle Philhower's arduino-pico core.
- Add support to RP2040-based boards, such as NANO_RP2040_CONNECT, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Arduino-mbed RP2040 core.
- Add Version String and Table of Contents
- Add support to RP2040-based boards, such as Nano_RP2040_Connect, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Arduino-mbed RP2040 core using WiFi / WiFiNINA_Generic Library
- Add support to RP2040-based boards, such as RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Earle Philhower's arduino-pico core using WiFi / WiFiNINA_Generic Library
- Add support to ESP32 boards using native ESP WiFi
- Add support to Generic boards, such as MKR WiFi1010, using WiFi101 Library
- Add support to Portenta_H7 Vision-shield Ethernet using
Portenta_Ethernet
library - Add support to Portenta_H7 Murata WiFi using
Portenta_WiFi
library - Fix
multiple-definitions
linker error. - Use new Ethernet_Generic library as default for W5x00.
- Add support to SPI1 for RP2040 using arduino-pico core
- Based on and modified from TrippyLighting's EthernetBonjour and Dario Pennisi's ArduinoMDNS
- Thanks to Zuroy to report the issue in Portenta H7 MDNS Library compatibility #4 then post an issue on
ArduinoCore-mbed
leading to a fix in SocketWrapper: UDP: send packet on endPacket(), not on write() #337 leading to the new version v1.3.0 to provide support to Portenta_H7 using either Murata WiFi or Vision-shield Ethernet - Thanks to Haroun Hajem to report the issue in Example code in WiFiDiscoveringServices not working on Arduino MKR WiFi 1010, found "\r\n" in serial input. #12 leading to the new version v1.4.2 to fix bug
- Thanks to 2001herne to report the issue in UDP Length check discards correct responses when resolving names - On Nano RP2040 Connect #13 leading to the new version v1.4.2 to fix bug
⭐️ TrippyLighting |
⭐️ Dario Pennisi |
Zuroy |
Haroun Hajem |
2001herne |
If you want to contribute to this project:
- Report bugs and errors
- Ask for enhancements
- Create issues and pull requests
- Tell other people about this library
-
Most of the credits go to original authors Georg Kaindl, TrippyLighting and Dario Pennisi.
-
The library is licensed under GPLv3
- Copyright (C) 2010 Georg Kaindl
- Copyright (c) 2017 Arduino LLC. All right reserved.
- Copyright (c) 2020- Khoi Hoang