Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions network_provisioning/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 09-October-2025

- Build wifi_prov example for ESP32-P4 (for ESP32-P4-Function-EV-Board)
- ESP32-P4 assumes ESP32-C6 (configurable) acts as Wi-Fi and BLE co-processor over SDIO transport
- Uses esp_wifi_remote and esp_hosted_mcu

# 07-October-2025

- Use managed cJSON component for IDF v6.0 and above
Expand Down
38 changes: 36 additions & 2 deletions network_provisioning/examples/wifi_prov/README.md
Original file line number Diff line number Diff line change
@@ -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-C6 | ESP32-S2 | ESP32-S3 | ESP32-P4 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- |

# Wi-Fi Provisioning Example

Expand Down Expand Up @@ -283,6 +283,40 @@ expected on success:
CustomData response: SUCCESS
```

## ESP32-P4 Support

The ESP32-P4 uses a two-chip solution with ESP-Hosted to enable Wi-Fi provisioning.

### Running on ESP32-P4-Function-EV-Board

On this board, the ESP32-P4 connects to an on-board ESP32-C6 (co-processor) via SDIO. The ESP32-C6 comes pre-flashed with ESP-Hosted co-processor software. See [ESP-Hosted ESP32-P4 EV Board documentation](https://github.com/espressif/esp-hosted-mcu/blob/main/docs/esp32_p4_function_ev_board.md) for details.

#### Build and Flash

Set ESP32-P4 as target:
```
idf.py set-target esp32p4
```

Configure the project:
```
idf.py menuconfig
```
Navigate to `Component config` → `Wi-Fi Remote` → `choose slave target` and select `esp32c6`.

Build and flash:
```
idf.py -p PORT flash monitor
```

#### Co-processor Update (Optional)

The pre-flashed co-processor software is compatible, but upgrading to the latest version is recommended via:
- [Simplified co-processor OTA](https://github.com/espressif/esp-hosted-mcu/blob/main/docs/esp32_p4_function_ev_board.md#51-ota-updates), or
- [Manual flashing with ESP-Prog](https://github.com/espressif/esp-hosted-mcu/blob/main/docs/esp32_p4_function_ev_board.md#52-using-esp-prog)

For ESP-Hosted technical queries, open an issue at the [ESP-Hosted GitHub repository](https://github.com/espressif/esp-hosted-mcu/issues).

## Troubleshooting

### Provisioning failed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@ dependencies:
espressif/network_provisioning:
version: "*"
override_path: '../../../'

espressif/esp_wifi_remote:
version: ">=0.10"
rules:
- if: "target in [esp32p4, esp32h2]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we remove from H2 from the list? H2 can support thread provisioning in standalone manner.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that H2 can be removed, as H2 is not mentioned in the supported targets list of README file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually H2 can use wifi-remote & hosted for wifi provisioning. So should we keep it or not, @mahavirj ?

I will update H2 in supported target accordingly..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mantriyogesh For H2, we recommend using network_provisioning/examples/thread_prov example. H2 is already listed a supported target here.

Actually H2 can use wifi-remote & hosted for wifi provisioning.

Is this for Thread Boarder router use-case? Does it use hosted approach?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree the H Series would be native wifi provisioning generally be used and is more intuitive.

But if H2 wants to do wifi based provisioning (technically be possible using two chip using esp-wifi-remote & esp-hosted duo).

espressif/esp_hosted:
version: "~2"
rules:
- if: "target in [esp32p4, esp32h2]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as earlier to remove H2

36 changes: 36 additions & 0 deletions network_provisioning/examples/wifi_prov/sdkconfig.defaults.esp32p4
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Override some defaults so BT stack is enabled
# in this example

CONFIG_FREERTOS_HZ=1000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we can remove this - not a mandatory requirement?


# BT config
CONFIG_BT_ENABLED=y
CONFIG_BT_CONTROLLER_DISABLED=y
CONFIG_BT_BLUEDROID_ENABLED=n
CONFIG_BT_NIMBLE_ENABLED=y
CONFIG_BT_NIMBLE_TRANSPORT_UART=n

# Wi-Fi Remote
CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED=y

# Enable ESP Hosted BT
## Use Hosted-HCI (https://github.com/espressif/esp-hosted-mcu/blob/main/docs/bluetooth_design.md#3-bluetooth-interface)
CONFIG_ESP_HOSTED_ENABLE_BT_NIMBLE=y
CONFIG_ESP_HOSTED_NIMBLE_HCI_VHCI=y

# Wi-Fi performance config
CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16
CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=64
CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=64
CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y
CONFIG_WIFI_RMT_TX_BA_WIN=32
CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y
CONFIG_WIFI_RMT_RX_BA_WIN=32

# LWIP performance config
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534
CONFIG_LWIP_TCP_WND_DEFAULT=65534
CONFIG_LWIP_TCP_RECVMBOX_SIZE=64
CONFIG_LWIP_UDP_RECVMBOX_SIZE=64
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64
CONFIG_LWIP_TCP_SACK_OUT=y
Loading