Build a Webserver on NodeMCU ESP8266 in Station Mode
HTML-код
- Опубликовано: 11 фев 2022
- Learn how to build a Webserver on NodeMCU ESP8266 in Station Mode. We can build webserver on ESP8266 in three different modes namely Station Mode (STA), Soft Access Point Mode (AP) and Station + Soft AP Mode. This lightweight webserver running on ESP8266 microcontroller serves HTTP request and response. We will program this HTTP Webserver in Arduino. In the end, we’ll control LED connected to ESP8266 from web browser as a client from desktop or mobile phone
[SUPPORT]
►► Get FREE TRIAL of Altium Designer: www.altium.com...
►► Need Help? To Learn Embedded Systems: courses.binary...
[TIMESTAMPS]
00.00 Introduction
00.34 Code overview
06.06 HTTP routes
14.38 Create webpage
19.14 Upload Arduino code
20.18 Test webserver
22.06 Client-server communication
24.02 Finally control led through webpage
[LINKS]
►► Project Files: github.com/bin...
Thank you very much for the video. Learned a lot ❤️❤️
Hi Aruna, Glad it was helpful!
Sehr gut
Hi, D4 'is not declared', so I entered 2, (GPI02), and it works. This is all good stuff, well done..
Excellent!
Same, but took another route. Added before void setup() {
INT D4 = 2;
That resolved "error: 'D4' was not declared in this scope" compile errors.
I wasn't seeing the wifi connection status and IP address so I increased the "delay(200)" value to "delay(10000)" and that was a long enough for everything to work as advertised. Thanks for sharing!
Very Good explanation,👌🙏 just one thing what is ptr ptr?
Thanks, bro. It cleared my so many doubts. But the problem with this setup is, each time, a new webpage is generated when client make a request. More the data, more the time for page to be uploaded. If you don't mind, would you like to make a detailed video on websocket. You are really awesome to make things understandable.
Yes, definitely. I'll cover in next few videos in this NodeMCU ESP8266 series
Good day!
Thanks
It just works
great video
Thanks Alex!
Thanks dude
I would love to control 6 esp8266 with one relay on each around my home, but have not found any lesson to show me to help, perhaps you can?
1 esp8266+relay = bedroom, 1 esp8266+ relay = lounge 1 esp8266+relay kitchen 1 esp8266+relay = workshop and so on.
Hi Bob, presently I have already made video on interfacing relay with ESP8266 NodeMCU. I think in your project you may need to make one ESP device as a web server than other 6-esp8266 devices as a client. I'll try to make such a video in future. As I been doing busy these day. I hope you understand making video takes a a lot of time and effort. But still you can make it if you follow my all videos piece by piece and put them together. Wish you good luck and best wishes!
Sir making webserver for node mcu is best or blynk iot is best
Hi Rahul, It depends on your project need. Please understand Blynk or local webserver running on NodeMCU ESP8266 both are good. Blynk will provide you public access from entire world and webserver will be local in the same network only. I hope this answers your question. Good luck and best wishes!
hey thank you so much for the tutorial
i really enjoy how you take your time and explain every line of code to make sure we properly understand it
youre 100x better then the trashy diy youtubers who dont explain shit and just make people download and run the code
but i didnt understnad what ptr ment can you tell me
Hi Siddharth, I'll try to cover pointers in upcoming videos of NodeMCU ESP8266. Thanks for your words concerning video. Best wishes !!
@@BINARYUPDATES okay thank youuu:D
my webpage from arduino wants to send a text data to 8266wifinpdemcu. what configuration I should make in 8266 sketch to receive it. I have the webserver running. now I have to take the text from a form and paste it in input text area of the client.
thanks
Hi
is it possible to make nodemcu to have static local ip?
Yes, its possible we just have to mentioned in our nodemcu webserver code and assign fixed static IP address. I've covered this in another webserver example video lesson on my channel. I hope you'll find that video in playlist. Good luck and best wishes!
bro i am not able to use my mobile hotspot to contol led , it is working on my wifi - internet connection of home but does not work on mobile hotspot .
Hi Yash, it happens because there are mobile phones OS. And some of these android or iOS phone requires you to make changes in security settings. If your mobile phone OS has strict WiFi settings then it won't allow access of webserver hosted on NodeMCU ESP8266 over hotspot. I hope this may help you. Good luck and best wishes!
does this work on esp01 module
Hi Raymond, code will surely work with ESP-01S Module. I have dedicated video of it. You'll find as a ESP-01S Firmware update video lesson on our channel. Good luck!
LED blinking not working by using IP adress in this code
Hi, Thanks for the video, I tried the same code for my ESP8266 by connecting LED, but I got an error" failed to write to target RAM(result was 0107) " .Could you please guide what might be the error and how can I fix it?
Hi Sree, this seems to be an issue with flash memory of ESP8266. If you're using NodeMCU then you must consider using FLASH button. You should press and hold this flash button for long time. You can always keep serial monitor open to see status. and then try and upload code arduino code for webserver. I hope this may help you. Good luck!
Hello,
Thanks for the Video,😀 yes it is very well explained I enjoyed it and in the first go I could get it working . 👍
Have you any video on setting up the light HTML page.
I am looking at adding two items one is to add a second button and next to add a link to open a page to send configuration data to the Webserver Client.
Support and help appreciated. AyDe
Do you plan on making a series of Webserver using NodeMCU or ESP32.
I want to make webpage where you type a text as input and NodeMCU will use this input to do something about it. For examples, you type in some text in webpage and display it in dot matrix or maybe use trackbars in webpage to change RGB Led's red, green, and blue values. Something like that.
I saw other youtubers showing this type of thing. But they never explain a code. They just tell you to copy and paste their code.
Maybe you can teach html and javascript that is can be useful for Arduino/NodeMCU.
I already took a month to learn building a website using React. Then I realized learning React is nothing useful for building website for my NodeMCU webserver project.
I am also thinking same. It would be great if he makes one more video as this one was also great.
👍
Thanks for the video, please I need esp8266webserver library
Hi Akin, if you've added ESP8266 support properly in Arduino IDE. Then "ESP8266WebServer.h" library comes by default. Also make sure board ESP-12E NodeMCU 1.0 is selected properly. This will resolve issue. Good luck and best wishes!
@@BINARYUPDATES thanks
How can I send html form input data to esp8266
You may need to create HTML form and host on your webserver built on ESP8266 NodeMCU. And then client will access through browser. I hope this may help you. Good luck!
@@BINARYUPDATES Thanks Bro
i got the ip but cant go to my webserver?
Make sure your laptop is also connected to the same internet to access webserver running on NodeMCU ESP8266. Good luck and best wishes!
i want to build a webpage with numbers showing with increment and 1 sec display can u tell how
Hi It can be done easily but unfortunately due to lack of time. But I'll consider making video on hosting webpage on ESP8266 webserver in near future. I hope you understand. Thanks!
Could you share your web script?
Hi Pandhu, the arduino code of webserver example is shared in description section. There is an github link. Good luck!
It's local hosted not internet
Hi Abdul, YES webserver usually hosted on microcontroller and serve web pages in local network.
Sehr gut
Very Good explanation,👌🙏 just one thing what is ptr ptr?
Thanks Prakash!