ESP8266 web server

What you will learn here about ESP8266 web server with Arduino IDE

  • ESP8266 web server
  • ESP8266 web server library
  • ESP8266 web server multiple pages

ESP8266 web server library

Please follow the followings steps to install esp8266 web server library

1)First, open your Arduino IDE

2)Now please click on Tools > Manage libraries

3)Now please search ESP8266WiFi.h to install ESP8266WiFi library which is shown below
esp8266 web server library installation

4)Now please search ESP8266WebServer.h to install ESP8266WebServer library which is shown below
esp8266 web server library



ESP8266 web server

Please follow the following steps to use ESP8266 as web server

1)Assuming you have installed ESP8266 web server library and other libraries successfully

2)Now please download the ESP8266 as web server code and unzip the downloaded code

ESP8266WebServer (5 downloads)

3)Please open unzip code with your Arduino IDE

4)Now please modify the ssid and password as per your WiFi details which is shown below
Modify ssid and password

5)Optional part – In the downloaded code following lines does the URL request mapping. In this code whenever the user make request fo / URL then handleRoot function gets executed and sends the response. And whenever user makes request fo /data URL then data function gets executed and sends the response.
esp8266 web server URL mapping

6)Optional part – In the downloaded code following code is the mapping methods which sends the response back
esp8266 web server URL response

7)Now please upload the downloaded code in your ESP8266

8)After Uploadloading of code, you will see the following kind of output on your Serial monitor which is shown below
esp8266 web server IP address

Please make sure that your computer or mobile is in the same network where your ESP8266 is connected to access or see the webpage

9)Now please open any browser and enter the IP address assigned to your ESP8266 in the browser. The IP address assigned to ESP8266 is nothing but the Your server IP address which is shown below
esp8266 web server access in browser

10)Once you click on Submit you will see the following kind of output in Browser
esp8266 web server response



ESP8266 web server multiple pages

Yes, you can add multiple web pages to the ESP8266 web server. In order to add multiple web pages please follow step 5 and step 6 to add new web pages.

You may also like...

Leave a Reply