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
4)Now please search ESP8266WebServer.h to install ESP8266WebServer library which is shown below
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 (708 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
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.
6)Optional part – In the downloaded code following code is the mapping methods which sends the response back
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
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
10)Once you click on Submit you will see the following kind of output in Browser
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.