Code: Select all
static void mdns_initialize(const char *hostname, const char *instance)
{
ESP_ERROR_CHECK( mdns_init() );
ESP_ERROR_CHECK( mdns_hostname_set(hostname) );
ESP_ERROR_CHECK( mdns_instance_name_set(instance) );
mdns_txt_item_t serviceTxtData[3] = {
{"board", "esp32"},
{"u", "user"},
{"p", "password"}
};
ESP_ERROR_CHECK( mdns_service_add("gateway_server", "_http", "_tcp", 80, serviceTxtData, 3) );
}
Code: Select all
D (10574) w5500.mac: working in full duplex
D (10574) w5500.mac: link is up
D (10574) event: running post ETH_EVENT:2 with handler 0x400f1a04 and context 0x3ffc322c on loop 0x3ffafa08
0x400f1a04: event_handler at /home/machine/esp/esp-idf/components/mdns/mdns.c:4699
EDIT: The service works for WiFi, but not for wired connection using W5500 chip.