AT 0.60 - how to use AT+WPS and AT+MDNS ?

MightyPork
Posts: 1
Joined: Mon Feb 01, 2016 6:56 am

AT 0.60 - how to use AT+WPS and AT+MDNS ?

Postby MightyPork » Mon Feb 01, 2016 7:03 am

Hello,

so I updated my modules to the firmware 0.60 which added AT+MDNS and AT+WPS.

But I can't get neither of them to work.

As for WPS, it always fails:

Code: Select all

AT+WPS=1

opmode mismatch when wps

ERROR


I tried MDNS and it says OK, but I'm not sure what it does?

Code: Select all

AT+MDNS=1,"hello","iot",8080


OK


I did this, started a TCP server, but typing the address "http://hello" or "http://hello.local" or "http://hello.iot" in a browser does not seem to work? The IP (192.168.4.1) works fine.

How should the commands be used??

thanks.

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: AT 0.60 - how to use AT+WPS and AT+MDNS ?

Postby ESP_Faye » Mon Feb 01, 2016 11:59 am

Hi,

1. WPS function is used to connect to an AP which supported WPS too. So please enable the station mode first to connect to AP, AT+CWMODE=1.

2. Here is more details about mDNS on wikipedia https://en.wikipedia.org/wiki/Multicast_DNS. You need a MDNS APP to use this function, for example, Bonjour.

Thanks for your interest in ESP8266 !

sarodeoa
Posts: 3
Joined: Tue Feb 16, 2016 10:18 am

Re: AT 0.60 - how to use AT+WPS and AT+MDNS ?

Postby sarodeoa » Tue Feb 16, 2016 10:23 am

Hi,

Do you have an example showing the usage of the WPS command?

Basically a flow of how to use it, like you have for some other commands in your 'Command Examples' document.
Something like this?
1. Set device to STA mode
2. Press the WPS button on the AP
3. AT+WPS=1 on the ESP8266
4. Returns OK. Is that it? If it returns OK means the STA is associated with the AP?

Thank you.

doughboy
Posts: 63
Joined: Thu Mar 05, 2015 1:54 am

Re: AT 0.60 - how to use AT+WPS and AT+MDNS ?

Postby doughboy » Sat Mar 26, 2016 12:48 am

Does AT+MDNS make the esp8266 an mdns responder?
Can you please clarify exactly what is
mdns host name
mdns server name
mdns server port

do I give the esp8266 any name as mdns host name?

is mdns server a bonjour server? so mdns server would be the mac osx ip address and port is 5353?


Thanks.

doughboy
Posts: 63
Joined: Thu Mar 05, 2015 1:54 am

Re: AT 0.60 - how to use AT+WPS and AT+MDNS ?

Postby doughboy » Sat Apr 02, 2016 1:04 am

anyone has example on how to actually use AT+MDNS?

I hope they are not just there for show and taking up space. :)

typepub
Posts: 3
Joined: Mon Apr 11, 2016 12:59 am

Re: AT 0.60 - how to use AT+WPS and AT+MDNS ?

Postby typepub » Mon Apr 11, 2016 1:07 am

Hello,

I'm investigating too. So far, a Bonjour browser is not discovering the service the module is supposed to announce.

I suspect a bug.

Here is my activation procedure:
AT+CWMODE=3
AT+CWLAP
AT+CWJAP_DEF="myNet","myPWD"
AT+MDNS=1,"myservice","myservicetoo",8421
AT+CIPMUX=1
AT+CIPSERVER=1,8421

And mDNS is not working, either when connected to the module as access point or as network client.
I use dns-sd program on a Mac to browse the mDNS services around with no success.

I confirm that a document is needed for these info:
- is mDNS on the module a client or a server ?
- what is the meaning of the fields ?

Reverse engineering in progrès...

typepub
Posts: 3
Joined: Mon Apr 11, 2016 12:59 am

Re: AT 0.60 - how to use AT+WPS and AT+MDNS ?

Postby typepub » Sun Apr 17, 2016 3:39 pm

Hello,

