Since ESP-IDF v5, mDNS has been moved from built-in library to component library.
I need to use the following command to install it.
This works fine in VSC using Espressifs ESP-IDF extension…
idf.py add-dependency “espressif/mdns^1.0.7”
Since we dont have idf.py to use, how do we do it ?
I have exactly the same issue, couldn’t figure out how to solve it yet.
I believe it’s still a generic IDF component, so the instructions here should be relevant. In a nutshell, create a new folder
components in the root of your project (near
platformio.ini) and copy the
mdns component to that folder directly from the repository esp-protocols/components/mdns at master · espressif/esp-protocols · GitHub
Just tried it, and could not get it to compile.
Maybe you can create a new project and give it a try.
Be sure to use platform = firstname.lastname@example.org, if you do it.
Mind sharing the error message or maybe a simple project to reproduce the problem?
I get very strange behavior when having two versions of IDF on both my system at home and at work.
Using platform = email@example.com and platform = firstname.lastname@example.org
Most of the time it causes compile issues for new projects. When it does this the only solution I have found is to delete my .platformio folder and start again.
Anyways… I just tired that and now it compiles.
Just an update for anyone in the future. I’m using
platform = email@example.com in my platform.ini
idf_component.yml in your src/ directory (IMPORTANT: it must be in src, not in your project home!). Do a full clean and build. The internal idf system will pull the components for you (Running `idf.py reconfigure` from PlatformIO · Issue #1157 · platformio/platform-espressif32 · GitHub). After doing a build, it’ll add a managed_compoments/ directory, which I added to my .gitignore.
My idf_component.yml looks like:
mDNS was removed from ESP-IDF 5.0
You can add it manually by running the following command in the terminal
idf.py add-dependency espressif/mdns