Skip to content

Usage of ESP-IDF mDNS functions? #92

@brotherdust

Description

@brotherdust

Hello!
I notice that mdns.h is included in espidf.h and wanted to try it out. I'll admit that I'm not very literate with C, but through some poking around I was able to find the function I wanted, which was a simple mDNS query.

import espidf
ip_addr = espidf.ip_addr_t()
q = espidf.mdns_query_a("myhost.local", 2000, ip_addr)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SyntaxError: Can't convert ip_addr_t to ip4_addr_t!

Ok. I guess this was expected because I didn't hand it a ip4_addr_t, but that's not in the espidf module. So, maybe it needs to be included in espidf.h? Ok. Yeah. Let's try that. I added #include "lwip/ip4_addr.h" to espidf.h and recompiled, expecting gen_mpy to take care of the rest, which it doesn't.

So, my questions are:

  1. Why is mdns.h included in the first place?
  2. Why isn't gen_mpy adding the types from lwip/ip4_addr.h?
  3. Can you provide an example of using the ESP-IDF's mDNS functions, as provided by gen_mpy, in uPy? Maybe I'm just doing this all wrong.

Any help would be very much appreciated.
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy