Contents
Why is my ESP8266 running in AP mode?
I have an ESP8266 running in AP mode using softAP and i want to conserve battery life. I am wanting to turn on wifi and advertise SSID for 20 seconds. If no station connects to the ssid within the 20 seconds, I want to go to sleep for 1 minute, otherwise I do not sleep.
Is the ESP device in AP or STA mode?
In the previous tutorial we covered how to connect our ESP device to WiFi in station (STA) mode. In this mode the ESP connects to the router as a client. For this tutorial we will take the code from the previous tutorial and add the necessary code so that the ESP device functions in both STA and AP mode.
When to install the ESP8266 Core in Arduino?
When you install the ESP8266 core in Arduino, you get a lots of examples. They should be studied. But there are so many working examples on the Internet and even here in the forum. I recommend you do a little homework – examples are not hard to find. ESP8266 STA mode continuously tried to connected to SSID if it has wrong SSID.
How to make your ESP device appear as an access point?
Now we can start to add the additional code to make our ESP device also appear as an access point. First we will define an SSID and password for our access point. Go ahead and add the highlighted code to the project, you can change the SSID and password to whatever you like.
Where can I find the ESP8266 access point network?
Having the ESP8266 running the sketch, in your smartphone open your Wi-Fi settings and tap the ESP8266-Access-Point network: Enter the password you’ve defined earlier. Open your web browser and type the IP address http://192.168.4.1. The web server page should load:
How to disconnect a station in ESP8266?
We can also disconnect any connected stations using the following. It is also possible to fetch the MAC address from memory. This is done by creating a 6 element uint8_t and using the function to save the value of the MAC address into this variable.