NodeMCU as Server
Create A Simple ESP8266 NodeMCU Web Server
A web server is a place where web pages are stored, processed, and served to web clients. A web client is just a web browser that we use on our computers and phones. A web client and a web server communicate using a special protocol known as Hypertext Transfer Protocol (HTTP).
ESP8266 Operating Modes
One of the most useful features of the ESP8266 is its ability to not only connect to an existing WiFi network and act as a Web Server, but also to create its own network, allowing other devices to connect directly to it and access web pages.
This is possible because the ESP8266 can operate in three modes: Station (STA) mode, Soft Access Point (AP) mode, and both simultaneously.
Station (STA) Mode
In Station (STA) mode, the ESP8266 connects to an existing WiFi network (the one created by your wireless router).
In STA mode, the ESP8266 obtains an IP address from the wireless router to which it is connected. With this IP address, it can set up a web server and serve web pages to all connected devices on the existing WiFi network.
Soft Access Point (AP) Mode
In Access Point (AP) mode, the ESP8266 sets up its own WiFi network and acts as a hub (just like a WiFi router) for one or more stations.
However, unlike a WiFi router, it does not have an interface to a wired network. So, this mode of operation is called Soft Access Point (soft-AP). Also, no more than five stations can connect to it at the same time.
In AP mode, the ESP8266 creates a new WiFi network and assigns it an SSID (the network’s name) and an IP address. With this IP address, it can serve web pages to all connected devices.
Comments
Post a Comment