52 Commits

Author SHA1 Message Date
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
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
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 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
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
igor.udot daf2d31008 test: format all test scripts 2025-03-05 12:08:48 +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
Ondrej Kosta 301e67157b ci(esp_eth): enabled build and test for c61 in eth/proto examples 2024-09-18 08:44:58 +02:00
Ondrej Kosta dd81b56fb6 feat(esp_eth): removed disable of C5 and P4 from examples .build-test-rules
Updated examples to be able to build for C5 and P4.

Added Ethernet support for static_ip example.
2024-08-14 10:07:48 +02:00
Harshit Malpani 2df1ba8535 docs: Update App Utils programming guide docs for ESP32P4
Re-enable protocol and ota examples for ESP32P4
2024-02-23 12:33:11 +05:30
Ivan Grokhotkov 6d87100a70 feat(examples): add local components via idf_component.yml
Specifying all the dependencies (managed and local) in the manifest
makes it easier for users to see every component the example
depends on.
2023-09-19 10:38:24 +02:00
Rocha Euripedes dc016f5987 Merge branch 'fix/mqtt_esp32h2_examples' into 'master'
protocols/examples: Disable Wifi connection if not supported

See merge request espressif/esp-idf!23970
2023-06-05 13:51:30 +08:00
Euripedes Rocha 4778d9b477 protocols/examples: Disable Wifi connection if not supported
- Disable Kconfig option for Wifi if not supported by the SoC
- Enable building mqtt examples when target is set to esp32h2
2023-05-30 13:26:45 +02:00
yuanjianmin 0b71dcc7ea example: Fix memory leak in ws_echo_server when httpd_queue_work failed
Closes https://github.com/espressif/esp-idf/issues/11507
2023-05-29 10:12:16 +00:00
Chen Yudong 8aca3932b0 CI: enable more wifi cases 2023-01-06 06:03:52 +00:00
Chen Yudong d54e1e8379 CI: make sure that reading of the ipv4 address has finished 2022-07-15 14:21:39 +08:00
Chen Yudong 2f75733ad7 CI: Improve common test methods
also fix ota test cases
2022-07-15 14:21:34 +08:00
Chen Yudong 692fbc169c CI: use ssid password from stdin for pytest cases 2022-07-15 01:16:36 +08:00
Chen Yudong 472ac26712 CI: update test cases to use different environment variables
change test environments
optimize asio udp server test
fix icmp echo test case
use ethernet_router env to run iperf test cases
2022-07-15 01:16:35 +08:00
Fu Hanxi c0568611dd docs: changes docs supported targets tables 2022-07-14 08:26:32 +08:00
Harshit Malpani 83ace52a36 http examples pytest migration 2022-06-03 16:00:52 +05:30
Michael (XIAO Xufeng) f7be540222 ci: partially enable example build for esp32c2 2022-06-02 14:17:31 +08:00
Djordje Nedic facab8c5a7 tools: Increase the minimal supported CMake version to 3.16
This updates the minimal supported version of CMake to 3.16, which in turn enables us to use more CMake features and have a cleaner build system.
This is the version that provides most new features and also the one we use in our latest docker image for CI.
2022-06-01 06:35:02 +00:00
Harshit Malpani 2c56c6cad8 Updated coding style and added error logs 2022-05-11 08:58:01 +00:00
Nathan Phillips e8e63a06e8 Don't ignore return value of httpd_stop 2022-05-11 08:58:01 +00:00
lukedukeus 469be7cc54 Removed unnecessary #include statement 2022-03-07 16:30:37 -05:00
Yuan Jian Min 0c73f20afd docs: Add user-friendly guide about how to use ws_server_example_test.py
Closes https://github.com/espressif/esp-idf/issues/8060
2022-01-02 11:27:05 +00:00
Roland Dobai 766aa57084 Build & config: Remove leftover files from the unsupported "make" build system 2021-11-11 15:32:36 +01:00
David Cermak 008d677746 http_server: Fix docs for ws server user implementation
Closes https://github.com/espressif/esp-idf/issues/7027
2021-09-09 17:16:48 +08:00
Shubham Kulkarni 0a395134d4 Split example_tests with Example_WIFI tag group into Example_OTA and Example_Protocols 2021-04-15 04:00:06 +00:00
yuanjm 3874c20b5d esp_http_server: Fix examples parse ws keep-alive packet fail. 2021-03-16 09:55:02 +05:30
yuanjm a1d5cfc260 example: Identify the callback whether is hanshake or frame-receive by req->method
Now the uri handler gets called immediately after the handshake. In the handler we can identify that this was the handshake by checking req->method as it is still a GET from the first part of the handshake the client has sent. On a normal websocket-frame-receive (when normally a websocket uriHandler gets called) this field is set to 0
Closes https://github.com/espressif/esp-idf/issues/6597
2021-03-09 07:32:15 +00:00
yuanjm cd521d4ae3 esp_http_server: support dynamic payload len for ws server
Closes https://github.com/espressif/esp-idf/issues/6433
2021-02-24 11:40:34 +00:00
Fu Hanxi 0146f258d7 style: format python files with isort and double-quote-string-fixer 2021-01-26 10:49:01 +08:00
He Yin Ling a908174c06 test: remove fake binary size check in example test:
the binary size check in example test was removed long time ago. Now we
have updated ttfw_idf to raise exception when performance standard is
not found. These fake performance check will be regarded as error.
Remove them now.
2020-11-24 17:53:33 +08:00
Chen Yu Dong 454edcc0a8 ci: all jobs use python3 by default 2020-11-19 03:27:58 +00:00
Angus Gratton 66fb5a29bb Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo.

(Line endings, blank lines at end of file, trailing whitespace)
2020-11-11 07:36:35 +00:00
David Cermak 2f22a43a5d http_server example test: Simplify client code in the test to use ws package 2020-09-09 08:00:20 +02:00
David Cermak 005f21accc http_server: WebSocket server to set flag in transmitted messages by default
Add logic to set `FIN` flag automatically for transmitted WS frames, but
if `fragmented` option set indicating an expert/manual mode, then the
`FIN` flag is set according to the `final` option.
2020-07-13 14:39:22 +00:00
David Cermak 52150c2cd2 http_server example: WebSocket server to set final flag in async messages
Closes https://github.com/espressif/esp-idf/issues/5405
2020-07-13 14:39:22 +00:00
David Cermak e57dbf7c27 http-server-example: correction of regex waiting to acquire IP address
Since the recent refactoring of spi bus_lock comonent introduced heavy logging under debug/verbose level of verbosity, the http-server test executed in the CI became less stable due to complicated regex. Fixed by removing the first optional group
2020-04-05 20:07:27 +02:00
David Cermak 0c13082b20 http_server docs: document websocket feature and corresponding example 2020-03-18 20:24:46 +00:00