Skip to content

Commit

Permalink
esp32: Re-enable mDNS after move to IDF v5.0.2.
Browse files Browse the repository at this point in the history
mDNS was disabled in e465012.  This commit
re-enables it.

For reference see:
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/migration-guides/release-5.x/5.0/removed-components.html

Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
  • Loading branch information
Carglglz authored and dpgeorge committed Jul 11, 2023
1 parent 7bced2e commit 1f35576
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ports/esp32/main_esp32/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## IDF Component Manager Manifest File
dependencies:
espressif/mdns: "~1.1.0"
idf:
version: ">=5.0.2"
5 changes: 5 additions & 0 deletions ports/esp32/main_esp32c3/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## IDF Component Manager Manifest File
dependencies:
espressif/mdns: "~1.1.0"
idf:
version: ">=5.0.2"
3 changes: 2 additions & 1 deletion ports/esp32/main_esp32s2/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## IDF Component Manager Manifest File
dependencies:
espressif/mdns: "~1.1.0"
espressif/esp_tinyusb: "~1.0.0"
idf:
version: ">=5.0.2"
espressif/esp_tinyusb: "~1.0.0"
3 changes: 2 additions & 1 deletion ports/esp32/main_esp32s3/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## IDF Component Manager Manifest File
dependencies:
espressif/mdns: "~1.1.0"
espressif/esp_tinyusb: "~1.0.0"
idf:
version: ">=5.0.2"
espressif/esp_tinyusb: "~1.0.0"
4 changes: 4 additions & 0 deletions ports/esp32/modsocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
#define MDNS_QUERY_TIMEOUT_MS (5000)
#define MDNS_LOCAL_SUFFIX ".local"

#ifndef NO_QSTR
#include "mdns.h"
#endif

enum {
SOCKET_STATE_NEW,
SOCKET_STATE_CONNECTED,
Expand Down
4 changes: 2 additions & 2 deletions ports/esp32/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@ typedef long mp_off_t;
#endif

#ifndef MICROPY_HW_ENABLE_MDNS_QUERIES
#define MICROPY_HW_ENABLE_MDNS_QUERIES (0)
#define MICROPY_HW_ENABLE_MDNS_QUERIES (1)
#endif

#ifndef MICROPY_HW_ENABLE_MDNS_RESPONDER
#define MICROPY_HW_ENABLE_MDNS_RESPONDER (0)
#define MICROPY_HW_ENABLE_MDNS_RESPONDER (1)
#endif

#ifndef MICROPY_BOARD_STARTUP
Expand Down
4 changes: 4 additions & 0 deletions ports/esp32/network_wlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
#include "esp_wifi.h"
#include "esp_log.h"

#ifndef NO_QSTR
#include "mdns.h"
#endif

#if MICROPY_PY_NETWORK_WLAN

#if (WIFI_MODE_STA & WIFI_MODE_AP != WIFI_MODE_NULL || WIFI_MODE_STA | WIFI_MODE_AP != WIFI_MODE_APSTA)
Expand Down

0 comments on commit 1f35576

Please sign in to comment.