You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to remove all saved network credentials and start Bluetooth LE advertising once fabric removal request is received from Matter controller. The device shoyld remove all saved network credentials and only keep application-specific non-volatile data? How to achieve this with esp-matter APIs?
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Remove all network credentials and last fabric infromation once fabric removal request received from Controller
Remove all network credentials and last fabric infromation once fabric removal request received from Controller (CON-1404)
Nov 4, 2024
@bilalmalik76 To address your requirements for removing network credentials and re-enabling commissioning, there are two approaches to consider:
Direct factory reset upon receiving the kFabricRemoved event. However, this method will clear all data from nvs partition and "esp_matter_kvs" namespace after factory reset. esp_matter::factory_reset()
You can follow these steps to keep application-specific data irrespective of namespace
Step 1: Use the esp_wifi_restore() API to reset the Wi-Fi stack to its default values
Step 2: Reopen the commissioning window and restart BLE advertising to allow re-commissioning. chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow();
Step 3: Reboot the device esp_restart()
You can take reference from this code snippet:
case chip::DeviceLayer::DeviceEventType::kFabricRemoved:
{
ESP_LOGI(TAG, "Fabric removed successfully");
esp_err_t err = esp_wifi_restore();
if (err != ESP_OK) {
ESP_LOGE(TAG, "Failed to restore wifi stack");
}
CHIP_ERROR error = chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow();
if (error != CHIP_NO_ERROR)
{
ESP_LOGE(TAG, "Failed to open commissioning window");
}
esp_restart();
break;
}
How to remove all saved network credentials and start Bluetooth LE advertising once fabric removal request is received from Matter controller. The device shoyld remove all saved network credentials and only keep application-specific non-volatile data? How to achieve this with esp-matter APIs?
The text was updated successfully, but these errors were encountered: