Chapter 2. API Reference
Provisioning Tools
Provisioning applications are available for various platforms, along with source code:
• Android:
– BLE Provisioning app on Play Store.
– SoftAP Provisioning app on Play Store.
– Source code on GitHub: esp-idf-provisioning-android.
• iOS:
– BLE Provisioning app on app store.
– SoftAP Provisioning app on app Store.
– Source code on GitHub: esp-idf-provisioning-ios.
• Linux/MacOS/Windows : tools/esp_prov (a python based command line tool for provisioning)
The phone applications offer simple UI and thus more user centric, while the command line application is useful as
a debugging tool for developers.
API Reference
Header File
• components/wifi_provisioning/include/wifi_provisioning/manager.h
Functions
esp_err_t wifi_prov_mgr_init(wifi_prov_mgr_config_t config)
Initialize provisioning manager instance.
Configures the manager and allocates internal resources
Configuration specifies the provisioning scheme (transport) and event handlers
Event WIFI_PROV_INIT is emitted right after initialization is complete
Return
• ESP_OK : Success
• ESP_FAIL : Fail
Parameters
• [in] config: Configuration structure
void wifi_prov_mgr_deinit(void)
Stop provisioning (if running) and release resource used by the manager.
Event WIFI_PROV_DEINIT is emitted right after de-initialization is finished
If provisioning service is still active when this API is called, it first stops the service, hence emitting
WIFI_PROV_END, and then performs the de-initialization
esp_err_t wifi_prov_mgr_is_provisioned(bool *provisioned)
Checks if device is provisioned.
This checks if Wi-Fi credentials are present on the NVS
The Wi-Fi credentials are assumed to be kept in the same NVS namespace as used by esp_wifi component
If one were to call esp_wifi_set_config() directly instead of going through the provisioning process, this function
will still yield true (i.e. device will be found to be provisioned)
Note Calling wifi_prov_mgr_start_provisioning() automatically resets the provision state, irrespective of what
the state was prior to making the call.
Return
• ESP_OK : Retrieved provision state successfully
• ESP_FAIL : Wi-Fi not initialized
• ESP_ERR_INVALID_ARG : Null argument supplied
• ESP_ERR_INVALID_STATE : Manager not initialized
Parameters
Espressif Systems 685
Submit Document Feedback
Release v4.4