197 Commits

Author SHA1 Message Date
Mahavir Jain 9da6905c59 Merge branch 'fix/http_server_async_handler_connection_retry' into 'master'
fix(http_server/async_handler): Fix http_server async handler tests

Closes IDFCI-3464, IDFCI-6440, IDFCI-6250, and IDFCI-3908

See merge request espressif/esp-idf!47365
2026-04-16 19:31:42 +05:30
hrushikesh.bhosale a665e7410c fix(http_server/async_handler): Fix http_server async handler tests
The async handler CI tests fail intermittently because the TCP
connection from the pytest host to the ESP32 HTTP server times out
or gets refused.

Add a _connect_with_retry() helper that retries the TCP connection
up to 3 times with a 2-second delay between attempts, catching
TimeoutError, ConnectionRefusedError, and OSError.

Extract common server startup waiting into _wait_for_server_ready()
which includes a 2-second stabilization delay after the server
registers its URI handlers before tests begin sending requests.
2026-04-09 11:57:40 +05:30
hrushikesh.bhosale 7a50e3ab04 fix(http_server/ws_echo_server): Fix ws_echo_server test URI registration race condition
The WebSocket echo server tests connect immediately after seeing
"Starting server on port:" in the device log, but URI handlers
(/ws, /ws_partial, /auth) are registered asynchronously after the
server starts, taking 40-660ms depending on config and CI load.

This causes two failures:
1. WebSocket handshake returns 404 Not Found because the URI
   handler is not registered yet when the client connects.
2. WebSocket echo returns wrong data because the server is in a
   partially initialized state.

Wait for "Returned from app_main()" before connecting, which
guarantees all URI handlers are registered. Add connection retry
with WebSocketBadStatusException handling to WsClient and to the
partial frame test's raw websocket connection.

Extract _wait_for_server_ready() helper to deduplicate the WiFi
credential input and server readiness logic across all 3 tests.
2026-04-09 11:56:03 +05:30
Ashish Sharma 4971424986 feat(http_server): adds example to test server pong response 2026-03-13 17:42:10 +08:00
Ashish Sharma 56d2fd6757 fix(esp_http_server): remove http server unused psa migration 2026-03-02 14:48:41 +08:00
Ashish Sharma 5028b6230f feat(http_server): improve websocket server handling
1. Adds post handshake callback
2. Removes requirement to handle HTTP_GET message in websocket handler

Closes https://github.com/espressif/esp-idf/issues/18215
2026-02-27 09:59:05 +08:00
Mahavir Jain 2f68594185 Merge branch 'contrib/github_pr_15622' into 'master'
Add support for partial websocket frame payload reads (GitHub PR)

Closes IDFGH-14913

See merge request espressif/esp-idf!44044
2026-01-30 18:22:06 +05:30
nilesh.kale 93fcdda9f4 feat: add demo to receive websocket frame in chunks
This commit added demo to receive websocket single frame in chunks
using newly added API httpd_ws_recv_frame_part() with optimized memory.

closes https://github.com/espressif/esp-idf/pull/15622
2026-01-07 15:25:19 +05:30
hrushikesh.bhosale 7b7ddeba58 fix(file_server): File servering example pytest failure
There is timeout failure, due to network issue.
2026-01-06 19:37:28 +08:00
Ashish Sharma cc0d469048 feat: migrates protocol examples to PSA APIs 2025-12-30 09:31:49 +05:30
Ashish Sharma 69ea28c886 feat: add Kconfig option for mbedTLS 4.x 2025-12-01 14:05:05 +08:00
Mahavir Jain 79099ee40d Merge branch 'feat/added_force_close_test_for_async_handler' into 'master'
feat(http_server/async_handler): Added test for async handler

Closes IDF-12971

See merge request espressif/esp-idf!43080
2025-11-05 10:27:08 +05:30
Mahavir Jain 4558769ebd Merge branch 'contrib/github_pr_17752' into 'master'
fix: indexing in DNS server IP address retrieval #17751 (GitHub PR)

Closes IDFGH-16654

See merge request espressif/esp-idf!43089
2025-11-05 10:22:38 +05:30
Mahavir Jain d06c3d9589 fix(ci): address pre-commit hook failure - spellcheck 2025-11-04 15:11:01 +05:30
hrushikesh.bhosale 940b8df3cc feat(http_server/async_handler): Added test for async handler
Added test for Async Handler example, hits the /long request
and client closes it forcefully before completion
2025-11-04 12:45:18 +05:30
hrushikesh.bhosale 29d1bfb950 fix(http_server): Fixed response status code for temporary redirect
Closes https://github.com/espressif/esp-idf/issues/17791
2025-11-03 19:54:39 +05:30
Mahavir Jain 06805d177c Merge branch 'feature/mbedtls_psa_migration_migrate_esp_http' into 'master'
Migrate esp_http_client and esp_http_server to PSA API

