feat(examples): Add ESP32-S31 support to network/sta2eth example

This commit is contained in:
Tomas Rezucha
2026-05-29 08:50:14 +02:00
parent ba2b9256e2
commit 3304a60e9f
4 changed files with 14 additions and 6 deletions

View File

@@ -7,7 +7,7 @@
This example aims to demonstrate 1-1 bridge using WiFi station and one of these interfaces (so called *wired* in this example)
- Ethernet (supported for all targets)
- USB acting as NCM device (supported for ESP32-S2 and ESP32-S3)
- USB acting as NCM device (supported for ESP32-S2, ESP32-S3 and ESP32-S31)
It also allows for reconfiguring WiFi settings using a virtual network in the Ethernet. The reconfiguration mode is initialized if the WiFi settings are not available, connection fails or manually by long pressing the Boot button (GPIO0).
It is possible to configure WiFi settings (SSID and password) in a browser on a hostname `"http://wifi.settings"` or using unified provisioning.
@@ -22,7 +22,7 @@ This example also supports runtime configuration of WiFi settings by means of a
### Hardware Required
Any board with either Ethernet of USB-OTG supported.
Any WiFi enabled board with either Ethernet of USB-OTG supported.
### Configure the project
@@ -30,7 +30,11 @@ Open the project configuration menu (`idf.py menuconfig`).
In the `Example Configuration` menu choose the provisioning method:
* `EXAMPLE_WIFI_CONFIGURATION_MANUAL` for manual configuration using a webpage
* `EXAMPLE_WIFI_CONFIGURATION_PROVISIONING` for standard provisioning over the virtual USB network
* `EXAMPLE_WIFI_CONFIGURATION_PROVISIONING` for standard provisioning over the virtual USB network
In the `Example Configuration` menu choose your wired interface:
* `EXAMPLE_WIRED_INTERFACE_IS_ETHERNET` for ethernet - supported on all targets
* `EXAMPLE_WIRED_INTERFACE_IS_USB` for USB - supported only on targets with USB-OTG peripheral. For this configuration, you must also enable NCM in TinyUSB by setting `TINYUSB_NET_MODE_NCM` in menuconfig
To provision the device using network provisioning tools (if `EXAMPLE_WIFI_CONFIGURATION_PROVISIONING` is selected) you can use idf provisioning utility with transport set to `softap`:
```bash

View File

@@ -72,7 +72,7 @@ menu "Example Configuration"
prompt "Ethernet"
config EXAMPLE_WIRED_INTERFACE_IS_USB
bool
depends on IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
depends on SOC_USB_OTG_SUPPORTED
prompt "USB NCM"
endchoice

View File

@@ -0,0 +1,3 @@
-
re: "error: implicit declaration of function 'tinyusb_net_init';"
hint: "NCM class must be enabled in TinyUSB configuration.\nIn idf.py menuconfig, go to (Top) > Component config > TinyUSB Stack > Network driver (ECM/NCM/RNDIS) > Network mode and select 'NCM'."

View File

@@ -3,11 +3,12 @@ dependencies:
espressif/esp_tinyusb:
version: "^2.0.0"
rules:
- if: "idf_version >=4.4"
- if: "target in [esp32s2, esp32s3]"
- if: "$CONFIG{EXAMPLE_WIRED_INTERFACE_IS_ETHERNET} == False"
dns_server:
path: ${IDF_PATH}/examples/protocols/http_server/captive_portal/components/dns_server
espressif/ethernet_init:
version: "^1.3.0"
rules:
- if: "$CONFIG{EXAMPLE_WIRED_INTERFACE_IS_ETHERNET} == True"
espressif/network_provisioning:
version: "^1.0.5"