How to re-provision ESP for new Wi-Fi credentials

sameer_kelaskar
Posts: 7
Joined: Mon Apr 24, 2023 4:36 pm

How to re-provision ESP for new Wi-Fi credentials

Postby sameer_kelaskar » Tue Sep 26, 2023 11:33 am

Hi,
We are trying to use ble reprovisioning for ESP32 devkit v1 and to flash the code we are using ESP-IDF v4.3.2 . Now the ESP documentation is as follows:
If the provisioning state needs to be reset, any of the following approaches may be taken:

1. The associated part of NVS partition has to be erased manually

2. The main application must implement some logic to call esp_wifi_ APIs for erasing the credentials at runtime

3. The main application must implement some logic to force start the provisioning irrespective of the provisioning state
So for the first part we use the nvs funtions : nvs_open, nvs_erase_all, nvs_commit and nvs_close.
Then using esp_wifi_set_config we use an empty wifi_config_t
After that we disconnect the wifi, initialize a new provisioning configuration and start provisioning once again using wifi_prov_mgr_start_provisioning() and new parameter arguments required for it.
But there are errors when we flash and monitor as shown in image:

Please let us know if this approach in proper, any help is appreciated.

Thank you,
Sameer
Attachments
esp_reprovision_error02_a.jpg
esp_reprovision_error02_a.jpg (184.32 KiB) Viewed 962 times

Who is online

Users browsing this forum: Google [Bot] and 98 guests