Files
micheleandClaude Sonnet 5 74c40ee986 Add BLE Wi-Fi provisioning alongside the setup SoftAP
Wraps ESP-IDF's official wifi_provisioning manager (BLE transport,
protocomm Security1, NimBLE host) so a phone can join the device to
Wi-Fi over the ESP32-S3's own onboard BLE radio, without first
connecting to the 192.168.4.1 SoftAP. Chosen over a custom GATT
service specifically so the existing generic "ESP BLE Provisioning"
iOS/Android apps work today, before the dedicated DigiRadio app
exists — same standard protocol either app would speak.

net::ble_provisioning::start() is additive, not a replacement: it
runs next to the current SoftAP + POST /api/wifi HTTP route inside
NetBootstrap's startSetupMode(), and failing to start it is
non-fatal (same pattern already used there for the SigmaStudio TCP
bridge) — SoftAP setup keeps working either way. Proof-of-possession
is the device's own serial number (same source as the SoftAP SSID),
so pairing requires reading it off the unit rather than being wide
open. On WIFI_PROV_CRED_SUCCESS the received wifi_sta_config_t is
converted to the same core::WifiCredentials type the HTTP handler
uses and saved through the same ISecureStore, then the device
reboots into STA mode — one persistence path regardless of which
transport provisioned it.

BT1035 is unaffected: it's a separate UART-attached classic
Bluetooth module for A2DP output. This uses the ESP32-S3's
independent internal BLE controller, switched to NimBLE (smaller
footprint than Bluedroid, the only host stack needed for a single
peripheral-role GATT service). App binary still has 33% free flash
after pulling in wifi_provisioning/protocomm/NimBLE.

Verified: idf.py build, doxygen (0 warnings), check-manual-sync,
check_si4684_blobs, ctest (19/19) all green. Not yet tested with a
real BLE provisioning app or on hardware — board is disconnected
this session.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178rASQ6ZETPMUamvpoR2KR
2026-08-18 08:19:02 +02:00

38 lines
1.5 KiB
Plaintext

# DigiRadio — default Kconfig (development / first-board bring-up)
# NVS + flash encryption intentionally OFF for Si4684 bring-up (do not re-enable
# without idf.py erase-flash and docs/security-flash-nvs.md migration).
# Production overlay: sdkconfig.defaults.production (not used on current boards).
CONFIG_IDF_TARGET="esp32s3"
# Custom partition table (nvs, otadata, OTA slots, dsp blob, nvs_keys)
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
# OTA rollback: mark app valid only after esp_ota_mark_app_valid_cancel_rollback()
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
# Flash encryption — DEVELOPMENT mode (re-flash plaintext until eFuse policy set)
# CONFIG_SECURE_FLASH_ENC_ENABLED=y
# CONFIG_SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT=y
# NVS encryption at rest (XTS-AES; keys in nvs_keys, protected by flash encryption)
# CONFIG_NVS_ENCRYPTION=y
# C++23, exceptions and RTTI off (AGENTS.md §2)
CONFIG_COMPILER_CXX_EXCEPTIONS=n
CONFIG_COMPILER_CXX_RTTI=n
CONFIG_COMPILER_CXX_STD=23
# Logging
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192
# Onboard BLE for wifi_provisioning (net/BleProvisioning.cpp) — the ESP32-S3's
# own radio, independent of the BT1035 UART module which stays classic-A2DP-only.
# NimBLE instead of Bluedroid: smaller flash/RAM footprint, and the only host
# stack this firmware needs is a single GATT peripheral role for provisioning.
CONFIG_BT_ENABLED=y
CONFIG_BT_NIMBLE_ENABLED=y