Thanks again Cisco. This mDNS tip is far much smatter than requesting static IP address from our local DHCP server. Looking forward to your next broadcast !
On Linux, Dont know what went wrong, but for me, Only this much worked. #include if (MDNS.begin("room1", WiFi.localIP())) Serial.println("mdns started."); (directly using MDNS instead of mdns, )
I just don't get why some pricks would give this video the thumbs down? It's the best video I've watched on the subject so far and all his other videos are excellent. So why? Thank you so much Cisco. Just ignore those negative chumps. Hope I spelled your name right?
i gave you a shoutout on social media. really appreciated the comment, particularly after being 10 months away from the channel. glad you found them useful, and yup, got the spelling right!
Do you also have a video for the pin problems ? My Problem is: if reconnect the VCC, than sometimes some pins are on HIGH status. Reconnecting again, the same pins are suddenly in LOW status.I also did put a physical 10K resistor to pull the pins LOW. But this dont work. Maybe I should pull them up, and the PUSH Button push to GND ?
Thank you so much Sir. Following your every tutorial and getting 100% success. Thank you so much for your efforts and support. Lots of love from India.❤️
Thanks for the video. I did copy your source code and uploaded it to my esp8266. The serial monitor shows that the mdns has been started like in your video. I get the ip address, too and using it I can connect to esp from my browser and get Hello world back. However, I cannot get connection by typing esp8266-01.local/ to my browser. The browser says: "esp8266-01.local’s server DNS address could not be found." Any idea what may be blocking me to use the mdns even if the ip does work? Thanks.
I'm using Windows 10 in Surface pro 4 and there both Edge and Chrome. I have disabled firewall and defender just to be sure. BTW, the device is Wemos esp 8266 but it has worked for me very well in all projects so far.
Hi, Petri. As Bob mentions (thanks!) mDNS isn't supported by default on Windows. Here's a SO discussion on viable 3rd-party solutions: stackoverflow.com/questions/23624525/standard-mdns-service-on-windows
Thanks Bob and Cisco for the explanation. Is the OTA technique different than this? In an esp8266 solution example for OTA at least the same library was included, and I can indeed see the OTA device in my Arduino IDE. Although it does not work like a clock and the net device is not allways visible, but most of the time I can see it and I can upload my schetch over the air. However, it is not the same as this mDNS I assume... But thanks a lot for pointing out the reason. This may confuse some other Win users, too.
I am learning a lot from your ESP8266 Web-server series of videos. I would really like to see a video using the ESP8266 as a Client sending and receiving data via POST & GET to a Remote Server running PHP script and saving data to a MySQL database. Thanks again.
Thanks for watching our vids, Gary. We're happy to say that after covering the server side of things somewhat extensively, we'll start on the client side! Sending, receiving, *and displaying* data is coming next!
The code is not working for me. I have installed avahi and working in linux, but its not working for me. In fact any code where I have included ESP8266WebServer library is not working. Please Help
I'm glad you liked the video. Yes it can, see the CaptivePortal example: github.com/espressif/arduino-esp32/blob/master/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino
+ACROBOTIC I'm working on Windows 10. mDNS is not working on my laptop. If access it via IP address it works well but doesn't work with mDNS. Please help.
mDNS is not supported by default on Windows, unfortunately. The easiest way would be to install iTunes or Apple Bonjour directly! Thanks for watching our video, and giving the code a try!
I installed Bonjour by Apply and viola it's working. :) Thanks anyway for your videos. Learned a lot. Can you do a video which involves ESP8266 NodeMCU with MATLAB?
Awesome work! Let me ask you a question..I've noticed you rely heavily (and I'm ok with this) on the 'routes' and the server.on method..but I would like to enhance the user browser gui, something like a control panel with buttons, sliders and checkboxes which would (by xmlhttp request, perhaps?) change parameters in the remote board , WITHOUT afecting the page displayed in the browser ....can yo please provide a tip on that? Thanks in advance!
Many different methods achieve the same results. A more advanced way would be to use the xmlhttp object and use AJAX. You'd still use the "server.on" method, but you'd return an entire html page, which would include the necessary JavaScript. We hope to do a video in the future illustrating this. Thanks for watching!
Your videos are awesome! I am having trouble setting up an ESP8266 client to send variables to the mDNS server example you have shown. Which works perfectly for me. I want to send an HTTP GET function to the server from another ESP8266. How can I do this?
[blush] glad you like'em! Have you seen our web client video (ua-cam.com/video/8xqgdXvn3yw/v-deo.html)? Try the example therein, switching your requests from Weather Underground's URLs to your own web server's address. HTH!
I have a esp8266 cp2102 and esp32. I also have my own domain and mysql database. Example.com/data.php?id=1234 where 1234 is the name of the esp. And strings $d1 $d2 $d3 $d4 How do I send strings to/from esp and website without revealing my SQL queries in the esp code?
The instructions worked out for me quite well, but for some reason, I can't toggle the led on and off. It just remains on no matter what. Any solutions?
Make sure you add a delay between setting the pin HIGH and LOW! Thanks so much for watching our videos, we're glad that things are working albeit partially ^_^
Great tutorial, but I am having a problem. I have a mac and windows, but none of them is working(IP is working but not the esp8266-01.local/). I installed bonjour on my windows but not in the Mac. Still, none of them working. So, what should I do to access the website? Thank you for your time.
Hmm, interesting. Mac OS has Bonjour already installed, so there's no need to install anything else. Are you calling the mdns.begin() method in your setup function? When the code is running, do you see the debug message ("MDNS responder started") in the Serial Monitor?
@@nazmulhossain8194 it didn't work for me either. Then i followed an example from mdns library (github.com/esp8266/Arduino/tree/master/libraries/ESP8266mDNS/examples/mDNS_Web_Server) which worked just fine.
You have to delete line 13 "MDNSResponder mdns;" Use "MDNS.begin("esp8266-01")" instead of "mdns.begin("esp8266-01", WiFi.localIP())" (line 51) Add "MDNS.update();" in the loop() function Thats it!
Try searching the web for tutorials on the "Vim" text editor. Otherwise, you can use the text editor built in to the Arduino IDE. Thanks for giving our videos a try!
Is there a problem with android devices? Seem not to support mDNS either... At least mine cannot connect if I input the mDNS name, but works fine with plain IPv4 address.
I've heard of problems with Android devices, but I'm not sure of a workaround (I don't own any). Let me know if you find a solution; thanks for stopping by the channel!
esp8266 client Hi there, thank you very much for this step-by-step tutorial. I've tried it and it works with standard browser. When I try to connect using an esp8266 client using the mdns server name the connection cannot be established. It work perfectly when I use the server IP but this defeat the purpose of using a mdsn name... I've tried many combinations of request from the client but nothing seems to work. I've checked your tutorial and actually there isn't one about esp8266 client sending request to esp8266 mdnes server. Could you suggest a solution? Many thanks and Regards
If you're trying to access the mDNS device, make sure you install Bonjour if you're running Windows OS (see previous comments for details). Thanks so much for watching!
ACROBOTIC Hi, I'm trying to connect to the esp8266 server via an esp8266 client using the mdns server address. It still doesn't work. (Request to the server from osx or windows work like a charm), help on this is much appreciated. I suspect the esp8266 can't resolve mdns names...
Terrific series of videos on the ESP chip. I went through this one on adding a custom local domain name, but there seems to be one thing missing. Please help if you can: Everything indicates the mDNS server is working, but I cannot reach the webpage. I actually have my code set up to run an AP, which works great if I just type in the 192.168.4.1 address. The name I give it will not resolve, however. I read all the comments, adding the "" prefix, but this just will not connect from my phone (iPhone with latest IOS). Any suggestions on what to check is appreciated.
Does it work if you try to access the address (not the IP) from a computer browser? Sometimes the phones have trouble using mDNS. Just for the sake of testing, try running the code on station mode and connect the phone to the same Wi-Fi network as the ESP8266. This will tell you if the problem is with the phone or with the AP part of the firmware. HTH!
Hey, Cody. For the time being we're focusing on custom firmware written in C++ inside the Arduino IDE as we deem it the most beginner-friendly way to get started with the ESP8266. We'll certainly try to cover other options like Python (MicroPython), JavaScript (Espruino), and LUA (NodeMCU) in the future!
Thanks! If I understand correctly, you want to serve .html files from SPIFFS? If so, when the server receives a request for an URL, then you can use the fileStream function to serve the file in response. HTH!
One more great tutorial from you guys!!! Dear one more thing i tried you mDNS code but i found one issue it is working well on my laptop but when I tested it on my mobile which is actually a wifi hospot its not working but when I type IP it works in mobile but when I enter (esp8266-01.local) it does not work
Can you please do a video on how to add mDNS service on Windows. I'm unable to find any help regarding this problem. There are a lot of things about this on the internet but can't figure out how to use mDNS on Windows. Your help would be much appreciated.
Try adding a delay inside your loop function. Also, make sure you have a proper power supply. Finally, try the code without any external component connected to the ESP8266, that way you can determine whether additional hardware is causing the failure.
I was having the same problem, I am using the 3.3v supply from arduino uno and neither did I have any other components connected to it but then I figured out that it is because I had stored my html page in the program memory and I was trying to access that html page stored as a constant character array in program memory as a normal char type array the only work around I could find was to declare that page as a simple const char type array because I couldn't find a way to access data from program memory.
Great tutorial. mDNS didn't work before installed bonjour. After installed it working properly.Thanks for your effort.
Thanks! I could've sworn I had added it to the description, but that wasn't the case (it is now fixed). I'm glad you found the tutorial useful!
@@datasith I have a mac so I did not install bonjour. So, what should I do to access the website?
@@nazmulhossain8194 фф
Thanks again Cisco. This mDNS tip is far much smatter than requesting static IP address from our local DHCP server.
Looking forward to your next broadcast !
No problem, Pascal. Our team is happy you're finding our content useful. Thanks for the encouragement! :)
On Linux, Dont know what went wrong,
but for me, Only this much worked.
#include
if (MDNS.begin("room1", WiFi.localIP()))
Serial.println("mdns started.");
(directly using MDNS instead of mdns, )
I just don't get why some pricks would give this video the thumbs down? It's the best video I've watched on the subject so far and all his other videos are excellent. So why? Thank you so much Cisco. Just ignore those negative chumps. Hope I spelled your name right?
i gave you a shoutout on social media. really appreciated the comment, particularly after being 10 months away from the channel. glad you found them useful, and yup, got the spelling right!
Thanks so much Sisco.
I'm french (from Reunion Island) but i understand very well your english.
very good works
That's awesome Jean-Philippe. I'm so glad you enjoyed the video all the way from Reunion Island!!
Do you also have a video for the pin problems ? My Problem is: if reconnect the VCC, than sometimes some pins are on HIGH status. Reconnecting again, the same pins are suddenly in LOW status.I also did put a physical 10K resistor to pull the pins LOW. But this dont work. Maybe I should pull them up, and the PUSH Button push to GND ?
when i try with IP address i am able to reach my page. But when i try with MDNS URL - the link is broken.
Thank you so much Sir. Following your every tutorial and getting 100% success. Thank you so much for your efforts and support. Lots of love from India.❤️
That's awesome to hear, Prayerson. Thanks so much for the kind words!
Good Job on this tutorial Cisco, I learned a lot from this!
Cody Carter, thanks for the kind words! Our team is glad you're finding the content useful!
Sir , with ip address it is working but even after installing bonjour mDNS is not working.......Is there any other method for mDNS??
and thank u for all of the videos it is more simplified than other crap that i could find in the internet...
Haha, thanks for the kind comment! We're glad you're finding the info useful :)
Thanks for the video. I did copy your source code and uploaded it to my esp8266. The serial monitor shows that the mdns has been started like in your video. I get the ip address, too and using it I can connect to esp from my browser and get Hello world back. However, I cannot get connection by typing esp8266-01.local/ to my browser. The browser says: "esp8266-01.local’s server DNS address could not be found." Any idea what may be blocking me to use the mdns even if the ip does work? Thanks.
Hmm, let's try to find out what's different on your network. What OS and browser are you using?
I'm using Windows 10 in Surface pro 4 and there both Edge and Chrome. I have disabled firewall and defender just to be sure. BTW, the device is Wemos esp 8266 but it has worked for me very well in all projects so far.
Will double-check on Windows shortly and see what's the trick to getting it working -- yup, the WeMos work great and shouldn't be the problem.
Hi, Petri. As Bob mentions (thanks!) mDNS isn't supported by default on Windows. Here's a SO discussion on viable 3rd-party solutions:
stackoverflow.com/questions/23624525/standard-mdns-service-on-windows
Thanks Bob and Cisco for the explanation. Is the OTA technique different than this? In an esp8266 solution example for OTA at least the same library was included, and I can indeed see the OTA device in my Arduino IDE. Although it does not work like a clock and the net device is not allways visible, but most of the time I can see it and I can upload my schetch over the air. However, it is not the same as this mDNS I assume...
But thanks a lot for pointing out the reason. This may confuse some other Win users, too.
mdns doesn't working in my android when accessing from chrome
Brilliant. Thank you Cisco.
No problem, boss. Thanks so much (as always) for watching!
I am learning a lot from your ESP8266 Web-server series of videos. I would really like to see a video using the ESP8266 as a Client sending and receiving data via POST & GET to a Remote Server running PHP script and saving data to a MySQL database. Thanks again.
Thanks for watching our vids, Gary. We're happy to say that after covering the server side of things somewhat extensively, we'll start on the client side! Sending, receiving, *and displaying* data is coming next!
great work, just what I was looking for.
That's great to hear, Gary. I'm glad you found it useful!
It's not working for me on windows 10... any idea? I can access via the ip, but not the mDNS name. Neither I can ping to it.
great job sir. This funtion is all that i've found. im really in the way learning all your tips and tricks. Thanks.
Thanks! Glad you liked it :)
Nice tutorials hade learn lot from u guys
Thanks! Glad you're finding them useful. Many more are on the way :)
Hello, how can i setup mdns “.local” domain on windows computer?
The code is not working for me. I have installed avahi and working in linux, but its not working for me. In fact any code where I have included ESP8266WebServer library is not working. Please Help
So the mDNS works, but not the WebServer?
Hello Team. Good tutorial.
But can the same implementation be used when ESP8266 is an AP rather than Station?
I'm glad you liked the video. Yes it can, see the CaptivePortal example:
github.com/espressif/arduino-esp32/blob/master/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino
+ACROBOTIC I'm working on Windows 10. mDNS is not working on my laptop. If access it via IP address it works well but doesn't work with mDNS. Please help.
mDNS is not supported by default on Windows, unfortunately. The easiest way would be to install iTunes or Apple Bonjour directly! Thanks for watching our video, and giving the code a try!
I installed Bonjour by Apply and viola it's working. :) Thanks anyway for your videos. Learned a lot. Can you do a video which involves ESP8266 NodeMCU with MATLAB?
If we want to access this esp from another wireless, what we have to do.
Awesome work!
Let me ask you a question..I've noticed you rely heavily (and I'm ok with this) on the 'routes' and the server.on method..but I would like to enhance the user browser gui, something like a control panel with buttons, sliders and checkboxes which would (by xmlhttp request, perhaps?) change parameters in the remote board , WITHOUT afecting the page displayed in the browser ....can yo please provide a tip on that?
Thanks in advance!
Many different methods achieve the same results. A more advanced way would be to use the xmlhttp object and use AJAX. You'd still use the "server.on" method, but you'd return an entire html page, which would include the necessary JavaScript. We hope to do a video in the future illustrating this. Thanks for watching!
Good explanation. Thanks.
Thanks for watching, Dhannie!
Your videos are awesome! I am having trouble setting up an ESP8266 client to send variables to the mDNS server example you have shown. Which works perfectly for me. I want to send an HTTP GET function to the server from another ESP8266. How can I do this?
[blush] glad you like'em! Have you seen our web client video (ua-cam.com/video/8xqgdXvn3yw/v-deo.html)? Try the example therein, switching your requests from Weather Underground's URLs to your own web server's address. HTH!
Does mdns also work in esp01?
And what version of the library is needed؟
Because Could not get mdns
It should work on the ESP-01, make sure you install support on your computer (read the pinned comment).
Why mDNS not supported on my Android Phone?
I have a esp8266 cp2102 and esp32. I also have my own domain and mysql database. Example.com/data.php?id=1234 where 1234 is the name of the esp. And strings $d1 $d2 $d3 $d4
How do I send strings to/from esp and website without revealing my SQL queries in the esp code?
I'm Cisco :-) that's really original. I'm Netgear and my last name is Linksys.
:) I guess I was born to work with Network devices!
thank you so much. you saved my life.
haha, I'm glad to hear! thanks so much for watching my vid
How can it works on Android phone's browser? Any idea
The instructions worked out for me quite well, but for some reason, I can't toggle the led on and off. It just remains on no matter what. Any solutions?
Make sure you add a delay between setting the pin HIGH and LOW! Thanks so much for watching our videos, we're glad that things are working albeit partially ^_^
great tutorial! can you make an tutorial about reading/writing on the eeprom?
Thanks, we're glad you like it. Sounds like a plan, we'll add it to the queue!
Great tutorial.
Thanks!
Great tutorial, but I am having a problem. I have a mac and windows, but none of them is working(IP is working but not the esp8266-01.local/). I installed bonjour on my windows but not in the Mac. Still, none of them working. So, what should I do to access the website?
Thank you for your time.
Hmm, interesting. Mac OS has Bonjour already installed, so there's no need to install anything else. Are you calling the mdns.begin() method in your setup function? When the code is running, do you see the debug message ("MDNS responder started") in the Serial Monitor?
@@datasith I copied your code and only changed SSID and PASSWORD.
@@nazmulhossain8194 it didn't work for me either. Then i followed an example from mdns library (github.com/esp8266/Arduino/tree/master/libraries/ESP8266mDNS/examples/mDNS_Web_Server) which worked just fine.
You have to delete line 13 "MDNSResponder mdns;"
Use "MDNS.begin("esp8266-01")" instead of "mdns.begin("esp8266-01", WiFi.localIP())" (line 51)
Add "MDNS.update();" in the loop() function
Thats it!
@@seven-444d34 Thank you, It is working now.
i use your example but its give me following error in arduino compilation:
exit status 1
'toggleLED' was not declared in this scope
Double-check the capitalization in your statements, it's usually tricky to spot! :)
I am totally lost from 1.30 to 1.50. I dont know what terminal it is or what language you are using. Any guidance will be much appreciated.
Try searching the web for tutorials on the "Vim" text editor. Otherwise, you can use the text editor built in to the Arduino IDE. Thanks for giving our videos a try!
Is there a problem with android devices? Seem not to support mDNS either... At least mine cannot connect if I input the mDNS name, but works fine with plain IPv4 address.
I've heard of problems with Android devices, but I'm not sure of a workaround (I don't own any). Let me know if you find a solution; thanks for stopping by the channel!
maybe try DNSServer.h instead e.g. dnsServer.start(dns_port, "www.your_name. com", ip);
esp8266 client
Hi there, thank you very much for this step-by-step tutorial. I've tried it and it works with standard browser. When I try to connect using an esp8266 client using the mdns server name the connection cannot be established. It work perfectly when I use the server IP but this defeat the purpose of using a mdsn name...
I've tried many combinations of request from the client but nothing seems to work. I've checked your tutorial and actually there isn't one about esp8266 client sending request to esp8266 mdnes server. Could you suggest a solution?
Many thanks and Regards
If you're trying to access the mDNS device, make sure you install Bonjour if you're running Windows OS (see previous comments for details). Thanks so much for watching!
ACROBOTIC Hi, I'm trying to connect to the esp8266 server via an esp8266 client using the mdns server address. It still doesn't work. (Request to the server from osx or windows work like a charm), help on this is much appreciated. I suspect the esp8266 can't resolve mdns names...
You need an mDNS client running on the ESP8266. Check this thread for more info: github.com/esp8266/Arduino/issues/1184
Salvatore have you find any solution for connecting mDns client(esp8266)?
Terrific series of videos on the ESP chip. I went through this one on adding a custom local domain name, but there seems to be one thing missing. Please help if you can:
Everything indicates the mDNS server is working, but I cannot reach the webpage. I actually have my code set up to run an AP, which works great if I just type in the 192.168.4.1 address. The name I give it will not resolve, however. I read all the comments, adding the "" prefix, but this just will not connect from my phone (iPhone with latest IOS). Any suggestions on what to check is appreciated.
Does it work if you try to access the address (not the IP) from a computer browser? Sometimes the phones have trouble using mDNS. Just for the sake of testing, try running the code on station mode and connect the phone to the same Wi-Fi network as the ESP8266. This will tell you if the problem is with the phone or with the AP part of the firmware. HTH!
It dose not work in android phone why ??
Can you show us how to program in LUA on the esp8266?
Hey, Cody. For the time being we're focusing on custom firmware written in C++ inside the Arduino IDE as we deem it the most beginner-friendly way to get started with the ESP8266. We'll certainly try to cover other options like Python (MicroPython), JavaScript (Espruino), and LUA (NodeMCU) in the future!
Great tutorial. It works ! Does anyone know how to get the URL working loading pages from SPIFFS ?
Thanks! If I understand correctly, you want to serve .html files from SPIFFS? If so, when the server receives a request for an URL, then you can use the fileStream function to serve the file in response. HTH!
@@datasith got it working. But it doesn't work with windows, Linux and android. Only apple !
@@mialcatel4279 awesome! Yeah, mDNS is tricky. Try installing Apple Bonjour on Windows, and activating mDNS on Linux! HTH!
One more great tutorial from you guys!!! Dear one more thing i tried you mDNS code but i found one issue it is working well on my laptop but when I tested it on my mobile which is actually a wifi hospot its not working but when I type IP it works in mobile but when I enter (esp8266-01.local) it does not work
can we use same code on WeMos D1 Mini?
Yup, same code should work on WeMos and any other development board carrying an ESP8266 :)
Can you please do a video on how to add mDNS service on Windows. I'm unable to find any help regarding this problem. There are a lot of things about this on the internet but can't figure out how to use mDNS on Windows. Your help would be much appreciated.
in next video show us how to ota update the firmware of esp 8266
Will put it on our queue! Thanks for watching, Debashis!
..thanks
YEAH!
Raspberry is much better, cheaper and more userfriendly!
dont work for query service. LOL
if you do it properly, it does. LOL
Thanks for such a nice video.
I have tried the same example but I got below error, can you please help me--
//--------------------------------------------------------------------------------------------------------------------------
I have used ESP8266 small module
//------------------------------------------------------------------------------------------------------------------------........
IP Address: 192.168.1.128
MDNS responder started
Fatal exception 0(IllegalInstructionCause):
epc1=0x40106cf6, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Exception (0):
epc1=0x40106cf6 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
ctx: sys
sp: 3ffffd80 end: 3fffffb0 offset: 01a0
>>>stack>>>
3fffff20: 4021ae9f 09940160 402109c0 3ffecd00
3fffff30: 3fff21e4 00000001 4021aede 402109d9
3fffff40: 4021aced 3fff23ec 3fffff80 3fff166c
3fffff50: 3ffe0000 3fff21e4 3ffee7b0 4021b6a0
3fffff60: 3fff23ec 3fff166c 3ffea1ba 4021a43f
3fffff70: 3fff166c 00000014 4021a9ea 3fff23ec
3fffff80: 3fff166c 3fffdc80 3fff16f4 3ffefd20
3fffff90: 402263a3 3fff23ec 00000000 402064af
3fffffa0: 40000f49 3fffdab0 3fffdab0 40000f49
Try adding a delay inside your loop function. Also, make sure you have a proper power supply. Finally, try the code without any external component connected to the ESP8266, that way you can determine whether additional hardware is causing the failure.
I was having the same problem, I am using the 3.3v supply from arduino uno and neither did I have any other components connected to it but then I figured out that it is because I had stored my html page in the program memory and I was trying to access that html page stored as a constant character array in program memory as a normal char type array the only work around I could find was to declare that page as a simple const char type array because I couldn't find a way to access data from program memory.
is there a way to exchange .local to .com or .org because .local is not work with javascript websocket