Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To host a web page without a router, configure the ESP32 as a Wi-Fi SoftAP, start the Wi-Fi driver, start ESP-IDF’s esp_http_server component, and register URI handlers. A phone or computer then joins the ESP32-created network and sends HTTP requests to the server over that local link.

SoftAP is a local network by default. It does not give connected clients internet access through the ESP32 unless your application separately provides an upstream connection and routing.

What SoftAP mode changes

ESP-IDF separates Wi-Fi’s network role from HTTP serving. In station (STA) mode, the ESP32 joins an existing access point. In SoftAP mode, the ESP32 creates an access point and other stations join it. AP+STA mode enables both roles at once.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ESP-IDF mode Who initiates the Wi-Fi connection? Does the ESP32 join another access point? Typical web-server use
STA The ESP32 joins an existing access point Yes Serve a page on a network that already exists
SoftAP Phones, computers, or other stations join the ESP32 No Local setup page, device control panel, or standalone demonstration
AP+STA Clients join the ESP32 while the ESP32 also joins an access point Yes Local control plus an upstream network connection

The HTTP server is a separate component. Wi-Fi establishes interfaces and connectivity; httpd_start allocates and starts the server, and httpd_register_uri_handler associates request paths with handler functions. Keeping those responsibilities separate makes it easier to diagnose whether a failure is in radio setup or HTTP routing.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

What you need before writing the code

  • An ESP32-compatible development board. ESP32-DevKitC is one documented option, but another compatible ESP32 board can be used.
  • A USB cable and computer suitable for your board’s connector and ESP-IDF setup.
  • A project using a known ESP-IDF release. The Wi-Fi and HTTP references use the current “latest” documentation, while the referenced SoftAP example identifies ESP-IDF v5.5.0. Check your project’s pinned version before copying declarations or configuration fields.
  • A client device with Wi-Fi, such as a phone or laptop, for joining the ESP32 network and opening the page.

Board variants can expose different USB connectors, flash sizes, and pin assignments. Confirm the module and board documentation rather than assuming every development board has the same connector or peripheral layout.

The complete implementation sequence

The order matters: create the network infrastructure, select and start SoftAP, then start the HTTP server and register routes.

1. Initialize the ESP-IDF networking infrastructure

Initialize the nonvolatile-storage, network-interface, event-loop, and Wi-Fi-driver infrastructure required by the ESP-IDF release and the project’s example. The exact initialization details can change between releases, so use the matching Programming Guide and project template for those calls.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not start the HTTP server first and expect it to create Wi-Fi. The server needs an active network interface on which a client can reach it.

2. Select SoftAP as the Wi-Fi mode

ESP-IDF’s default Wi-Fi mode is station mode. Explicitly select SoftAP with esp_wifi_set_mode(WIFI_MODE_AP) before starting the driver. This tells the driver that the ESP32 will accept stations rather than join an existing access point.

3. Configure the access point

Populate the SoftAP portion of the Wi-Fi configuration with the network settings your application requires. At minimum, decide the SSID and authentication/password policy. Also choose the radio and connection settings supported by your target and ESP-IDF release.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Configuration is an application decision, not an automatic security guarantee. A password protects association at the Wi-Fi layer; it does not authenticate every HTTP operation or validate data submitted to your handlers.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Start the configured Wi-Fi mode

Call esp_wifi_start() after setting the mode and configuration. ESP-IDF documents this function as starting Wi-Fi according to the configured mode. In SoftAP mode, the ESP32 begins advertising the configured network for client stations.

5. Start the HTTP server

Create an httpd_config_t, normally beginning with the release’s HTTPD_DEFAULT_CONFIG() macro, and pass it to httpd_start. The function returns a server handle that you must retain for registering routes and later stopping the server.

A minimal sequence has this shape:

httpd_handle_t server = NULL;
httpd_config_t config = HTTPD_DEFAULT_CONFIG();

/* Adjust config for this project, then start the server. */
if (httpd_start(&server, &config) == ESP_OK) {
    /* Register URI handlers against server. */
}

This is an implementation outline rather than a tested, drop-in project. Include the error handling, event integration, and component dependencies required by your ESP-IDF release.

6. Register URI handlers

Define an httpd_uri_t for each route and register it with httpd_register_uri_handler(server, &uri). A handler receives the request, performs any application work, and sends the response through the HTTP-server API.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a first page, register a GET route such as /. Add separate handlers for settings, status, or device actions instead of putting unrelated behavior into one large callback. Return an appropriate HTTP status and content type, and handle malformed or missing input explicitly.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

7. Join the network and open the configured address

On the phone or computer, select the SSID configured for the ESP32 and complete the authentication step, if enabled. Then open the ESP32’s local server address and configured port in a browser or HTTP client.

There is no universal address or port that should be hard-coded into an article. Use the address assigned or configured by your project and the port in its httpd_config_t. If the application logs network-interface information, use that output to identify the address to enter.

HTTP-server interface binding: the detail that can surprise you

The current HTTP-server API documentation says the default listener binds to all available interfaces (INADDR_ANY). In a project that has more than one interface, this can make the same server reachable through interfaces you did not intend to expose.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If the design requires a specific interface, set httpd_config_t.if_name before calling httpd_start, using the interface name and field type documented for your ESP-IDF release. Treat this as an explicit exposure decision:

  • Leave the default when the server should accept requests on every active interface and that exposure is intentional.
  • Bind to the SoftAP interface when the page is meant to be reachable only by clients connected directly to the ESP32.
  • Review the setting again if you later add AP+STA mode, because a second interface changes the set of paths through which the server may be reached.

SoftAP is not an internet gateway

A client can communicate with the ESP32 over the device-created network without a household router. That local connection is enough for a configuration portal, sensor dashboard, or control page.

SoftAP alone does not forward traffic to the internet. To provide internet access, an application would also need an upstream station connection plus the appropriate routing, address translation, forwarding, and policy configuration. None of those behaviors is supplied merely by selecting WIFI_MODE_AP and starting the HTTP server.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

If your requirement is only “show a page while disconnected from a router,” use SoftAP. If the ESP32 must both accept local clients and reach cloud services through another access point, evaluate AP+STA and design the two-interface behavior deliberately.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When AP+STA is the better mode

AP+STA combines the two documented Wi-Fi roles: the ESP32 joins an existing access point as a station while continuing to accept local stations through its SoftAP. This is useful for products that need a nearby setup page but also need an upstream network after configuration.

It introduces additional decisions:

  • Which interface should the HTTP server listen on?
  • Which address should the user enter when both interfaces are active?
  • Will the local page remain available if the upstream access point disappears?
  • Does the application need to route or proxy traffic between the interfaces, or merely serve the same page on both?

Do not switch to AP+STA simply to obtain internet access. Configure and test the upstream connection and the server’s interface exposure as separate features.

A compact project outline

The following outline shows the relationships among the APIs without claiming a universal build configuration:

/* Network infrastructure and Wi-Fi-driver initialization for your IDF release. */

wifi_init_config_t wifi_cfg = WIFI_INIT_CONFIG_DEFAULT();
/* Initialize the driver with wifi_cfg and the project’s event handling. */

wifi_config_t ap_cfg = {
    .ap = {
        /* Set SSID, authentication, password, and other AP fields. */
    }
};

ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_AP));
ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_AP, &ap_cfg));
ESP_ERROR_CHECK(esp_wifi_start());

httpd_handle_t server = NULL;
httpd_config_t http_cfg = HTTPD_DEFAULT_CONFIG();
/* Optionally set http_cfg.if_name when interface binding is required. */
ESP_ERROR_CHECK(httpd_start(&server, &http_cfg));
ESP_ERROR_CHECK(httpd_register_uri_handler(server, &root_uri));

Use the exact structure fields, initialization calls, and error-handling conventions supplied by your ESP-IDF release. The important dependency is that the SoftAP interface is configured and started before clients can reach the HTTP listener.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Using SoftAP for a provisioning portal

ESP-IDF’s provisioning documentation describes a SoftAP transport that uses an HTTP server, with optional mDNS. This is a practical model for a first-run setup portal: a user joins the device network, opens the local page, supplies configuration, and the firmware stores or applies the result.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Provisioning transport does not remove the need to validate input or protect sensitive operations. Treat credentials, firmware settings, and reset actions as privileged data and commands even when the portal is reachable only over a local Wi-Fi network.

Security and reliability decisions

Protect the Wi-Fi association

Choose an appropriate authentication and password policy for the product’s environment. Avoid treating an open network as private merely because its SSID is not advertised or its range is limited.

Protect the HTTP application

  • Validate lengths, encodings, ranges, and allowed values in every request.
  • Require application-level authentication or authorization for actions that change settings, actuate hardware, erase data, or expose secrets.
  • Do not echo untrusted input into HTML without suitable output encoding.
  • Return errors that help the legitimate user without disclosing internal state unnecessarily.

The reviewed ESP-IDF references define the Wi-Fi and HTTP APIs; they do not constitute a complete security recipe for a particular application.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Respect HTTP-server ownership and concurrency

The HTTP API documentation states that its APIs are not thread-safe. If multiple tasks call HTTP-server APIs concurrently, add application-level synchronization. Keep shared device state protected as well, because a handler can overlap with sensor, control, or configuration tasks.

Stop the server cleanly

When the application is shutting down or reconfiguring networking, call httpd_stop(server) and then release or reinitialize related resources according to the project’s lifecycle. Do not leave handlers using a server handle after it has been stopped.

Troubleshooting by symptom

The SSID never appears

  • Confirm that esp_wifi_set_mode selected WIFI_MODE_AP, not the default station mode.
  • Check that the SoftAP configuration was applied before esp_wifi_start.
  • Inspect initialization and driver errors before investigating HTTP routes; the web server cannot be reached until Wi-Fi is running.

The client joins, but the page does not load

  • Verify that httpd_start returned success and that the server handle is valid.
  • Confirm that the requested path and method match a registered URI handler.
  • Use the local address and port produced by the project configuration rather than assuming an address from another example.
  • If more than one interface is active, inspect if_name and determine whether the listener is bound to the interface through which the client is connecting.

The page works on one interface but not another

Review the all-interface default and any explicit binding. In AP+STA mode, a server bound to one interface is not automatically reachable through the other. Decide which interface is intended, then align the listener, address shown to users, and firewall or routing policy.

The device has a local page but no internet access

That is the expected result of SoftAP by itself. Add and configure the upstream station role and the required forwarding design only if internet connectivity is a product requirement.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Practical checklist

  1. Confirm the board, cable, target chip, and pinned ESP-IDF release.
  2. Initialize the release-appropriate network interface, event loop, and Wi-Fi driver infrastructure.
  3. Select WIFI_MODE_AP with esp_wifi_set_mode.
  4. Apply the SSID, authentication, password, and other SoftAP settings.
  5. Start Wi-Fi with esp_wifi_start.
  6. Create an HTTP configuration and decide whether all-interface listening is acceptable.
  7. Start the server with httpd_start.
  8. Register each route with httpd_register_uri_handler.
  9. Join the ESP32 network from a client and use the project’s actual local address and port.
  10. Test malformed input, unauthorized actions, interface changes, and clean shutdown before treating the portal as production-ready.

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.