See merge request espressif/esp-idf!41035
2025-11-03 09:39:54 +05:30
Fu Hanxi 1e79c69fc4 tests: change wifi tests expect timeout to 60
- wifi_router
- wifi_ap
- wifi_high_traffic
2025-11-03 09:19:02 +08:00
Ashish Sharma acf89924c8 feat(esp_http): migrate esp_http to PSA API 2025-10-26 10:13:14 +08:00
dependabot[bot] f3aa1e81a9 build(deps-dev): bump vite version
Merges https://github.com/espressif/esp-idf/pull/17754
2025-10-21 16:38:27 +08:00
jojo2massol b801fa0f70 fix(examples/captive_portal): Fixed indexing in DNS server IP address retrieval 2025-10-20 17:16:24 +02:00
Mahavir Jain 269acda53c Merge branch 'cleanup/use_cjson_from_registry' into 'master'
cleanup: move cJSON to component manager

See merge request espressif/esp-idf!42379
2025-10-13 11:54:10 +05:30
Mahavir Jain 56098593d9 Merge branch 'fix/http_async_handler_ci_test_failure' into 'master'
fix(http_server): Fix CI test failure async_handler

Closes IDFCI-3119

See merge request espressif/esp-idf!42037
2025-10-09 12:26:05 +05:30
Mahavir Jain 439b1d6d08 cleanup: move cJSON to component manager 2025-10-06 14:08:06 +05:30
Kapil Gupta 0f63b92501 fix(esp_wifi): remove esp_interface.h and update usages 2025-09-26 21:42:30 +05:30
hrushikesh.bhosale 896c8ecc80 fix(http_server): Fix CI test failure async_handler
pytest trying to hit the server, before registration
of URI handlers or starting of server
2025-09-19 13:07:45 +05:30
hrushikesh.bhosale dee9d760cd feat(esp_http_server/async_handler): Add CI test for request on same socket
Added a CI test to request on same socket one after the another
2025-09-16 15:02:28 +05:30
Marek Fiala 9d35d63651 feat(cmake): Update minimum cmake version to 3.22 (whole repository) 2025-08-19 14:44:32 +02:00
hrushikesh.bhosale a40ceffb19 feat(esp_http_server): Added pre handshake callback for websocket
1. If the user wants authenticate the request, then user needs to do
this before upgrading the protocol to websocket.
2. To achieve this, added pre_handshake_callack, which will execute
before handshake, i.e. before switching protocol.
2025-07-31 11:06:18 +05:30
morris 70d62b1a54 feat(restful_server): upgrade the example to use vue3+vuetify3
also cleaned up the backend firmware to use littlefs filesystem.
2025-07-21 12:03:10 +08:00
yinqingzhao c1c78f5838 feat(wifi): add esp32c61 eco3 wifi support 2025-06-27 14:04:55 +08:00
wanckl 6fde8cf8d2 ci(esp32c61): disable soc_caps, docs, test for eco3 update 2025-05-26 16:04:23 +08:00
yinqingzhao 4e20dc58b3 fix(wifi): fix build issue by modifying parttion table of file_server example 2025-05-13 14:39:30 +08:00
Yin Qing Zhao 7141b9558b Merge branch 'feat/chip_esp32c5_eco2_support_wifi' into 'master'
feat/chip esp32c5 eco2 support wifi

Closes IDF-10602, IDF-10616, IDF-10592, IDF-10590, IDF-10605, IDF-10604, IDF-10618, IDF-10617, IDF-10588, IDF-10598, IDF-10609, IDF-10610, IDF-10600, IDF-10589, IDF-10607, IDF-10608, IDF-10596, IDF-12857, IDF-11002, IDF-10601, IDF-10579, IDF-8641, IDF-8640, IDF-8639, IDF-8638, PM-403, AX-1139, AX-1151, AX-1153, AX-1155, WIFIBUG-1159, and WIFIBUG-1146

