diff --git a/examples/ethernet/.build-test-rules.yml b/examples/ethernet/.build-test-rules.yml index 56f1ebae6c..66aabf3225 100644 --- a/examples/ethernet/.build-test-rules.yml +++ b/examples/ethernet/.build-test-rules.yml @@ -4,9 +4,9 @@ examples/ethernet/basic: enable: - if: INCLUDE_DEFAULT == 1 disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported yet # TODO: [ESP32C5] IDF-8697, [esp32c61] IDF-9298 + reason: not supported yet # TODO: [esp32c61] IDF-9298 disable_test: - if: IDF_TARGET not in ["esp32"] temporary: true @@ -21,9 +21,9 @@ examples/ethernet/basic: examples/ethernet/enc28j60: disable: - - if: IDF_TARGET in ["esp32p4", "esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: target esp32p4, esp32c5 is not supported yet # TODO: [ESP32P4] IDF-8073 [ESP32C5] IDF-8697, [esp32c61] IDF-9298 + reason: not supported yet # TODO: [esp32c61] IDF-9298 depends_components: - esp_eth - esp_netif @@ -34,9 +34,9 @@ examples/ethernet/enc28j60: examples/ethernet/iperf: disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported yet # TODO: [ESP32C5] IDF-8697, [esp32c61] IDF-9298 + reason: not supported yet # TODO: [esp32c61] IDF-9298 disable_test: - if: IDF_TARGET not in ["esp32"] temporary: true diff --git a/examples/ethernet/basic/README.md b/examples/ethernet/basic/README.md index 92ec6d1593..742a6e1548 100644 --- a/examples/ethernet/basic/README.md +++ b/examples/ethernet/basic/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # Ethernet Example (See the README.md file in the upper level 'examples' directory for more information about examples.) diff --git a/examples/ethernet/basic/pytest_eth_basic.py b/examples/ethernet/basic/pytest_eth_basic.py index 52c73a360d..44ce6db4af 100644 --- a/examples/ethernet/basic/pytest_eth_basic.py +++ b/examples/ethernet/basic/pytest_eth_basic.py @@ -12,7 +12,7 @@ from pytest_embedded import Dut pytest.param('default_ip101', marks=[pytest.mark.ethernet_router]), pytest.param('default_dm9051', marks=[pytest.mark.eth_dm9051]), ], indirect=True) -def test_esp_eth_basic_dm9051( +def test_esp_eth_basic( dut: Dut ) -> None: # wait for ip received diff --git a/examples/ethernet/enc28j60/README.md b/examples/ethernet/enc28j60/README.md index 53124764d1..4fca9f307f 100644 --- a/examples/ethernet/enc28j60/README.md +++ b/examples/ethernet/enc28j60/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # ENC28J60 Example (See the README.md file in the upper level 'examples' directory for more information about examples.) diff --git a/examples/ethernet/iperf/README.md b/examples/ethernet/iperf/README.md index 39c83a3b08..ff93023a19 100644 --- a/examples/ethernet/iperf/README.md +++ b/examples/ethernet/iperf/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # Ethernet iperf Example diff --git a/examples/protocols/.build-test-rules.yml b/examples/protocols/.build-test-rules.yml index 0dfb3c43dc..c442f86196 100644 --- a/examples/protocols/.build-test-rules.yml +++ b/examples/protocols/.build-test-rules.yml @@ -15,9 +15,9 @@ examples/protocols/esp_http_client: enable: - if: INCLUDE_DEFAULT == 1 or IDF_TARGET == "linux" disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported yet # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported yet # TODO: [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET not in ["esp32", "linux"] depends_filepatterns: @@ -26,9 +26,9 @@ examples/protocols/esp_http_client: examples/protocols/esp_local_ctrl: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32h2", "esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32h2", "esp32c61"] temporary: true - reason: not supported yet # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported yet # TODO: [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET not in ["esp32", "esp32c3", "esp32s3"] reason: only test on these targets @@ -39,9 +39,9 @@ examples/protocols/esp_local_ctrl: examples/protocols/http_request: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported yet # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported yet # TODO: [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET != "esp32" reason: only test on esp32 @@ -49,9 +49,9 @@ examples/protocols/http_request: examples/protocols/http_server: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported yet # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported yet # TODO: [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET not in ["esp32", "esp32c3", "esp32s3"] reason: only test on these targets @@ -61,9 +61,11 @@ examples/protocols/http_server: examples/protocols/http_server/captive_portal: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32h2", "esp32p4", "esp32c5", "esp32c61"] + - if: SOC_WIFI_SUPPORTED != 1 + reason: WiFi is required + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported yet # TODO: IDF-8076 [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported yet # TODO: [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET != "esp32" reason: only test on esp32 @@ -73,18 +75,18 @@ examples/protocols/http_server/captive_portal: examples/protocols/http_server/restful_server: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32h2", "esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32h2", "esp32c61"] temporary: true - reason: not supported yet # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported yet # TODO: [ESP32C61] IDF-9298 depends_filepatterns: - components/esp_http_server/**/* examples/protocols/http_server/ws_echo_server: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported yet # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported yet # TODO: [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET != "esp32" reason: only test on esp32 @@ -96,9 +98,9 @@ examples/protocols/https_mbedtls: enable: - if: INCLUDE_DEFAULT == 1 or IDF_TARGET == "linux" disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported yet # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported yet # TODO: [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET != "esp32" reason: only test on esp32 @@ -108,7 +110,7 @@ examples/protocols/https_request: disable: - if: IDF_TARGET in ["esp32h2", "esp32p4", "esp32c5", "esp32c61"] temporary: true - reason: not supported on h2, p4 and c5 # TODO: IDF-9076 (H2) [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported on h2, p4 and c5 # TODO: IDF-9076 (H2/P4/C5), [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET != "esp32" reason: only test on esp32 @@ -116,9 +118,9 @@ examples/protocols/https_request: examples/protocols/https_server/simple: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported yet # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported yet # TODO: [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET not in ["esp32", "esp32c3", "esp32s3"] reason: only test on these targets @@ -129,9 +131,9 @@ examples/protocols/https_server/simple: examples/protocols/https_server/wss_server: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported yet # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported yet # TODO: [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET != "esp32" reason: only test on esp32 @@ -141,9 +143,9 @@ examples/protocols/https_server/wss_server: examples/protocols/https_x509_bundle: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported yet # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported yet # TODO: [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET != "esp32" reason: only test on esp32 @@ -153,18 +155,18 @@ examples/protocols/https_x509_bundle: examples/protocols/icmp_echo: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32p4", "esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported on p4 and c5 # TODO: [ESP32-C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported on c61 # TODO: [ESP32-C5] IDF-8697, [ESP32C61] IDF-9298 disable_test: - if: SOC_WIFI_SUPPORTED != 1 examples/protocols/l2tap: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32p4", "esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported on p4 and c5 # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported on c61 # TODO: [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET != "esp32" reason: only test on esp32 @@ -183,25 +185,25 @@ examples/protocols/modbus: examples/protocols/mqtt: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported on c5 # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported on c61 # TODO: [ESP32C61] IDF-9298 depends_filepatterns: - components/mqtt/**/* examples/protocols/mqtt/custom_outbox: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported on c5 # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported on c61 # TODO: [ESP32C61] IDF-9298 examples/protocols/mqtt/ssl: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported on c5 # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported on c61 # TODO: [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET != "esp32" reason: only test on esp32 @@ -216,9 +218,9 @@ examples/protocols/mqtt/ssl_ds: examples/protocols/mqtt/tcp: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported on c5 # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported on c61 # TODO: [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET != "esp32" reason: only test on esp32 @@ -226,9 +228,9 @@ examples/protocols/mqtt/tcp: examples/protocols/mqtt/ws: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported on c5 # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported on c61 # TODO: [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET != "esp32" reason: only test on esp32 @@ -236,9 +238,9 @@ examples/protocols/mqtt/ws: examples/protocols/mqtt/wss: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported on c5 # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported on c61 # TODO: [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET != "esp32" reason: only test on esp32 @@ -246,9 +248,9 @@ examples/protocols/mqtt/wss: examples/protocols/mqtt5: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported on c5 # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported on c61 # TODO: [ESP32C61] IDF-9298 disable_test: - if: IDF_TARGET != "esp32" reason: only test on esp32 @@ -256,9 +258,9 @@ examples/protocols/mqtt5: examples/protocols/smtp_client: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32p4", "esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported on p4 and c5 # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported on c61 # TODO: [ESP32C61] IDF-9298 examples/protocols/sntp: <<: *default_dependencies @@ -270,13 +272,12 @@ examples/protocols/sntp: examples/protocols/sockets: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32p4", "esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported on p4 and c5 # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported on c61 # TODO: [ESP32C61] IDF-9298 disable_test: - if: SOC_WIFI_SUPPORTED != 1 - examples/protocols/sockets/non_blocking: <<: *default_dependencies disable_test: @@ -290,14 +291,17 @@ examples/protocols/sockets/tcp_client: - if: SOC_WIFI_SUPPORTED != 1 # linux target won't work with CONFIG_EXAMPLE_SOCKET_IP_INPUT_STDIN=y disable: - - if: IDF_TARGET in ["esp32p4", "esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported on p4 and c5 # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported on c61 # TODO: [ESP32C61] IDF-9298 examples/protocols/static_ip: <<: *default_dependencies disable: - - if: IDF_TARGET in ["esp32h2"] - - if: IDF_TARGET in ["esp32p4", "esp32c5", "esp32c61"] + - if: IDF_TARGET in ["esp32c61"] temporary: true - reason: not supported on p4 and c5 # TODO: [ESP32C5] IDF-8697, [ESP32C61] IDF-9298 + reason: not supported on c61 # TODO: [ESP32C61] IDF-9298 + disable_test: + - if: IDF_TARGET != "esp32" + temporary: true + reason: lack of runners diff --git a/examples/protocols/esp_http_client/README.md b/examples/protocols/esp_http_client/README.md index 8e92232f8c..228a2a10b0 100644 --- a/examples/protocols/esp_http_client/README.md +++ b/examples/protocols/esp_http_client/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | Linux | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | ----- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | Linux | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | ----- | # ESP HTTP Client Example See the README.md file in the upper level 'examples' directory for more information about examples. diff --git a/examples/protocols/esp_local_ctrl/README.md b/examples/protocols/esp_local_ctrl/README.md index f51269ee9b..0f05d6ae3f 100644 --- a/examples/protocols/esp_local_ctrl/README.md +++ b/examples/protocols/esp_local_ctrl/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # ESP Local Control using HTTPS server diff --git a/examples/protocols/http_request/README.md b/examples/protocols/http_request/README.md index ce6795556d..48768f7354 100644 --- a/examples/protocols/http_request/README.md +++ b/examples/protocols/http_request/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # HTTP Request Example diff --git a/examples/protocols/http_server/advanced_tests/README.md b/examples/protocols/http_server/advanced_tests/README.md index 22303a8ebe..df7141a365 100644 --- a/examples/protocols/http_server/advanced_tests/README.md +++ b/examples/protocols/http_server/advanced_tests/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # HTTP server advanced tests diff --git a/examples/protocols/http_server/async_handlers/README.md b/examples/protocols/http_server/async_handlers/README.md index 61bdd20520..de5a852a8e 100644 --- a/examples/protocols/http_server/async_handlers/README.md +++ b/examples/protocols/http_server/async_handlers/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # Async Requests Handlers HTTPD Server Example diff --git a/examples/protocols/http_server/captive_portal/README.md b/examples/protocols/http_server/captive_portal/README.md index 671cb2aa24..41f1840b05 100644 --- a/examples/protocols/http_server/captive_portal/README.md +++ b/examples/protocols/http_server/captive_portal/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | # Captive Portal Example diff --git a/examples/protocols/http_server/file_serving/README.md b/examples/protocols/http_server/file_serving/README.md index 137cfd6bee..e8c0844552 100644 --- a/examples/protocols/http_server/file_serving/README.md +++ b/examples/protocols/http_server/file_serving/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # Simple HTTP File Server Example diff --git a/examples/protocols/http_server/persistent_sockets/README.md b/examples/protocols/http_server/persistent_sockets/README.md index ebd6542968..70b8bf60c0 100644 --- a/examples/protocols/http_server/persistent_sockets/README.md +++ b/examples/protocols/http_server/persistent_sockets/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # HTTPD Server Persistent Sockets Example diff --git a/examples/protocols/http_server/restful_server/README.md b/examples/protocols/http_server/restful_server/README.md index bc39fb3bdc..f59491fb09 100644 --- a/examples/protocols/http_server/restful_server/README.md +++ b/examples/protocols/http_server/restful_server/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # HTTP Restful API Server Example diff --git a/examples/protocols/http_server/simple/README.md b/examples/protocols/http_server/simple/README.md index cc7593f396..a5a284426a 100644 --- a/examples/protocols/http_server/simple/README.md +++ b/examples/protocols/http_server/simple/README.md @@ -1,9 +1,9 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # Simple HTTPD Server Example -The Example consists of HTTPD server demo with demostration of URI handling : +The Example consists of HTTPD server demo with demonstration of URI handling : 1. URI \hello for GET command returns "Hello World!" message 2. URI \echo for POST command echoes back the POSTed message @@ -39,7 +39,7 @@ See the Getting Started Guide for full steps to configure and use ESP-IDF to bui * run the test script : "python scripts/client.py \ \ \" * the provided test script first does a GET \hello and displays the response * the script does a POST to \echo with the user input \ and displays the response - * or use curl (asssuming IP is 192.168.43.130): + * or use curl (assuming IP is 192.168.43.130): 1. "curl 192.168.43.130:80/hello" - tests the GET "\hello" handler 2. "curl -X POST --data-binary @anyfile 192.168.43.130:80/echo > tmpfile" * "anyfile" is the file being sent as request body and "tmpfile" is where the body of the response is saved diff --git a/examples/protocols/http_server/ws_echo_server/README.md b/examples/protocols/http_server/ws_echo_server/README.md index 0f30248319..0c622e65a1 100644 --- a/examples/protocols/http_server/ws_echo_server/README.md +++ b/examples/protocols/http_server/ws_echo_server/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # Websocket echo server diff --git a/examples/protocols/https_mbedtls/README.md b/examples/protocols/https_mbedtls/README.md index c1a91775e5..e60d349612 100644 --- a/examples/protocols/https_mbedtls/README.md +++ b/examples/protocols/https_mbedtls/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | Linux | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | ----- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | Linux | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | ----- | # HTTP connection with TLS support using mbedTLS diff --git a/examples/protocols/https_server/simple/README.md b/examples/protocols/https_server/simple/README.md index d6aefd33b1..be0867d943 100644 --- a/examples/protocols/https_server/simple/README.md +++ b/examples/protocols/https_server/simple/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # HTTP server with SSL support using OpenSSL diff --git a/examples/protocols/https_server/wss_server/README.md b/examples/protocols/https_server/wss_server/README.md index 8ae7062bfa..fcdea7729e 100644 --- a/examples/protocols/https_server/wss_server/README.md +++ b/examples/protocols/https_server/wss_server/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # HTTP Websocket server with SSL support diff --git a/examples/protocols/https_x509_bundle/README.md b/examples/protocols/https_x509_bundle/README.md index e82d56c68c..730077afeb 100644 --- a/examples/protocols/https_x509_bundle/README.md +++ b/examples/protocols/https_x509_bundle/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # HTTPS x509 Bundle Example diff --git a/examples/protocols/icmp_echo/README.md b/examples/protocols/icmp_echo/README.md index 278578d567..3b0bdf3590 100644 --- a/examples/protocols/icmp_echo/README.md +++ b/examples/protocols/icmp_echo/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # ICMP Echo-Reply (Ping) example diff --git a/examples/protocols/icmp_echo/pytest_icmp_echo.py b/examples/protocols/icmp_echo/pytest_icmp_echo.py index cd00ff645e..87d405e481 100644 --- a/examples/protocols/icmp_echo/pytest_icmp_echo.py +++ b/examples/protocols/icmp_echo/pytest_icmp_echo.py @@ -1,6 +1,5 @@ # SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 - import os import pytest @@ -39,6 +38,7 @@ def _run_test(dut: Dut) -> None: @pytest.mark.esp32s2 @pytest.mark.esp32c3 @pytest.mark.esp32s3 +@pytest.mark.esp32c5 @pytest.mark.esp32c6 @pytest.mark.wifi_ap def test_protocols_icmp_echo(dut: Dut) -> None: diff --git a/examples/protocols/l2tap/README.md b/examples/protocols/l2tap/README.md index 9f7a97afa9..42c717650f 100644 --- a/examples/protocols/l2tap/README.md +++ b/examples/protocols/l2tap/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # ESP-NETIF L2 TAP Interface Example (See the README.md file in the upper level 'examples' directory for more information about examples.) diff --git a/examples/protocols/mqtt/custom_outbox/README.md b/examples/protocols/mqtt/custom_outbox/README.md index 5698dae61a..94774ec1a6 100644 --- a/examples/protocols/mqtt/custom_outbox/README.md +++ b/examples/protocols/mqtt/custom_outbox/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # ESP-MQTT custom outbox sample application (See the README.md file in the upper level 'examples' directory for more information about examples.) diff --git a/examples/protocols/mqtt/ssl/README.md b/examples/protocols/mqtt/ssl/README.md index 3da8c7ef5f..26e837432f 100644 --- a/examples/protocols/mqtt/ssl/README.md +++ b/examples/protocols/mqtt/ssl/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # ESP-MQTT SSL Sample application diff --git a/examples/protocols/mqtt/ssl_mutual_auth/README.md b/examples/protocols/mqtt/ssl_mutual_auth/README.md index 695da3e768..1f1b4467af 100644 --- a/examples/protocols/mqtt/ssl_mutual_auth/README.md +++ b/examples/protocols/mqtt/ssl_mutual_auth/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # ESP-MQTT SSL Sample application (mutual authentication) diff --git a/examples/protocols/mqtt/ssl_psk/README.md b/examples/protocols/mqtt/ssl_psk/README.md index f65175b913..7281b483d6 100644 --- a/examples/protocols/mqtt/ssl_psk/README.md +++ b/examples/protocols/mqtt/ssl_psk/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # ESP-MQTT SSL example with PSK verification diff --git a/examples/protocols/mqtt/tcp/README.md b/examples/protocols/mqtt/tcp/README.md index 8f5c4c5709..26a7fd78ec 100644 --- a/examples/protocols/mqtt/tcp/README.md +++ b/examples/protocols/mqtt/tcp/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # ESP-MQTT sample application (See the README.md file in the upper level 'examples' directory for more information about examples.) diff --git a/examples/protocols/mqtt/ws/README.md b/examples/protocols/mqtt/ws/README.md index bf84e7a73a..7e52baae61 100644 --- a/examples/protocols/mqtt/ws/README.md +++ b/examples/protocols/mqtt/ws/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # ESP-MQTT MQTT over Websocket diff --git a/examples/protocols/mqtt/wss/README.md b/examples/protocols/mqtt/wss/README.md index 2edbaf5055..80a50bb17a 100644 --- a/examples/protocols/mqtt/wss/README.md +++ b/examples/protocols/mqtt/wss/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # ESP-MQTT MQTT over WSS Sample application (See the README.md file in the upper level 'examples' directory for more information about examples.) diff --git a/examples/protocols/mqtt5/README.md b/examples/protocols/mqtt5/README.md index 9cf3cefdb5..a004c5ef51 100644 --- a/examples/protocols/mqtt5/README.md +++ b/examples/protocols/mqtt5/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # ESP-MQTT sample application (See the README.md file in the upper level 'examples' directory for more information about examples.) diff --git a/examples/protocols/smtp_client/README.md b/examples/protocols/smtp_client/README.md index b2ca0770ff..0b34fc91c6 100644 --- a/examples/protocols/smtp_client/README.md +++ b/examples/protocols/smtp_client/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # SMTP Client Example diff --git a/examples/protocols/sockets/icmpv6_ping/README.md b/examples/protocols/sockets/icmpv6_ping/README.md index ade7631e5e..89783667b7 100644 --- a/examples/protocols/sockets/icmpv6_ping/README.md +++ b/examples/protocols/sockets/icmpv6_ping/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # ICMPv6 Ping example diff --git a/examples/protocols/sockets/tcp_client/README.md b/examples/protocols/sockets/tcp_client/README.md index 1d0f3b65c4..a45bd243e3 100644 --- a/examples/protocols/sockets/tcp_client/README.md +++ b/examples/protocols/sockets/tcp_client/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # TCP Client example diff --git a/examples/protocols/sockets/tcp_client/pytest_tcp_client.py b/examples/protocols/sockets/tcp_client/pytest_tcp_client.py index fa297269a5..7cd14233a9 100644 --- a/examples/protocols/sockets/tcp_client/pytest_tcp_client.py +++ b/examples/protocols/sockets/tcp_client/pytest_tcp_client.py @@ -1,12 +1,13 @@ -# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 - import logging import socket import pytest -from common_test_methods import (get_env_config_variable, get_host_ip4_by_dest_ip, get_host_ip6_by_dest_ip, - get_my_interface_by_dest_ip) +from common_test_methods import get_env_config_variable +from common_test_methods import get_host_ip4_by_dest_ip +from common_test_methods import get_host_ip6_by_dest_ip +from common_test_methods import get_my_interface_by_dest_ip from pytest_embedded import Dut try: @@ -26,6 +27,7 @@ PORT = 3333 @pytest.mark.esp32c2 @pytest.mark.esp32c3 @pytest.mark.esp32s3 +@pytest.mark.esp32c5 @pytest.mark.esp32c6 @pytest.mark.wifi_router def test_examples_tcp_client_ipv4(dut: Dut) -> None: diff --git a/examples/protocols/sockets/tcp_client_multi_net/README.md b/examples/protocols/sockets/tcp_client_multi_net/README.md index a1e38499f9..94dd1066ab 100644 --- a/examples/protocols/sockets/tcp_client_multi_net/README.md +++ b/examples/protocols/sockets/tcp_client_multi_net/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # Multiple Ethernet Example (See the README.md file in the upper level 'examples' directory for more information about examples.) @@ -66,12 +66,12 @@ I (2315) wifi:pm start, type: 1 I (2325) wifi:AP's beacon interval = 102400 us, DTIM period = 3 I (3125) esp_netif_handlers: example_connect: sta ip: 192.168.2.15, mask: 255.255.255.0, gw: 192.168.2.1 -I (3125) example_connect: Interface desciption example_connect: sta +I (3125) example_connect: Interface description example_connect: sta I (3135) example_connect: Interface "example_connect: sta" got IPv4 address: 192.168.2.15 I (3625) example_connect: Interface "example_connect: sta" got IPv6 address: fe80:0000:0000:0000:32ae:a4ff:fec6:b4f8, type: ESP_IP6_ADDR_IS_LINK_LOCAL I (4825) example_connect: Ethernet Link Up I (5625) esp_netif_handlers: example_connect: eth ip: 192.168.32.148, mask: 255.255.252.0, gw: 192.168.32.3 -I (5625) example_connect: Interface desciption example_connect: eth +I (5625) example_connect: Interface description example_connect: eth I (5635) example_connect: Interface "example_connect: eth" got IPv4 address: 192.168.32.148 I (6625) example_connect: Interface "example_connect: eth" got IPv6 address: fe80:0000:0000:0000:32ae:a4ff:fec6:b4fb, type: ESP_IP6_ADDR_IS_LINK_LOCAL I (6625) example_connect: Connected to example_connect: eth diff --git a/examples/protocols/sockets/tcp_server/README.md b/examples/protocols/sockets/tcp_server/README.md index 06fc377600..227ff06518 100644 --- a/examples/protocols/sockets/tcp_server/README.md +++ b/examples/protocols/sockets/tcp_server/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # TCP Server example diff --git a/examples/protocols/sockets/tcp_server/pytest_tcp_server.py b/examples/protocols/sockets/tcp_server/pytest_tcp_server.py index 546dfc3dd7..e68ade9841 100644 --- a/examples/protocols/sockets/tcp_server/pytest_tcp_server.py +++ b/examples/protocols/sockets/tcp_server/pytest_tcp_server.py @@ -1,12 +1,12 @@ -# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 - import logging import time import netifaces import pytest -from common_test_methods import get_env_config_variable, get_my_interface_by_dest_ip +from common_test_methods import get_env_config_variable +from common_test_methods import get_my_interface_by_dest_ip from pytest_embedded import Dut try: @@ -27,6 +27,7 @@ MESSAGE = 'Data to ESP' @pytest.mark.esp32c2 @pytest.mark.esp32c3 @pytest.mark.esp32s3 +@pytest.mark.esp32c5 @pytest.mark.esp32c6 @pytest.mark.wifi_router def test_examples_tcp_server_ipv4(dut: Dut) -> None: diff --git a/examples/protocols/sockets/tcp_transport_client/README.md b/examples/protocols/sockets/tcp_transport_client/README.md index 8fa6c374e4..83082cd85d 100644 --- a/examples/protocols/sockets/tcp_transport_client/README.md +++ b/examples/protocols/sockets/tcp_transport_client/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # TCP TRANSPORT Client example diff --git a/examples/protocols/sockets/udp_client/README.md b/examples/protocols/sockets/udp_client/README.md index 87c4c99859..288e8c0534 100644 --- a/examples/protocols/sockets/udp_client/README.md +++ b/examples/protocols/sockets/udp_client/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # UDP Client example @@ -91,7 +91,7 @@ Choose connection capabilities in `Example Connection Configuration` menu: * If you want to connect lwIP network interface to the host system networking, set `EXAMPLE_CONNECT_LWIP_TAPIF`. * Configure the interface address information (IP address, GW address and netmask). * Create a host network interface named `tap0` of *TAP* type. You can use the `./make_tap_netif` script located in the `tapif_io` component directory. - * Optionally set input or output packet loss rate to simulate loosing data of physical interfaces. + * Optionally set input or output packet loss rate to simulate losing data of physical interfaces. * Note about the host side networking: * This example uses static IP address configured in `tapif_io` component configuration. * Use the IP ranges that do not overlap with any other IP range of the host system. diff --git a/examples/protocols/sockets/udp_client/pytest_udp_client.py b/examples/protocols/sockets/udp_client/pytest_udp_client.py index 6c14c88d7c..07a6df79eb 100644 --- a/examples/protocols/sockets/udp_client/pytest_udp_client.py +++ b/examples/protocols/sockets/udp_client/pytest_udp_client.py @@ -1,12 +1,13 @@ -# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 - import logging import socket import pytest -from common_test_methods import (get_env_config_variable, get_host_ip4_by_dest_ip, get_host_ip6_by_dest_ip, - get_my_interface_by_dest_ip) +from common_test_methods import get_env_config_variable +from common_test_methods import get_host_ip4_by_dest_ip +from common_test_methods import get_host_ip6_by_dest_ip +from common_test_methods import get_my_interface_by_dest_ip from pexpect.exceptions import TIMEOUT from pytest_embedded import Dut @@ -28,6 +29,7 @@ MAX_RETRIES = 3 @pytest.mark.esp32c2 @pytest.mark.esp32c3 @pytest.mark.esp32s3 +@pytest.mark.esp32c5 @pytest.mark.esp32c6 @pytest.mark.wifi_router def test_examples_udp_client_ipv4(dut: Dut) -> None: diff --git a/examples/protocols/sockets/udp_multicast/README.md b/examples/protocols/sockets/udp_multicast/README.md index f606192837..2306dd2871 100644 --- a/examples/protocols/sockets/udp_multicast/README.md +++ b/examples/protocols/sockets/udp_multicast/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # UDP Multicast Example diff --git a/examples/protocols/sockets/udp_server/README.md b/examples/protocols/sockets/udp_server/README.md index 8ce162746a..170760ac05 100644 --- a/examples/protocols/sockets/udp_server/README.md +++ b/examples/protocols/sockets/udp_server/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # UDP Server example diff --git a/examples/protocols/sockets/udp_server/pytest_udp_server.py b/examples/protocols/sockets/udp_server/pytest_udp_server.py index 52ddcc775c..826ef68948 100644 --- a/examples/protocols/sockets/udp_server/pytest_udp_server.py +++ b/examples/protocols/sockets/udp_server/pytest_udp_server.py @@ -1,10 +1,10 @@ -# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 - import logging import pytest -from common_test_methods import get_env_config_variable, get_my_interface_by_dest_ip +from common_test_methods import get_env_config_variable +from common_test_methods import get_my_interface_by_dest_ip from pytest_embedded import Dut try: @@ -26,6 +26,7 @@ MAX_RETRIES = 3 @pytest.mark.esp32c2 @pytest.mark.esp32c3 @pytest.mark.esp32s3 +@pytest.mark.esp32c5 @pytest.mark.esp32c6 @pytest.mark.wifi_router def test_examples_udp_server_ipv4(dut: Dut) -> None: diff --git a/examples/protocols/static_ip/README.md b/examples/protocols/static_ip/README.md index 764d2c4c85..53742e42e2 100644 --- a/examples/protocols/static_ip/README.md +++ b/examples/protocols/static_ip/README.md @@ -1,10 +1,11 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -# WiFi station example +# Static IP Example (See the README.md file in the upper level 'examples' directory for more information about examples.) +This example demonstrates how to configure static IP address on ESP32 family devices. ## How to use example @@ -14,9 +15,13 @@ idf.py menuconfig ``` -Set following parameters under Example Configuration Options: +At first, decide if you want to use the example with WiFi or Ethernet network interface. Note that the example is designed to support only one network interface at a time. -* Set `WiFi SSID` and `WiFi Password` and `Maximal retry` under Example Configuration Options. +* Set `WiFi SSID` and `WiFi Password` and `Maximal retry` under `WiFi Example Configuration` Options, if you are planning to use WiFi to connect to the network. + +* Or configure `Internal EMAC` or `SPI Ethernet` under `Ethernet Configuration` Option based on your actual hardware configuration, if you are planning to use Ethernet to connect to the network. + +Set following parameters under `Example Configuration` Options which are common for both network interfaces: * Set `Static IP address` of your device static IP. @@ -54,7 +59,7 @@ I (573) system_api: read default base MAC address from EFUSE I (603) wifi:wifi firmware version: 6b2834e I (603) wifi:wifi certification version: v7.0 I (603) wifi:config NVS flash: enabled -I (603) wifi:config nano formating: disabled +I (603) wifi:config nano formatting: disabled I (613) wifi:Init data frame dynamic rx buffer num: 32 I (613) wifi:Init management frame dynamic rx buffer num: 32 I (623) wifi:Init management short buffer num: 32 diff --git a/examples/protocols/static_ip/main/Kconfig.projbuild b/examples/protocols/static_ip/main/Kconfig.projbuild index 94cc59f42a..0d38ce50a6 100644 --- a/examples/protocols/static_ip/main/Kconfig.projbuild +++ b/examples/protocols/static_ip/main/Kconfig.projbuild @@ -1,22 +1,9 @@ menu "Example Configuration" - - config EXAMPLE_WIFI_SSID - string "WiFi SSID" - default "myssid" - help - SSID (network name) for the example to connect to. - - config EXAMPLE_WIFI_PASSWORD - string "WiFi Password" - default "mypassword" - help - WiFi password (WPA or WPA2) for the example to use. - - config EXAMPLE_MAXIMUM_RETRY - int "Maximum retry" - default 5 - help - Set the Maximum retry to avoid station reconnecting to the AP unlimited when the AP is really inexistent. + # Hidden variable to get configuration of Component for Ethernet Initialization + config EXAMPLE_USE_ETH + bool + default y if ETHERNET_INTERNAL_SUPPORT || ETHERNET_SPI_SUPPORT + default n config EXAMPLE_STATIC_IP_ADDR string "Static IP address" @@ -79,3 +66,33 @@ menu "Example Configuration" help Set domain name for DNS test endmenu + +menu "WiFi Example Configuration" + config EXAMPLE_USE_WIFI + depends on SOC_WIFI_SUPPORTED + bool "Use WiFi" + default y + help + Select to use WiFi as network interface in the example. + + if EXAMPLE_USE_WIFI + config EXAMPLE_WIFI_SSID + string "WiFi SSID" + default "myssid" + help + SSID (network name) for the example to connect to. + + config EXAMPLE_WIFI_PASSWORD + string "WiFi Password" + default "mypassword" + help + WiFi password (WPA or WPA2) for the example to use. + + config EXAMPLE_MAXIMUM_RETRY + int "Maximum retry" + default 5 + help + Set the Maximum retry to avoid station reconnecting to the AP unlimited when the AP is really + inexistent. + endif # EXAMPLE_WIFI +endmenu diff --git a/examples/protocols/static_ip/main/idf_component.yml b/examples/protocols/static_ip/main/idf_component.yml new file mode 100644 index 0000000000..4ca406cdcd --- /dev/null +++ b/examples/protocols/static_ip/main/idf_component.yml @@ -0,0 +1,5 @@ +dependencies: + idf: + version: '>=5.0' + espressif/ethernet_init: + version: '*' diff --git a/examples/protocols/static_ip/main/static_ip_example_main.c b/examples/protocols/static_ip/main/static_ip_example_main.c index deef05db20..c5c9639a21 100644 --- a/examples/protocols/static_ip/main/static_ip_example_main.c +++ b/examples/protocols/static_ip/main/static_ip_example_main.c @@ -12,19 +12,30 @@ #include "freertos/event_groups.h" #include "esp_system.h" #include "esp_wifi.h" +#include "esp_eth.h" +#include "ethernet_init.h" #include "esp_event.h" #include "esp_log.h" #include #include "nvs_flash.h" +#if CONFIG_EXAMPLE_USE_WIFI && CONFIG_EXAMPLE_USE_ETH +#error "The example is designed to be used only with one Network interface. Either select WiFi or Ethernet." +#endif +#if !(CONFIG_EXAMPLE_USE_WIFI || CONFIG_EXAMPLE_USE_ETH) +#error "Incomplete network interface configuration. Either select WiFi or Ethernet." +#endif + /* The examples use configuration that you can set via project configuration menu If you'd rather not, just change the below entries to strings with the config you want - ie #define EXAMPLE_WIFI_SSID "mywifissid" */ +#ifdef CONFIG_EXAMPLE_USE_WIFI #define EXAMPLE_WIFI_SSID CONFIG_EXAMPLE_WIFI_SSID #define EXAMPLE_WIFI_PASS CONFIG_EXAMPLE_WIFI_PASSWORD #define EXAMPLE_MAXIMUM_RETRY CONFIG_EXAMPLE_MAXIMUM_RETRY +#endif // EXAMPLE_USE_WIFI #define EXAMPLE_STATIC_IP_ADDR CONFIG_EXAMPLE_STATIC_IP_ADDR #define EXAMPLE_STATIC_NETMASK_ADDR CONFIG_EXAMPLE_STATIC_NETMASK_ADDR #define EXAMPLE_STATIC_GW_ADDR CONFIG_EXAMPLE_STATIC_GW_ADDR @@ -34,23 +45,23 @@ #else #define EXAMPLE_MAIN_DNS_SERVER CONFIG_EXAMPLE_STATIC_DNS_SERVER_MAIN #define EXAMPLE_BACKUP_DNS_SERVER CONFIG_EXAMPLE_STATIC_DNS_SERVER_BACKUP -#endif +#endif // CONFIG_EXAMPLE_STATIC_DNS_AUTO #ifdef CONFIG_EXAMPLE_STATIC_DNS_RESOLVE_TEST #define EXAMPLE_RESOLVE_DOMAIN CONFIG_EXAMPLE_STATIC_RESOLVE_DOMAIN -#endif +#endif // CONFIG_EXAMPLE_STATIC_DNS_RESOLVE_TEST /* FreeRTOS event group to signal when we are connected*/ -static EventGroupHandle_t s_wifi_event_group; +static EventGroupHandle_t s_network_event_group; /* The event group allows multiple bits for each event, but we only care about two events: * - we are connected to the AP with an IP * - we failed to connect after the maximum amount of retries */ -#define WIFI_CONNECTED_BIT BIT0 -#define WIFI_FAIL_BIT BIT1 +#define CONNECTED_BIT BIT0 +#define WIFI_FAIL_BIT BIT1 + +#define ETH_CONNECTION_TMO_MS (10000) static const char *TAG = "static_ip"; -static int s_retry_num = 0; - static esp_err_t example_set_dns_server(esp_netif_t *netif, uint32_t addr, esp_netif_dns_type_t type) { if (addr && (addr != IPADDR_NONE)) { @@ -82,9 +93,12 @@ static void example_set_static_ip(esp_netif_t *netif) ESP_ERROR_CHECK(example_set_dns_server(netif, ipaddr_addr(EXAMPLE_BACKUP_DNS_SERVER), ESP_NETIF_DNS_BACKUP)); } -static void event_handler(void* arg, esp_event_base_t event_base, +#ifdef CONFIG_EXAMPLE_USE_WIFI +static void wifi_event_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { + static int s_retry_num = 0; + if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) { esp_wifi_connect(); } else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_CONNECTED) { @@ -95,24 +109,28 @@ static void event_handler(void* arg, esp_event_base_t event_base, s_retry_num++; ESP_LOGI(TAG, "retry to connect to the AP"); } else { - xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT); + xEventGroupSetBits(s_network_event_group, WIFI_FAIL_BIT); } ESP_LOGI(TAG,"connect to the AP fail"); } else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) { ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data; ESP_LOGI(TAG, "static ip:" IPSTR, IP2STR(&event->ip_info.ip)); s_retry_num = 0; - xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT); + xEventGroupSetBits(s_network_event_group, CONNECTED_BIT); } } -void wifi_init_sta(void) +static void wifi_init_sta(void) { - s_wifi_event_group = xEventGroupCreate(); + //Initialize NVS + esp_err_t ret = nvs_flash_init(); + if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { + ESP_ERROR_CHECK(nvs_flash_erase()); + ret = nvs_flash_init(); + } + ESP_ERROR_CHECK(ret); - ESP_ERROR_CHECK(esp_netif_init()); - - ESP_ERROR_CHECK(esp_event_loop_create_default()); + ESP_LOGI(TAG, "ESP_WIFI_MODE_STA"); esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta(); assert(sta_netif); @@ -124,12 +142,12 @@ void wifi_init_sta(void) esp_event_handler_instance_t instance_got_ip; ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, ESP_EVENT_ANY_ID, - &event_handler, + &wifi_event_handler, sta_netif, &instance_any_id)); ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT, IP_EVENT_STA_GOT_IP, - &event_handler, + &wifi_event_handler, sta_netif, &instance_got_ip)); @@ -138,7 +156,7 @@ void wifi_init_sta(void) .ssid = EXAMPLE_WIFI_SSID, .password = EXAMPLE_WIFI_PASS, /* Setting a password implies station will connect to all security modes including WEP/WPA. - * However these modes are deprecated and not advisable to be used. Incase your Access point + * However these modes are deprecated and not advisable to be used. In case your Access point * doesn't support WPA2, these mode can be enabled by commenting below line */ .threshold.authmode = WIFI_AUTH_WPA2_PSK, }, @@ -149,17 +167,17 @@ void wifi_init_sta(void) ESP_LOGI(TAG, "wifi_init_sta finished."); - /* Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum - * number of re-tries (WIFI_FAIL_BIT). The bits are set by event_handler() (see above) */ - EventBits_t bits = xEventGroupWaitBits(s_wifi_event_group, - WIFI_CONNECTED_BIT | WIFI_FAIL_BIT, + /* Waiting until either the connection is established (CONNECTED_BIT) or connection failed for the maximum + * number of re-tries (WIFI_FAIL_BIT). The bits are set by wifi_event_handler() (see above) */ + EventBits_t bits = xEventGroupWaitBits(s_network_event_group, + CONNECTED_BIT | WIFI_FAIL_BIT, pdFALSE, pdFALSE, portMAX_DELAY); /* xEventGroupWaitBits() returns the bits before the call returned, hence we can test which event actually * happened. */ - if (bits & WIFI_CONNECTED_BIT) { + if (bits & CONNECTED_BIT) { ESP_LOGI(TAG, "connected to ap SSID:%s password:%s", EXAMPLE_WIFI_SSID, EXAMPLE_WIFI_PASS); } else if (bits & WIFI_FAIL_BIT) { @@ -168,6 +186,91 @@ void wifi_init_sta(void) } else { ESP_LOGE(TAG, "UNEXPECTED EVENT"); } + + /* The event will not be processed after unregister */ + ESP_ERROR_CHECK(esp_event_handler_instance_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, instance_got_ip)); + ESP_ERROR_CHECK(esp_event_handler_instance_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, instance_any_id)); + vEventGroupDelete(s_network_event_group); +} +#endif // CONFIG_EXAMPLE_USE_WIFI + +#ifdef CONFIG_EXAMPLE_USE_ETH +static void eth_event_handler(void* arg, esp_event_base_t event_base, + int32_t event_id, void* event_data) +{ + if (event_base == ETH_EVENT && event_id == ETHERNET_EVENT_CONNECTED) { + example_set_static_ip(arg); + } else if (event_base == IP_EVENT && event_id == IP_EVENT_ETH_GOT_IP) { + ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data; + ESP_LOGI(TAG, "static ip:" IPSTR, IP2STR(&event->ip_info.ip)); + xEventGroupSetBits(s_network_event_group, CONNECTED_BIT); + } +} + +static void eth_init(void) +{ + uint8_t eth_port_cnt = 0; + esp_eth_handle_t *eth_handles; + ESP_ERROR_CHECK(ethernet_init_all(ð_handles, ð_port_cnt)); + if (eth_port_cnt > 1) { + ESP_LOGW(TAG, "multiple Ethernet devices detected, the first initialized is to be used!"); + } + + esp_netif_config_t cfg = ESP_NETIF_DEFAULT_ETH(); + esp_netif_t *eth_netif = esp_netif_new(&cfg); + // Attach Ethernet driver to TCP/IP stack + ESP_ERROR_CHECK(esp_netif_attach(eth_netif, esp_eth_new_netif_glue(eth_handles[0]))); + + esp_event_handler_instance_t instance_any_id; + esp_event_handler_instance_t instance_got_ip; + ESP_ERROR_CHECK(esp_event_handler_instance_register(ETH_EVENT, + ESP_EVENT_ANY_ID, + ð_event_handler, + eth_netif, + &instance_any_id)); + ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT, + IP_EVENT_ETH_GOT_IP, + ð_event_handler, + eth_netif, + &instance_got_ip)); + + ESP_ERROR_CHECK(esp_eth_start(eth_handles[0])); + + /* Waiting until the connection is established (CONNECTED_BIT). The bits are set by eth_event_handler() (see above) */ + EventBits_t bits = xEventGroupWaitBits(s_network_event_group, + CONNECTED_BIT, + pdFALSE, + pdFALSE, + pdMS_TO_TICKS(ETH_CONNECTION_TMO_MS)); + + /* xEventGroupWaitBits() returns the bits before the call returned, hence we can test which event actually + * happened. */ + if (!(bits & CONNECTED_BIT)) { + ESP_LOGE(TAG, "Ethernet link not connected in defined timeout of %d msecs", ETH_CONNECTION_TMO_MS); + } + + /* The event will not be processed after unregister */ + ESP_ERROR_CHECK(esp_event_handler_instance_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, instance_got_ip)); + ESP_ERROR_CHECK(esp_event_handler_instance_unregister(ETH_EVENT, ESP_EVENT_ANY_ID, instance_any_id)); + vEventGroupDelete(s_network_event_group); +} +#endif // CONFIG_EXAMPLE_USE_ETH + +void app_main(void) +{ + s_network_event_group = xEventGroupCreate(); + + ESP_ERROR_CHECK(esp_netif_init()); + + ESP_ERROR_CHECK(esp_event_loop_create_default()); + +#ifdef CONFIG_EXAMPLE_USE_WIFI + wifi_init_sta(); +#endif +#ifdef CONFIG_EXAMPLE_USE_ETH + eth_init(); +#endif + #ifdef CONFIG_EXAMPLE_STATIC_DNS_RESOLVE_TEST struct addrinfo *address_info; struct addrinfo hints; @@ -175,6 +278,7 @@ void wifi_init_sta(void) hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; + ESP_LOGI(TAG, "Trying to resolve IP address for domain: '%s'", EXAMPLE_RESOLVE_DOMAIN); int res = getaddrinfo(EXAMPLE_RESOLVE_DOMAIN, NULL, &hints, &address_info); if (res != 0 || address_info == NULL) { ESP_LOGE(TAG, "couldn't get hostname for :%s: " @@ -192,22 +296,4 @@ void wifi_init_sta(void) #endif } #endif - /* The event will not be processed after unregister */ - ESP_ERROR_CHECK(esp_event_handler_instance_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, instance_got_ip)); - ESP_ERROR_CHECK(esp_event_handler_instance_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, instance_any_id)); - vEventGroupDelete(s_wifi_event_group); -} - -void app_main(void) -{ - //Initialize NVS - esp_err_t ret = nvs_flash_init(); - if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { - ESP_ERROR_CHECK(nvs_flash_erase()); - ret = nvs_flash_init(); - } - ESP_ERROR_CHECK(ret); - - ESP_LOGI(TAG, "ESP_WIFI_MODE_STA"); - wifi_init_sta(); } diff --git a/examples/protocols/static_ip/pytest_static_ip.py b/examples/protocols/static_ip/pytest_static_ip.py new file mode 100644 index 0000000000..aecc2b5fed --- /dev/null +++ b/examples/protocols/static_ip/pytest_static_ip.py @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Unlicense OR CC0-1.0 +import pytest +from pytest_embedded import Dut + + +@pytest.mark.esp32 +@pytest.mark.eth_ip101 +@pytest.mark.parametrize('config', [ + 'default_ip101', +], indirect=True) +def test_static_ip( + dut: Dut +) -> None: + dut.expect(r'Resolved IPv4 address: (\d+\.\d+\.\d+\.\d+)') diff --git a/examples/protocols/static_ip/sdkconfig.ci.default_ip101 b/examples/protocols/static_ip/sdkconfig.ci.default_ip101 new file mode 100644 index 0000000000..51c2f95c47 --- /dev/null +++ b/examples/protocols/static_ip/sdkconfig.ci.default_ip101 @@ -0,0 +1,28 @@ +CONFIG_IDF_TARGET="esp32" + +# CONFIG_EXAMPLE_USE_WIFI is not set +CONFIG_EXAMPLE_USE_ETH=y + +# Below static IP configuration is compatible with "VM Ethernet CI runner" environment +CONFIG_EXAMPLE_STATIC_IP_ADDR="120.140.1.2" +CONFIG_EXAMPLE_STATIC_NETMASK_ADDR="255.255.255.0" +CONFIG_EXAMPLE_STATIC_GW_ADDR="120.140.1.1" + +# CONFIG_EXAMPLE_STATIC_DNS_AUTO is not set +CONFIG_EXAMPLE_STATIC_DNS_MANUAL=y +CONFIG_EXAMPLE_STATIC_DNS_SERVER_MAIN="8.8.8.8" +CONFIG_EXAMPLE_STATIC_DNS_SERVER_BACKUP="8.8.4.4" +CONFIG_EXAMPLE_STATIC_DNS_RESOLVE_TEST=y +CONFIG_EXAMPLE_STATIC_RESOLVE_DOMAIN="www.espressif.com" + +CONFIG_ETHERNET_INTERNAL_SUPPORT=y +CONFIG_ETHERNET_PHY_IP101=y +# CONFIG_ETHERNET_PHY_RTL8201 is not set +# CONFIG_ETHERNET_PHY_LAN87XX is not set +# CONFIG_ETHERNET_PHY_DP83848 is not set +# CONFIG_ETHERNET_PHY_KSZ80XX is not set +CONFIG_ETHERNET_MDC_GPIO=23 +CONFIG_ETHERNET_MDIO_GPIO=18 +CONFIG_ETHERNET_PHY_RST_GPIO=5 +CONFIG_ETHERNET_PHY_ADDR=1 +# CONFIG_ETHERNET_SPI_SUPPORT is not set diff --git a/examples/protocols/static_ip/sdkconfig.defaults b/examples/protocols/static_ip/sdkconfig.defaults new file mode 100644 index 0000000000..de64472bf5 --- /dev/null +++ b/examples/protocols/static_ip/sdkconfig.defaults @@ -0,0 +1,2 @@ +# CONFIG_ETHERNET_INTERNAL_SUPPORT is not set +# CONFIG_ETHERNET_SPI_SUPPORT is not set diff --git a/examples/protocols/static_ip/sdkconfig.defaults.esp32h2 b/examples/protocols/static_ip/sdkconfig.defaults.esp32h2 new file mode 100644 index 0000000000..234a726530 --- /dev/null +++ b/examples/protocols/static_ip/sdkconfig.defaults.esp32h2 @@ -0,0 +1,3 @@ +CONFIG_IDF_TARGET="esp32h2" + +CONFIG_ETHERNET_SPI_SUPPORT=y diff --git a/examples/protocols/static_ip/sdkconfig.defaults.esp32p4 b/examples/protocols/static_ip/sdkconfig.defaults.esp32p4 new file mode 100644 index 0000000000..23c1fe8d24 --- /dev/null +++ b/examples/protocols/static_ip/sdkconfig.defaults.esp32p4 @@ -0,0 +1,3 @@ +CONFIG_IDF_TARGET="esp32p4" + +CONFIG_ETHERNET_INTERNAL_SUPPORT=y