WiFi (ESP32 Core)
by Espressif
This is the core Wi-Fi library bundled with the ESP32 Arduino core, exposing station mode, access-point mode, and the `WiFiClient`/`WiFiServer` classes that virtually every ESP32 networking library (HTTP, MQTT, OTA) is built on top of. It comes preinstalled the moment you select an ESP32 board in the Arduino IDE — no separate library install needed. The catch that trips people up is the ADC2 conflict: several ESP32 ADC2 pins become unusable for analog reads while Wi-Fi is active, since the radio driver and ADC2 share internal hardware. If you need analog sensor readings alongside Wi-Fi, use ADC1 pins (GPIO32-39) instead.
Installation
Arduino IDE — Library Manager
Sketch → Include Library → Manage Libraries → search Bundled with ESP32 board package (Boards Manager)
PlatformIO
lib_deps = platform = espressif32Supported boards
Examples
Connect to a Wi-Fi network
Baseline connection pattern behind every ESP32 networked project on this site.
#include <WiFi.h>
void setup() {
Serial.begin(115200);
WiFi.begin("ssid", "password");
while (WiFi.status() != WL_CONNECTED) delay(500);
Serial.println(WiFi.localIP());
}
void loop() {}