Run the ESP32 as a Wi-Fi access point, then run ESP-IDF’s esp_http_server on the same device. A phone, laptop, or other station joins the ESP32-created network and sends HTTP requests to the ESP32’s local address. SoftAP provides a local network; it does not provide internet access through the ESP32 unless you separately implement an upstream connection and routing.
What ESP-IDF AP mode actually does
ESP-IDF separates two jobs that are often confused in beginner examples:
As an Amazon Associate I earn from qualifying purchases.
- Wi-Fi mode and networking: the Wi-Fi API creates or joins a network, starts the radio, and manages interfaces.
- HTTP serving: the
esp_http_servercomponent listens for HTTP requests and sends them to URI handlers in your application.
In SoftAP mode, the ESP32 is the access point. Client devices—called stations in the Wi-Fi API—associate with it. Your web server then handles requests arriving over that connection. This is how to host a page on an ESP32 without a separate router.
The HTTP server is independent of whether Wi-Fi is configured as station, SoftAP, or both. Start Wi-Fi first, make sure the network interface exists, and then start the HTTP server and register its routes.
#1 Best Overall
- 2.4GHz Dual Mode WiFi + Bluetooth Development Board
- Support LWIP protocol, Freertos
- SupportThree Modes: AP, STA, and AP+STA
- Ultra-Low power consumption, Compatible with Arduino IDE
- ESP32 is a safe, reliable, and scalable to a variety of applications
Choose the Wi-Fi mode before writing the server
| Mode | Who connects to whom? | Use it when | Internet implication |
|---|---|---|---|
WIFI_MODE_STA |
The ESP32 joins an existing access point. | The device is a client on a household, office, or industrial network. | It can reach services available through that network, subject to network policy. |
WIFI_MODE_AP |
Phones, computers, or other stations join the ESP32. | You need a self-contained local control page, setup portal, sensor dashboard, or direct device link. | SoftAP alone is local and does not route clients to the public internet. |
WIFI_MODE_APSTA |
The ESP32 accepts SoftAP clients while also joining another access point as a station. | Local clients must reach the ESP32 while the ESP32 also needs an upstream network connection. | Having both interfaces does not automatically turn the ESP32 into a router. Application routing, addressing, and policy are still required. |
The default Wi-Fi mode is station mode, so an application that is meant to create a hotspot must explicitly select WIFI_MODE_AP (or WIFI_MODE_APSTA for a dual-role design) with esp_wifi_set_mode.
Prerequisites and project setup
Hardware
You need an ESP32-compatible board, a USB cable suitable for that board, and a computer with the matching ESP-IDF toolchain. ESP32-DevKitC is a documented example development board, but it is not mandatory; another compatible ESP32 board can run the same architecture. Check the exact module and board variant, USB connector, and target selection before building.
Software and version alignment
Use API documentation that matches the ESP-IDF release pinned by your project. Espressif’s Wi-Fi and HTTP Server pages are maintained as “latest” documentation, while the referenced SoftAP example identifies ESP-IDF v5.5.0. Function names and structures shown below are the established API shape, but you should compare configuration fields with the Programming Guide for your installed release.
Free tools Windows power users keep installed
One-click scans. No signup required.
Build and flash cycle
From the project directory, the normal ESP-IDF workflow is:
- Set the project target for the ESP32 family used by your board.
- Configure application options with
idf.py menuconfigwhen your project exposes settings there. - Compile with
idf.py build. - Flash the board with
idf.py -p PORT flash, replacingPORTwith the serial device for your computer. - Open logs with
idf.py -p PORT monitor. The log is the best place to print the configured SSID, server port, assigned address, and connection events.
Do not hard-code a universal browser address in documentation for your application. The SoftAP address and HTTP port come from your network-interface and server configuration.
Rank #2
- Dual-Core Performance Up to 240 MHz: Run sensor processing, wireless communication, automation logic and connected-device tasks on a 32-bit dual-core ESP32 platform designed for responsive embedded and IoT projects
- Built-in Wi-Fi and Bluetooth 4.2: Connect to 2.4 GHz Wi-Fi networks or use Bluetooth Classic and BLE for wireless sensors, smart devices, remote controls, home automation and other connected projects
- Flexible Power-Saving Modes: ESP32 power-management features support dynamic clock scaling and low-power operating modes, helping developers reduce energy use in compatible sensing, monitoring and connected-device applications, suitable for battery-powered Internet of Things (IoT) devices.
- USB-C Programming with CP2102: Connect through USB-C for power, sketch uploads and serial monitoring, while GPIO, UART, SPI and I2C interfaces support sensors, displays, motor drivers and other modules (USB-C cable not included)
- Over-the-Air Update Support: Configure OTA functionality through a compatible ESP-32 software framework to update deployed firmware over Wi-Fi without reconnecting the board by USB for every revision
Initialize the SoftAP network
The exact initialization sequence follows the ESP-IDF examples for your release. Conceptually, it is:
- Initialize the network interface layer and the default event loop.
- Create the default Wi-Fi SoftAP interface.
- Initialize the Wi-Fi driver.
- Select
WIFI_MODE_AP. - Fill the SoftAP configuration with your SSID, authentication settings, password, channel, and client limit.
- Apply that configuration and call
esp_wifi_start.
esp_wifi_set_mode chooses the operating mode; esp_wifi_start starts Wi-Fi according to that mode. Starting the HTTP server before the network interface is ready can make startup ordering and address discovery confusing, so keep the responsibilities separate and log both stages.
Recommended Free Tools
Illustrative initialization skeleton
This is a structural example rather than a board-specific, tested application. Adapt event handling, error checks, and configuration fields to the ESP-IDF version in your project:
esp_netif_init();
esp_event_loop_create_default();
esp_netif_create_default_wifi_ap();
wifi_init_config_t wifi_cfg = WIFI_INIT_CONFIG_DEFAULT();
esp_wifi_init(&wifi_cfg);
esp_wifi_set_mode(WIFI_MODE_AP);
wifi_config_t ap_cfg = {
.ap = {
.ssid = "my-esp32",
.ssid_len = 0,
.channel = 1,
.password = "change-this-password",
.max_connection = 4,
.authmode = WIFI_AUTH_WPA2_PSK
}
};
esp_wifi_set_config(WIFI_IF_AP, &ap_cfg);
esp_wifi_start();
Use a password and authentication mode appropriate to your deployment. A configured Wi-Fi password controls association; it does not, by itself, provide application-level authorization for every URL.
Start the HTTP server and register routes
Server lifecycle
The HTTP Server component allocates its resources when you call httpd_start and returns a server handle. Register URI handlers against that handle. Each handler receives a request and must produce an HTTP response. When the application shuts down or deliberately reconfigures networking, call httpd_stop.
Rank #3
- Powerful ESP-32 Board: Unlock the world of Internet of Things (IoT) and advanced electronics with the heart of this kit: the ESP-32 board. It features a powerful dual-core processor, integrated Wi-Fi and Bluetooth 4.2, making it perfect for building connected, smart devices that communicate with your phone or the cloud. It's fully compatible with the Arduino IDE for easy programming.
- Super Starter Kit: This kit contains over 35 different modules and electronic components, including sensors, displays, motors, and input devices. From LEDs and buttons to an OLED screen, servo motor, and keypad, you have everything needed to explore a vast range of projects in one box.
- Step by Step Online Tutorial: Jump right in with our detailed, beginner-friendly tutorial. Access 30+ projects with complete code, clear circuit diagrams, and step-by-step instructions. Learn the fundamentals of electronics, coding, and how to utilize the ESP-32's unique capabilities without any prior experience.
- Hands-on Learning for All Skill Levels: Perfect for students, makers, engineers, and hobbyists. Start with basic circuits and coding, then progress to intermediate and advanced IoT applications. Build practical projects like weather stations, smart home controllers, remote-controlled devices, and interactive gadgets. The skills you learn are the foundation for real-world innovation.
- Quality & Great Support: Elegoo is committed to quality. We provide a clear, detailed tutorial guide, refined code, and a well-organized component kit. All modules are carefully selected for reliability and ease of use. Our dedicated technical support team and active online community are ready to help you succeed in your learning journey.
httpd_handle_t server = NULL;
httpd_config_t server_cfg = HTTPD_DEFAULT_CONFIG();
httpd_start(&server, &server_cfg);
httpd_uri_t root = {
.uri = "/",
.method = HTTP_GET,
.handler = root_get_handler,
.user_ctx = NULL
};
httpd_register_uri_handler(server, &root);
A minimal handler can set a content type and send an HTML response:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
static esp_err_t root_get_handler(httpd_req_t *req)
{
const char *html =
"<!doctype html>"
"<html><body><h1>ESP32 is online</h1></body></html>";
httpd_resp_set_type(req, "text/html");
return httpd_resp_send(req, html, HTTPD_RESP_USE_STRLEN);
}
Register additional handlers for device status, configuration forms, static assets, or API endpoints. Keep route names and methods explicit; for example, use HTTP_GET for reading status and HTTP_POST for a state-changing form.
Understand which interface receives requests
The current HTTP Server documentation says the default listener binds to all available interfaces (INADDR_ANY). In a SoftAP-only application that commonly means requests arriving through the AP interface are accepted, but “all interfaces” is broader than “SoftAP only” once your firmware also has other interfaces.
If the design must restrict the server to one interface, set httpd_config_t.if_name before calling httpd_start, using the interface identifier documented for your ESP-IDF release. Treat this as an intentional exposure decision, especially in WIFI_MODE_APSTA. Verify the result from logs and a client request rather than assuming the binding.
The HTTP Server APIs are not thread-safe. If multiple application tasks start, stop, reconfigure, or otherwise use the server APIs concurrently, protect those operations with your own synchronization. Handlers should also avoid unsynchronized access to shared sensor values, configuration structures, and device state.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Rank #4
- 2.4GHz Dual Mode WiFi + Bluetooth Development Board
- Support LWIP protocol, Freertos;ESP32 is a safe, reliable, and scalable to a variety of applications
- SupportThree Modes: AP, STA, and AP+STA
- Ultra-Low power consumption, Compatible with Arduino IDE
- 1PCS 30Pin ESP32 Development Board 2.4GHz WiFi Dual Cores Microcontroller Integrated with Antenna RF Low Noise Amplifiers Filters
Connect a phone or computer to the ESP32
- Power the board and watch the serial monitor until Wi-Fi and the HTTP server report that they have started.
- On the client, open the Wi-Fi list and select the SSID configured in
wifi_config_t. - Enter the configured password if the AP is protected.
- Find the local address assigned to the ESP32 SoftAP interface. Print it from your application or inspect the network-interface information; do not assume every project uses the same address.
- Enter that address and the configured HTTP port in the browser, or use an HTTP client from the connected device.
The browser and ESP32 must be on the same SoftAP network. A client that remains on a cellular network, a different Wi-Fi network, or a VPN path will not reach a server that is local to the ESP32.
What SoftAP does not provide
An ESP32 SoftAP is a local hotspot. It allows associated stations to communicate with the ESP32 and, depending on your application, with one another according to the network configuration. It does not automatically provide a path to the internet, DNS forwarding, NAT, or access to a household router.
For internet-connected behavior, the ESP32 must also join an upstream network as a station and the application must implement the required routing and policy. That is a different design from simply serving a local page. AP+STA mode gives you both Wi-Fi roles, but it does not remove the engineering work of deciding which traffic may cross between them.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Use cases that fit AP-mode web serving
Device setup portal
A new device can create a temporary SoftAP so a phone can enter credentials or local settings. ESP-IDF’s provisioning documentation describes a SoftAP transport paired with an HTTP server and optional mDNS. In this pattern, keep the portal small, validate every submitted value, and define how the device leaves provisioning mode.
Local control panel
A relay controller, display, sensor, or robot can expose a page without depending on an installed router. The page and API remain reachable while the client is associated with the ESP32 network.
Best Value
- 2.4GHz Dual Mode WiFi + Bluetooth Development Board
- Ultra-Low power consumption, works perfectly with the Arduino IDE
- Support LWIP protocol, Freertos
- SupportThree Modes: AP, STA, and AP+STA
- ESP32 is a safe, reliable, and scalable to a variety of applications
Maintenance and diagnostics
A service technician can connect directly to read logs or change non-sensitive settings. Restrict these routes and provide an explicit maintenance procedure rather than leaving administrative endpoints permanently exposed.
Security and reliability checks
- Use a non-default SSID and a strong password for deployments where unauthorized association matters.
- Require application authentication for settings, firmware actions, or other sensitive operations; Wi-Fi association is not equivalent to user authorization.
- Validate lengths, formats, and ranges for every query parameter, form field, and request body.
- Do not expose debugging or factory-reset handlers in production unless they are deliberately protected.
- Return clear HTTP status codes and bounded responses so malformed requests cannot consume unbounded memory.
- Decide whether the server should listen on every interface or only the AP interface before enabling AP+STA.
- Log association, disassociation, server start, handler errors, and the selected address without logging passwords.
The official material does not establish a complete security recipe for a particular application. Security depends on your authentication, authorization, input validation, update process, and physical deployment.
Troubleshooting by symptom
The SSID is not visible
- Confirm that
esp_wifi_set_mode(WIFI_MODE_AP)succeeded and thatesp_wifi_startwas called after applying the AP configuration. - Check serial logs for initialization errors and verify the selected ESP32 target.
- Confirm that the board is powered reliably and that the configured channel and authentication settings are supported by the client.
The client joins, but the page does not load
- Verify the client received an address on the ESP32 network.
- Use the actual SoftAP interface address printed by the application rather than a copied address from another example.
- Check that
httpd_startreturned success, the URI handler was registered, and the browser is using the configured port. - Review whether
if_namewas set to an interface that the client is not using.
The root page works, but another route returns an error
- Match the browser method to the registered method; a
GEThandler does not answer aPOSTrequest. - Check the URI string for an exact path match, including leading slashes.
- Inspect handler return values and response headers, and ensure shared state is protected when several requests can arrive close together.
The ESP32 has internet access, but the AP client does not
This is expected from AP+STA alone. Confirm that you have intentionally implemented forwarding, address translation, DNS behavior, and security rules; otherwise treat the SoftAP as a local-only network.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Deployment checklist
- Project is built with the ESP-IDF release used by its API documentation.
- Network interface and event-loop initialization complete before Wi-Fi startup.
- Mode is explicitly set to
WIFI_MODE_APor, when justified,WIFI_MODE_APSTA. - SSID, authentication, password, channel, and client limit are configured deliberately.
- HTTP server starts successfully and every required URI is registered.
- Interface binding is reviewed, especially when more than one network interface exists.
- Client instructions use the address and port emitted by the running firmware.
- Handlers validate input and coordinate access to shared state.
- Internet access is not promised unless routing has been designed and implemented.
- Shutdown and reconfiguration paths call
httpd_stopand handle Wi-Fi state changes cleanly.
Bottom line
To run an ESP-IDF web server in ESP32 access-point mode, configure and start the SoftAP with the Wi-Fi API, start esp_http_server, register URI handlers, and have a client browse to the ESP32’s local address. Keep Wi-Fi mode, HTTP lifecycle, interface binding, and application security as separate design decisions. SoftAP is an effective router-free local link, but it is not an internet gateway unless you build the additional AP+STA routing system required for that outcome.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

