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

BLE-Thread Pairing Failure on nRF52840 DK for Matter Device Commissioning (Error: CHIP:0x00000032) (CON-1332) #1080

Open
vishnuprasadvp12345 opened this issue Sep 13, 2024 · 9 comments

Comments

@vishnuprasadvp12345
Copy link

vishnuprasadvp12345 commented Sep 13, 2024

Issue Description:

I am using the Matter ESP32 controller to commission a Thread device. The commissioning process works fine on the ESP32-C6-based device, but when I try to commission a Nordic nRF52840 DK running the Matter light Thread example, I get a BLE pairing failure with the following error:

<0x1b>[0;31mE (1337382) chip[BLE]: Failed to cancel connection rc=2<0x1b>[0m
<0x1b>[0;32mI (1337382) chip[DIS]: Closing all BLE connections<0x1b>[0m
<0x1b>[0;32mI (1337382) pairing_command: Pairing Failure: Matter-Error CHIP:0x00000032<0x1b>[0m
<0x1b>[0;31mE (1347602) chip[BLE]: GATT discovery failed; status:13<0x1b>[0m
<0x1b>[0;32mI (1347602) NimBLE: GAP procedure initiated: terminate connection; conn_handle=1 hci_reason=19
<0x1b>[0m
<0x1b>[0;32mI (1347672) chip[DL]: BLE GAP connection terminated (con 1 reason 0x216)<0x1b>[0m

command on the ESP32 Matter controller to commission the Thread device:
ble-thread 0x03 0e080000000000010000000300000f35060004001fffe00208fc4ce2fc3cb4228d0708fd595fb741bc308d0510043170cb1f8627587c836b640fefdc0f030f4f70656e5468726561642d663439310102f49104100b876026d280697e21a47e1bc95e96110c0402a0f7f8 20202021 3840
i use different node number to commission

@github-actions github-actions bot changed the title BLE-Thread Pairing Failure on nRF52840 DK for Matter Device Commissioning (Error: CHIP:0x00000032) BLE-Thread Pairing Failure on nRF52840 DK for Matter Device Commissioning (Error: CHIP:0x00000032) (CON-1332) Sep 13, 2024
@wqx6
Copy link
Contributor

wqx6 commented Sep 13, 2024

@vishnuprasadvp12345 Hi, Could you send the the complete logs of the controller, Thread BR, and nordic chip so that we can analyze the reason of this error?

@vishnuprasadvp12345
Copy link
Author

okke

@vishnuprasadvp12345
Copy link
Author

@wqx6
Copy link
Contributor

wqx6 commented Sep 14, 2024

Hi, I have tested the BLE pairing with the nrf52840 but found no issue. Could you also test the matter pairing with the nrf52840 using chip-tool?

@vishnuprasadvp12345
Copy link
Author

vishnuprasadvp12345 commented Sep 14, 2024

@wqx6 In the case of the ESP-C6 Thread example code, everything works fine. However, with the NRF Thread device, I repeatedly encounter the same error after multiple attempts. I am working with Thread device commissioning using the ESP controller, and I get this error during that process

E (1337382) chip[BLE]: Failed to cancel connection, rc=2
I (1337382) chip[DIS]: Closing all BLE connections
I (1337382) pairing_command: Pairing Failure: Matter-Error CHIP:0x00000032
E (1347602) chip[BLE]: GATT discovery failed; status: 13
I (1347602) NimBLE: GAP procedure initiated: terminating connection; conn_handle=1, hci_reason=19
I (1347672) chip[DL]: BLE GAP connection terminated (conn 1, reason 0x216)
im also using same nrf52840 board

@vishnuprasadvp12345
Copy link
Author

vishnuprasadvp12345 commented Sep 18, 2024

I checked the connection of the nRF52840 DK to the Google Hub, and it is working fine. However, I see an error in the ESP controller. How can I solve this error?

<0x1b>[0;32mI (138902) ROUTE_HOOK: Received RIO<0x1b>[0m
<0x1b>[0;32mI (138912) ROUTE_HOOK: prefix FD62:F584:3136:1:: lifetime 1800<0x1b>[0m
<0x1b>[0;31mE (147612) chip[BLE]: Failed to cancel connection rc=2<0x1b>[0m
<0x1b>[0;32mI (147612) chip[DIS]: Closing all BLE connections<0x1b>[0m
<0x1b>[0;32mI (147612) pairing_command: Pairing Failure: Matter-Error CHIP:0x00000032<0x1b>[0m
<0x1b>[0;31mE (157702) chip[BLE]: GATT discovery failed; status:13<0x1b>[0m
<0x1b>[0;32mI (157702) NimBLE: GAP procedure initiated: terminate connection; conn_handle=1 hci_reason=19
<0x1b>[0m
<0x1b>[0;32mI (157732) chip[DL]: BLE GAP connection terminated (con 1 reason 0x216)<0x1b>[0m

matter esp controller pairing ble-thread 0x01 0e080000000000010000000300000f35060004001fffe0020843e147d703597acc0708fdde41f81e84340105101f837282db4441eb581031b7e7f1d5bf030f4f70656e5468726561642d3761303301027a030410f63f2ca5c0381ac1aeb4194ab9720d9d0c0402a0f7f8 20202021 3840
any change this command i include

@wqx6
Copy link
Contributor

wqx6 commented Sep 20, 2024

Could you tell me the commit of esp-matter you are using for esp-controller? There were an issue for the ble controller in the nimble code and it was fixed in the latest esp-matter. You can try to update the code of HandleRxNotify() https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/nimble/BLEManagerImpl.cpp#L1749-L1756 and try again.

@vishnuprasadvp12345
Copy link
Author

vishnuprasadvp12345 commented Sep 20, 2024

commit f21874c

ESP-IDF v5.2.2-dirty

I am wondering why this error occurs only on the NRF side. I copied and pasted the mentioned Git line into the version I downloaded, or I copied all data from the BLEManagerImpl.cpp file to the version of BLEManagerImpl.cpp which method I use.

uint16_t dataLen = OS_MBUF_PKTLEN(ble_event->notify_rx.om);
System::PacketBufferHandle buf = System::PacketBufferHandle::New(dataLen, 0);
VerifyOrReturnError(!buf.IsNull(), CHIP_ERROR_NO_MEMORY);
VerifyOrReturnError(buf->AvailableDataLength() >= dataLen, CHIP_ERROR_BUFFER_TOO_SMALL);
ble_hs_mbuf_to_flat(ble_event->notify_rx.om, buf->Start(), dataLen, NULL);
buf->SetDataLength(dataLen);

ChipLogDetail(DeviceLayer, "Indication received, conn = %d", ble_event->notify_rx.co

I pasted this line of code into the version I am currently using, but I am still getting the same error as before

@vishnuprasadvp12345
Copy link
Author

ble error nrf.txt

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

2 participants