See merge request espressif/esp-idf!38566
2025-04-28 21:06:18 +08:00
hrushikesh.bhosale 17a1a0dfb9 feat(async_handler): Adding test for long uri requests
Adding test for two /long async requests.
2025-04-28 14:57:21 +08:00
hrushikesh.bhosale b6d4fa2c2e fix(async_handler): Async handler example scratch buffer fix
1. In httpd_req_async_handler_begin, the httpd_req_aux is locally malloced
and data is  done memcpy to local httpd_req_aux from request'ss httpd_req_aux for
async request use-case, this causes scartch pointer from these two structs
pointing to same memory address.
2. In current workflow, the request's sratch buffer is freed in httpd_parse.c
httpd_req_cleanup api. Therefore if the user try to fetch the data (like headers)
from the scratch buffer, data will be not available.
3. Each request should have the deep copy of the scratch buffer. To retrive
the data later.

Closes https://github.com/espressif/esp-idf/issues/15587
2025-04-28 14:57:21 +08:00
yinqingzhao dd9f8bfcbc feat(wifi): chip esp32c5 eco2 support wifi 2025-04-28 10:52:55 +08:00
hrushikesh.bhosale 160336fe90 fix(esp_http_server): Async handler example stack overflow fix
1. In async handler example, on hitting /long URI and closing the
connection forcefully from client (example ctrl + c) cause more stack
size (almost 200 bytes) than successfull request.
2. The connection should be closed from the server as soon as the client
closes the connect (i.e. handler should return ESP_FAIL to close the
connection)
2025-04-25 11:00:10 +05:30
laokaiyao 9a88effab8 ci: disabled RF soc caps for c5 eco2
Disable the RF soc caps to bypass the build of un-supported RF examples
2025-04-16 11:01:39 +08:00
igor.udot daf2d31008 test: format all test scripts 2025-03-05 12:08:48 +08:00
hrushikesh.bhosale 06da436a4c feat(http_server/async_handler): Http server async pytest was not enabled
Pytest for the http_server/async_handler example was not enabled,
this ensures that the pytest is enabled
2025-02-28 11:23:26 +05:30
hrushikesh.bhosale 9846584def feat(esp_http_server): Modified the calculation of buf_len
Modified the calculation of buf_len, so that scratch buffer allocates
the memory according to requirement and not extra (except the last read chunk)
2025-02-13 17:15:07 +05:30
Mahavir Jain 6502148fdc fix(examples): simple http_server example build for Linux target
Static task creation on Linux target had issues with insufficient stack
memory allocation. Type of `StackType_t` is `unsigned long` and hence
it must be considered during stack memory allocation.

Fix ensures proper working of simple HTTP server example.
2025-01-10 09:50:18 +05:30
Anuj Deshpande c81c6cfb3a Fix upload_script to actually use max size variables 2024-12-13 10:09:47 +05:30
Hrushikesh Bhosale d90bd6a179 Merge branch 'feature/add_sse_demo_in_https_server_example' into 'master'
feat(http_server): Added Server Sent Events demo

Closes IDFGH-12605

See merge request espressif/esp-idf!33939
2024-12-06 15:44:01 +08:00
hrushikesh.bhosale 696b32c942 feat(https_server): Added Server Sent Events demo
This commit adds the demo of Server Sent Events
functionality in the https_server/simple example
Closes https://github.com/espressif/esp-idf/issues/13603

Co-authored-by: default avatarAditya Patwardhan <aditya.patwardhan@espressif.com>
2024-12-04 14:26:21 +05:30
Mahavir Jain ac35595746 Merge branch 'contrib/github_pr_14834' into 'master'
[Examples] [Async Handlers] simplify code by splitting long_async_handler into two functions (GitHub PR)

Closes IDFGH-14011

See merge request espressif/esp-idf!34694
2024-11-26 15:07:29 +08:00
Frantisek Hrbata 1c92945f59 change(examples): switch examples to use a minimal build
Currently, several example dependencies rely on the fact that all
registered components are added to the build, along with components
specified in common requirements. This results in longer build times
because even unused components must be built. Switch all examples to use
idf_minimal_build to compile only the components actually required by
the example.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-11-20 20:14:40 +01:00
Frantisek Hrbata ad15109daa change(examples): explicitly specify component dependencies for examples
Currently, several examples do not explicitly state their component
dependencies, relying instead on the default behavior that includes all
registered components and commonly required ones in the build.
Explicitly adding component dependencies can reduce build time when
set(COMPONENTS main) is used.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-11-20 14:11:24 +01:00
Chip Weinberger a89a954a85 [Examples] [Async Handlers] simplify code 2024-11-05 14:22:24 -08:00