I've found a (partial) solution with AT version 1.0.
1. AT+CWMODE_DEF=3
2. AT+MDNS=1,"mDNS_name","mDNS_other_name",xxxx (port number)
3. connect my PC and the ESP (client) to the same access point.

So, "ping mDNS_name.local" is OK.
And "ping mDNS_other_name.local" is NOK.

A mDns browser do no see any service attached to the ESP IP address. So, let say that it's a tie. On one side, the hostname is resolved. But on the other side, the service is not advertised.

After packet inspection (Wireshark), it's obvious that mDNS is not advertised properly in AT version 0.6. With AT v1.0, it's better but only woks partially:
- not working in AP mode (the most interesting for me...)
- do not advertise service in client mode (so service and port info is useless in the command)

Still investigating bus I suspect a bug in mDNS implementation, at lest for my second point. As it's not open source, I can't check code and contribute to improve it.

Wait and see...

typepub
Posts: 3
Joined: Mon Apr 11, 2016 12:59 am

Re: AT 0.60 - how to use AT+WPS and AT+MDNS ?

Postby typepub » Sun Apr 17, 2016 11:22 pm

doughboy wrote:anyone has example on how to actually use AT+MDNS?

I hope they are not just there for show and taking up space. :)


OK, all is in the delay, but it works as expected while in client access mode.

1. Be sure to be in version AT 1.0. AT+GMR:
AT version:1.0.0.0(Apr 16 2016 13:02:45)
SDK version:1.5.3(89ccffba)
compile time:Apr 16 2016 13:20:26

2. Start Wifi connection (in mode 3 in my case) and check you have an IP address AT+CIFSR:
+CIFSR:STAIP,"192.168.1.33"

3. Start mDNS advertisement AT+MDNS=1,"myesp","http",80
Please note that, even if the datasheet says that you're not allowed to broadcast a service name (explicitly said "http"), it works.

4. The most important: as soon as you issued the command AT+MDNS, ping your name (ping myesp.local in my example) and it should work.
And if you check (with a mDNS client) the advertised service, you will see that HTTP service is advertised on port 80 for ip address 192.168.1.33 and name myesp.local

Be careful: the mDNS info are advertised only once ! if you want to comply to mDNS rules, you have to MANUALLY refresh regularly the info by issuing a new AT+MDNS command. And here is the bug. I could only get mDNS advertised once. All further attempts (using "AT+MDNS=0" or not) to issue a new AT+MDNS=1,"myesp","http",80 command answers "OK" but do not multicast proper info. The only way I found to re-advertise mDNS is to resets the module.

Hope these info will be useful.

And hope that, sometime, the mDNS command will be available in access point mode, which will allow pretty user-friendly server configuration.

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: AT 0.60 - how to use AT+WPS and AT+MDNS ?

Postby ESP_Faye » Mon Apr 18, 2016 5:45 pm

Hi,

We have updated mdns, please try it again http://bbs.espressif.com/viewtopic.php?f=46&t=2054.

Thanks for your valuable advice, we will support MDNS for softAP mode in the future.

RogerFL
Posts: 16
Joined: Fri Jul 24, 2015 10:32 pm

Re: AT 0.60 - how to use AT+WPS and AT+MDNS ?

Postby RogerFL » Fri Feb 16, 2018 4:28 am

typepub, that is a great explanation of what I'm seeing in AT 1.6 / SDK 2.2.1

MSDN advertises one time but never again, even if I re-enable it every 100 sec (attempted the same work around).

Since the TTL is 300 (5 minutes), it works for 5 minutes and then no more.

I use dns-sd on a mac to show the status. Here is the command and output:

Code: Select all

dns-sd -G v4 fb-2.local
DATE: ---Thu 15 Feb 2018---
14:53:29.759  ...STARTING...
Timestamp     A/R Flags if Hostname                               Address                                      TTL
15:11:42.650  Add     2  8 fb-2.local.                            192.168.1.175                                300
15:16:46.724  Rmv     0  8 fb-2.local.                            192.168.1.175                                0


Any suggestions?
Roger Collins
Espressif fan and developer of flame boss smoker controller

Who is online

Users browsing this forum: No registered users and 4 guests