Join Wi-Fi
Wi-Fi Provisioning
How a production unit receives its SSID. Required to ship.
Join Wi-Fi
First-time Wi-Fi setupPhone connects in
ESP32 Wi-Fi parts
Official path: examples/provisioning/wifi_prov_mgr
01 Overview
Official provisioning manager that can deliver Wi-Fi credentials to the device over BLE or SoftAP.
Solves the out-of-box experience: users can provision without a PC or serial cable, just a phone.
Ideal for consumer, commercial, and industrial devices like smart home gadgets, sensors, and gateways.
Not for lab prototypes with hardcoded credentials; skip provisioning in that case.
Supports multiple transports, allowing flexibility to choose BLE or SoftAP, and can be extended.
02 Hardware
- MCU: ESP32 series with BLE support (e.g., ESP32, ESP32-S3); ESP32-S2 lacks BLE, so only SoftAP works.
- Power: 3.3V supply, mind peak current, add decoupling capacitors.
- Button: Add a GPIO button to trigger provisioning or reset credentials.
- LED: Add a status LED to indicate provisioning state (e.g., fast blink = waiting).
- Antenna: Keep antenna area clear of metal for good Wi-Fi/BLE performance.
- Connector: If using external antenna, use IPEX connector with impedance matching.
- Reset: Ensure reliable reset circuit on EN pin for factory reset capability.
03 Software flow
1. Initialize NVS to store provisioning data.
2. Start Wi-Fi and BLE (if using BLE transport) or SoftAP.
3. Call esp_wifi_prov_mgr_start_provisioning(), selecting transport and security scheme.
4. Phone app sends SSID/password via BLE GATT or SoftAP HTTP.
5. On success, prov manager saves credentials to NVS and stops provisioning service.
6. After reboot, device reads NVS and auto-connects to Wi-Fi.
7. If connection fails or re-provisioning is needed, trigger via button or command.
8. Handle timeouts and errors, provide user feedback (e.g., LED patterns).
04 Core points
- No provisioning, no shippable Wi-Fi product.
- Security: Enable secure provisioning (e.g., SRP) in production to prevent credential leakage.
- NVS corruption: Handle NVS corruption gracefully; provide re-provisioning mechanism.
- BLE coexistence: If device uses BLE for other purposes, allocate resources carefully to avoid conflicts.
- Custom work: App protocol, reset logic, share with GATT.
- Testing: Cover success, failure, timeout, and re-provisioning scenarios.