Categories
ESP8266 (ESP-01/01S) Internet Of Things Microcontrollers

WiFi Access Point

Requirements

ESP8266 ESP-01/ESP-01S

Arduino Sketch / Code

#include <ESP8266WiFi.h>

void setup()
{
  Serial.begin(115200);
  Serial.println();

  Serial.print("Setting soft-AP ... ");
  boolean result = WiFi.softAP("ESPsoftAP_01", "pass-to-soft-AP");
  if(result == true)
  {
    Serial.println("Ready");
  }
  else
  {
    Serial.println("Failed!");
  }
}

void loop()
{
  Serial.printf("Stations connected = %d\n", WiFi.softAPgetStationNum());
  delay(3000);
}

Access Point SSID name and password

boolean result = WiFi.softAP("ESPsoftAP_01", "pass-to-soft-AP");

edit the above bold word with your own SSID name and password. Save and recompile your code again.