micropython-mdns: MDNS with Service Discovery

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
cbrand
Posts: 8
Joined: Fri Jan 01, 2021 5:49 pm

micropython-mdns: MDNS with Service Discovery

Post by cbrand » Tue Jan 05, 2021 11:37 pm

For the next step of my IR remote project, I required MDNS functionality with Service Discovery.

Unfortunately, the ESP32 MicroPython implementation of MDNS only allows querying of A records and exposing its' own IP via MDNS. Also the only running library which I could find was SlimDNS which doesn't support the features I require either.

Due to this, I developed an MDNS library in pure Python which runs via uasyncio and supports querying for records, Service Discovery and full fledged Service Announcement with TXT metadata records. It runs fine on my test system of an ESP32 without the need for SPIRAM. It is ,depending on the operation mode, relatively memory intensive (somewhere around 60kb when running service discovery mode).

I hope it is of use for somebody else too.

Links:

cbrand
Posts: 8
Joined: Fri Jan 01, 2021 5:49 pm

Re: micropython-mdns: MDNS with Service Discovery

Post by cbrand » Wed Jan 06, 2021 3:36 pm

As an addition: I only have an ESP32 for testing, but would be very much interested if somebody who has other MicroPython capable boards to also test the functionality. Ideally, I want this not to only be tested on the ESP32.

rikvermeer
Posts: 3
Joined: Fri Oct 15, 2021 6:14 pm

Re: micropython-mdns: MDNS with Service Discovery

Post by rikvermeer » Sun Oct 31, 2021 5:45 pm

Hi,

I've tried your code on https://github.com/cbrand/micropython-mdns on esp-idf release/v4.4 with micropython 1.17 and built it with:

Code: Select all

#define MICROPY_HW_ENABLE_MDNS_RESPONDER 0
#define MICROPY_HW_ENABLE_MDNS_QUERIES 0
The ESP32 does give me responses that I'm looking for, however it does not advertise on my network.
Shall I file a bugreport or could you help me with some debugging?

Kind regards,
Rik Vermeer

cbrand
Posts: 8
Joined: Fri Jan 01, 2021 5:49 pm

Re: micropython-mdns: MDNS with Service Discovery

Post by cbrand » Mon Oct 03, 2022 9:25 pm

I know I am very late to the party. I do not get notifications on this forum and didn't monitor the post anymore.

Best thing is to create a bug report on GitHub as I will get push notifications there. However, there were people recently who reported
issues with the service advertisement too.

I fixed the bugs and the newest Version 1.2.1 is verified to be running with avahi and Python zeroconf. Please give it another shot if you are still interested.

Post Reply