Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommissioning Fails After First Successful Commissioning – Device Not Found Until Network is Manually Changed (CON-1532) #1262

Open
Lenin-Weinkling opened this issue Jan 29, 2025 · 3 comments

Comments

@Lenin-Weinkling
Copy link

Lenin-Weinkling commented Jan 29, 2025

After commissioning my device successfully using the commissioning window, I attempted to change the network credentials by recommissioning the device from the Google Home app. However, the commissioning process gets stuck at "Searching for device" until I manually switch my network back to the previously commissioned one.

Steps to Reproduce:

  1. Press the button to open the commissioning window using the function below:

void OpenCommissioningWindow()
{
PlatformMgr().ScheduleWork([](intptr_t arg) {

    ConnectivityMgr().SetBLEAdvertisingEnabled(true);

    uint16_t timeout = static_cast<uint16_t>(arg);

    CHIP_ERROR err = Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow(
        System::Clock::Seconds32(timeout),
        chip::CommissioningWindowAdvertisement::kAllSupported
    );

    if (err == CHIP_NO_ERROR) {
        ChipLogProgress(AppServer, "Commissioning window opened successfully for %d seconds.", timeout);
    } else {
        ChipLogError(AppServer, "Failed to open commissioning window: %s", ErrorStr(err));
    }
}, static_cast<intptr_t>(300));

}

  1. Commission the device successfully to a Wi-Fi network.
  2. Try to change the network credentials by recommissioning the device using the Google Home app.
  3. Observe that the commissioning process gets stuck on "Searching for device."
  4. The device only becomes discoverable again if I manually switch my network back to the previously commissioned one.
@github-actions github-actions bot changed the title Recommissioning Fails After First Successful Commissioning – Device Not Found Until Network is Manually Changed Recommissioning Fails After First Successful Commissioning – Device Not Found Until Network is Manually Changed (CON-1532) Jan 29, 2025
@wqx6
Copy link
Contributor

wqx6 commented Mar 7, 2025

You cannot change the network that the end-device connects by recommissioning as the BLE will not advertise commissionable service after the first commissioning. The only way to change the network is:

  1. Send ArmFailSafe command of GeneralCommissioning cluster to the end-device
  2. Send RemoveNetwork command of NetworkCommissioning cluster to the end-device
  3. Send AddOrUpdateWifiNetwork command of NetworkCommissioning cluster to the end-device with the new network info
  4. Send ConnectNetwork command of NetworkCommissioning cluster to the end-device so that the device will connect to the new network.
  5. Send CommissionComplete command of GeneralCommissioning cluster to the end-device

For more details, you can refer the the NetworkCommissioning Test Case [TC-CNET-4.11] in MatterTestPlans document.

@dhrishi
Copy link
Collaborator

dhrishi commented Mar 11, 2025

@Lenin-Weinkling Please check if your question is answered

@Lenin-Weinkling
Copy link
Author

Thank you for your detailed response! I’m working on developing a Matter product and using apps like Google Home, Alexa, and HomeKit for commissioning. I was able to re-enable BLE commissioning by setting CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=n, and now the BLE advertising for commissioning shows up even after the first commissioning. However, I’m still facing an issue where the device setup fails during connection to the new network during recommissioning. It seems the only way to successfully recommission to a new network is by performing a factory reset on the esp-matter.

Is there any way to solve this without requiring a factory reset? I’d like to allow users to change network credentials seamlessly through the apps without losing other settings. Any guidance would be greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants