-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
Status: StaleIssue is stale stage (outdated/stuck)Issue is stale stage (outdated/stuck)
Description
I have Linux computer with Avahi, which works as MQTT broker and Web application. Mobile phone (iOS) and other computers (Windows, Linux) can connect with MQTT broker or web application using name.local address.
When I try to connect with MQTT broker or http using Arduino/ESP8266 I have no problem (both, using IP address or mDNS server name). When I try to use ESP32 I can connect via IP without any problem, but when I change address to DNS name (wg. name.local) I can't connect.
Also, demo resolving mDNS host can't find server:
#include <ESPmDNS.h>
#include <WiFi.h>
void setup() {
WiFi.begin("**", "**");
Serial.begin(115200);
while ( !WiFi.isConnected() )
{
delay(100);
}
Serial.println( "Wifi connected" );
//initialize mDNS service
esp_err_t err = mdns_init();
if (err)
{
Serial.println( "MDNS Init failed: %d\n" );
Serial.println(err);
}
//esolve_mdns_host( hostName );
}
void loop() {
resolve_mdns_host("name.local");
}
void resolve_mdns_host(const char * host_name)
{
Serial.print( "Query: ");
Serial.println( host_name);
struct ip4_addr addr;
addr.addr = 0;
esp_err_t err = mdns_query_a(host_name, 2000, &addr);
if(err)
{
if(err == ESP_ERR_NOT_FOUND)
{
Serial.println( "Host was not found!");
return;
}
Serial.println( "Query Failed");
return;
}
}
Metadata
Metadata
Assignees
Labels
Status: StaleIssue is stale stage (outdated/stuck)Issue is stale stage (outdated/stuck)