Controlling Esp12E NodeMCU with LED from website (local network)

Vivek Gupta
Vivek Gupta
Role : Writing free tutorials in free time
  • Website :
  • Experience : 5+ Years
  • Specialist in : IoT, NLP, Machine Learning, Chatbots, Voice Assistants, Hardware Engineering
Read More



Now, we will finally control ESP12E NODEMCU from website. We will make an HTML web app which will control the LED connected to our ESP12E Module. f you are seeing this tutorial, then I would recommend you to start from beginning here "Controlling Esp12E NodeMCU with LED from website (local network)". Else you can begin with the tutorial. So I hope that you have bill of materials ready with you. Lets start:

  1. Open your notepad++ or any code editor and create a new file.
  2. The start by pasting the below code. This is to start creating the html page

  3. Now we will create the body. Where we need one text box which will be used for the user to write the IP address of the ESP12E NODEMCU, 2 buttons for controlling each LED. One for on and other for off. So we will need total six buttons. And finally one more text box which will be used to show the activity by user. Like lights turned on, and off etc.
  4. So Now, I want it to look beautiful. So I will add the css files in script section under head tag. These settings are for alignment and colors etc.

  5. Finally add the script after body tag. This script are the functions that will called when button is pressed.
  6. Now open your webpage, and copy the ip address in the text box "" and try to turn on and off the LED.
  7. Make sure that your ESP12E and the  Laptop from which you are accessing your webpage are connected to the same hotspot or wifi network.

You can watch my quick video tutorial.

Download HTML Code

I hope that you enjoyed my tutorial. Please subscribe to my youtube channel for more awesome tutorials.

Please login to get access to the quiz
Back to Controlling Esp12E NodeMCU with LED from website (local network)

Comments ( 6 )

  • Fares zanaty

    Dear Vivek
    my felicitations….
    very good explanation and very clear.
    gently asking if it is possible to trigger the led from the mobile app
    without waiting the nodemcu to request every whatever the delay time.
    and how?.
    by the way I’m not good in PHP language, is there any alternative to PHP?
    hoping to hear from you asap.
    Best Regards
    Fares Zanaty.

    • Hi Fares, Thanks for you kind words. If you don’t want the delay for nodemcu, I will recommend you to use particle photon. They have fast response time. If you want to continue with nodemcu then you can use Nodejs and mongo db and also you can use mqtt protocol. It is also fast but needs some complex programming.

  • Atul Tiwari

    How i get ip address

    • Check in the Serial terminal.

  • the html code in the page is not working properly .. can you provide a working code

    • Please check your execution again. It works and is working for a lot of people.

Post a Reply