BLE connection failing when PIN pairing is required

Which version of system do you use? Khadas official images, self built images, or others?

Kahads official

Please describe your issue below:

BLE (Extended PHY) connection is not working when it requires PIN based pairing. We are using nordic NRFConnect app

Post a console log of your issue below:

GATT 133 error

@pbokinala What conditions do we need to reproduce the problem you mentioned? Can you grab a logcat corresponding to the problem and give it to us?

You need a bluetooth device that requires “pairing by pin” (passcode, pin code, pin number, password, etc). You can use “nRF Connect for Mobile” app to test this issue.
Install the app and scan for devices, you can filter them by name or MAC and once device is found, try to connect to it.
Using Khadas VIM4 (vim4-android-11-64bit-v221228.raw.img.xz), can’t connect and eventually get Error 133: gatt error.
Using mobile a phone (ie. TCL30se, Android 12, Kernel 4.19.188) can connect OK.
Here are logcats and images.
Can you help? Thanks.

@Orlando What is your Bluetooth device specifically? Also, please capture the logcat log and btsnoop log. Before grabbing the log, execute the following command:

C:\Users\25348>adb shell
VIM4:/ $ su
VIM4:/ # setprop persist.bluetooth.btsnoopenable true
VIM4:/ # setprop persist.bluetooth.btsnooplogmode full
VIM4:/ # setprop persist.bluetooth.btsnoopdefaultmode full
VIM4:/ # setprop persist.bluetooth.btsnoopsize 0xfffffff
VIM4:/ # setprop persist.bluetooth.btsnooppath /data/misc/bluetooth/logs/btsnoop_hci.log
VIM4:/ # svc bluetooth disable && svc bluetooth enable
VIM4:/ # exit
VIM4:/ $ exit

C:\Users\25348>adb logcat > logcat.log

Then reproduce the problem. Pull out the btsnoop log.

C:\Users\25348>adb pull /data/misc/bluetooth/logs/btsnoop_hci.log .

Finally, send out the corresponding logcat.log and btsnoop_hci.log files.

Ok, the device I’m using is a Bluetooth 5.3 radio from Nordic Semiconductor: nRF52840

I was looking for a commercial product that uses BT pairing by pin, to reproduce the issue on a common product but I can’t find one, it seems most devices just pair without pin/passcode/password.

As you mentioned, I captured the logcat log and btsnoop log are uploaded here.

I can’t capture the equivalent logs on the mobile phone that works (TCL30se phone) because it is production, so I can’t root it. But maybe you can get some info from the logs on Khadas Vim4, please let me know your comments, thanks.

1 Like

@Orlando Log information feedback: It seems that there is no broadcast package across from the other side that cannot be connected, and the signal is also weak during scanning. I wonder if there is an antenna connected? Could you take a photo to check the WiFi Bluetooth antenna on the board?