[SOLVED] mDNS

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

[SOLVED] mDNS

Postby davdav » Tue May 07, 2019 10:57 am

Hi eveybody,

I'm testing mDNS component and I have setup it using this simple code:

Code: Select all

    	//initialize mDNS service
    	esp_err_t err = mdns_init();
		if (err)
		{
			ESP_LOGW(TAG_WIFI, "MDNS Init failed: 0x%X\n", err);
		}
		else
		{
			//set hostname
			mdns_hostname_set("avior");
			//set default instance
			mdns_instance_name_set("AVIOR");
		}
If I ping from a linux PC I got the below result. Please note "espessif.station"

Code: Select all

 ping avior.local
PING avior.local (10.0.0.12) 56(84) bytes of data.
64 bytes from espressif.station (10.0.0.12): icmp_seq=1 ttl=255 time=100 ms
64 bytes from espressif.station (10.0.0.12): icmp_seq=2 ttl=255 time=318 ms
64 bytes from espressif.station (10.0.0.12): icmp_seq=3 ttl=255 time=242 ms
64 bytes from espressif.station (10.0.0.12): icmp_seq=4 ttl=255 time=161 ms
64 bytes from espressif.station (10.0.0.12): icmp_seq=5 ttl=255 time=82.8 ms
64 bytes from espressif.station (10.0.0.12): icmp_seq=6 ttl=255 time=311 ms
^C
--- avior.local ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5006ms
rtt min/avg/max/mdev = 82.871/202.686/318.001/94.113 ms
Where does "espressif.station" come from? I have searched on esp-idf folder and on forum but I'm not able to find it.
How to change it?

Thanks
Last edited by davdav on Tue May 07, 2019 11:50 am, edited 1 time in total.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: mDNS

Postby WiFive » Tue May 07, 2019 11:15 am

tcpip_adapter_set_hostname

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

Re: mDNS

Postby davdav » Tue May 07, 2019 11:49 am

Thanks @WiFive. Got it.

Who is online

Users browsing this forum: Bing [Bot] and 62 guests