When BLE is paired, advertising cannot be restarted

Hi,

After updating to NCS 2.9.0, I found that if the device is already paired, advertising cannot be started. I have configured CONFIG_BT_MAX_CONN=3.

E: Failed to start advertiser
E: Failed to start BLE advertising: -12
E: Could not start BLE advertising

Parents
  • Hello,

    It is difficult to say without more context. What function returned the value -12? Are you doing normal BLE advertising, or do you have some other radio protocol as well?

    Does your build log say anything that would suggest that the CONFIG_BT_MAX_CONN is not set to 3?

    Do you support scanning/central? CONFIG_BT_CENTRAL=y?

    If so, you also need to specify:

    CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=2

    or whatever value you want it to be. It will default to 1 if CONFIG_BT_CENTRAL is set to y.

    Best regards,

    Edvin

  • Hi,

    Basically, my BLE service is built based on NUS. So it's just normal advertising. What other information do you need to diagnose the issue? By the way, I don't need the CENTRAL role.

    bool BleService::StartAdvertising() {
      if (madvStarted) {    
        LOG_INF("BLE advertising is already started");
        return false;
      }
    
      CHIP_ERROR ret = BLEAdvertisingArbiter::InsertRequest(mAdvertisingRequest);
            
      if (CHIP_NO_ERROR != ret) {
        LOG_ERR("Could not start BLE advertising");
        return false;
      }
      madvStarted = true;
    
      LOG_INF("BLE advertising has started");
      return true;
    }

  • Edvin said:

    Are you doing normal BLE advertising, or do you have some other radio protocol as well?

    So you are using Matter, right? Is that intentional, or did you choose this application because it was using C++?

  • Hi,

    Yes, the example I used is NCS 2.9.0 Matter Lock. The expected state is Matter + BLE + multiple-to-one connection.

Reply Children
Related