Page 1 of 1

Webserver unstable in Access Point mode

Posted: Wed Jul 09, 2025 1:23 pm
by vbpieter
I am running a webserver on the ESP32-C3 using `esp_http_server.h`
Everything works perfectly when the ESP32-C3 is configured as a Station, using `example_connect()` from: https://github.com/espressif/esp-idf/bl ... /README.md

However, when switching to Access Point mode, using `softAP` from: https://github.com/espressif/esp-idf/tr ... ted/softAP), the webserver becomes extremely unreliable.

Here are some of the issues I am seeing:
  • Severe packet loss when pinging the ESP:
    --- 192.168.4.1 ping statistics ---
    930 packets transmitted, 367 received, +140 errors, 60.5376% packet loss, time 945227ms
    rtt min/avg/max/mdev = 2.641/863.794/12337.996/1883.675 ms, pipe 13
  • Connecting to the webserver often fails, showing messages like: "Unable to connect" or "The connection has timed out"
  • When the webpage does load, interactions (like pressing a button) sometimes work instantly, but often take up to 20 seconds to respond, if they respond at all
My webserver is started as:

Code: Select all

static httpd_handle_t start_webserver(void) {
    httpd_handle_t server = NULL;
    httpd_config_t config = HTTPD_DEFAULT_CONFIG();
    config.lru_purge_enable = true;

    ESP_LOGI(TAG, "Starting server on port: %d", config.server_port);
    if (httpd_start(&server, &config) == ESP_OK) {
        ESP_LOGI(TAG, "Registering URI handlers");
        httpd_register_uri_handler(server, &home);
        httpd_register_uri_handler(server, &set);
        return server;
    }

    ESP_LOGI(TAG, "Error starting server!");
    return NULL;
}
The antenna is functioning correctly, proven by the excellent performance in Station mode.

Does anyone know what might cause such instability in softAP mode?
Are there known limitations, configuration tweaks or best practices to improve the performance?

Thanks in advance for your help!

Re: Webserver unstable in Access Point mode

Posted: Thu Jul 10, 2025 10:16 pm
by MicroController
Maybe the signal quality is better between the ESP and the router than directly between the ESP and the client, e.g. if the ESP is sitting closer to the router than to the HTTP client device.

Re: Webserver unstable in Access Point mode

Posted: Fri Jul 11, 2025 12:36 pm
by vbpieter
Maybe the signal quality is better between the ESP and the router than directly between the ESP and the client, e.g. if the ESP is sitting closer to the router than to the HTTP client device.
I'm using my phone/pc both as client and router so the signal quality should be the same:
- Access Point mode: connect to it from phone/pc (unreliable)
- Station mode: start hotspot on phone/pc (fast)

I have tested 4 different ESP32 devices, and all have the same unreliable Access Point problem:
1) ESP32-C3 Super Mini
2) ESP32-C3 Super Mini TENSTAR ROBOT
3) ESP32-WROOM-32D
4) ESP32-C3-MINI-1

Re: Webserver unstable in Access Point mode

Posted: Fri Aug 01, 2025 3:50 pm
by DrMickeyLauer
I can't help, but have to join in here, since I'm plagued by intermittent disassociation / reassociation problems myself when the ESP32S3 is in AP mode. Alas, I haven't been able to see any patterns (with regards to client device hardware, OSes, etc.) yet.