raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/
Other
10.87k stars 4.89k forks source link

Error pairing with Secure Simple Pairing (SSP) disabled #3119

Open Douglas6 opened 4 years ago

Douglas6 commented 4 years ago

There seems to be a problem with Bluetooth pairing when Secure Simple Pairing is disabled. Several posts on this forum alerted me to the problem (which I can verify): https://www.raspberrypi.org/forums/view ... 9&t=195090 and https://www.raspberrypi.org/forums/view ... 8&t=244241.

To reproduce the issue:

Flash the latest Buster full image and upgrade as of today. Disable SSP with 'sudo hciconfig hci0 sspmode 0' Enter bluetoothctl and make the Pi discoverable. Attempt to pair from another device (I used an Android phone running Pie, ironically.) No joy. An hcidump transcription goes like this:

HCI sniffer - Bluetooth packet analyzer ver 5.50 device: hci0 snap_len: 1500 filter: 0xffffffff

HCI Event: Command Complete (0x0e) plen 4 Write Simple Pairing Mode (0x03|0x0056) ncmd 1 status 0x00 HCI Event: Command Complete (0x0e) plen 4 Write Current IAC LAP (0x03|0x003a) ncmd 1 status 0x00 HCI Event: Command Complete (0x0e) plen 4 Write Scan Enable (0x03|0x001a) ncmd 1 status 0x00 HCI Event: Connect Request (0x04) plen 10 bdaddr 0C:CB:85:0D:6B:AB class 0x5a020c type ACL HCI Event: Command Status (0x0f) plen 4 Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1 HCI Event: Command Complete (0x0e) plen 10 PIN Code Request Negative Reply (0x01|0x000e) ncmd 1 status 0x00 bdaddr 0C:CB:85:0D:6B:AB HCI Event: Connect Complete (0x03) plen 11 status 0x18 handle 12 bdaddr 0C:CB:85:0D:6B:AB type ACL encrypt 0x00 Error: Pairing Not Allowed

Attempts with a dongle that does not support SSP worked fine, which is why I suspect Raspbian rather than BlueZ (as well as the lack of outcry from other distros).

pi@raspberrypi:~ $ cat /etc/rpi-issue Raspberry Pi reference 2019-07-10 Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 175dfb027ffabd4b8d5080097af0e51ed9a4a56c, stage4 pi@raspberrypi:~ $ vcgencmd version Jul 9 2019 14:40:53 Copyright (c) 2012 Broadcom version 6c3fe3f096a93de3b34252ad98cdccadeb534be2 (clean) (release) (start) pi@raspberrypi:~ $ uname -a Linux raspberrypi 4.19.58-v7+ #1245 SMP Fri Jul 12 17:25:51 BST 2019 armv7l GNU/Linux

mcavalcantib commented 4 years ago

Same here!

sakthivelj commented 3 years ago

same here also, anyone found an alternative solution for PIN pair?. I am using raspberry PI 4 b and android 10

baderas commented 3 years ago

Can confirm, same happens on the raspberry pi 3 b

bhaumik90 commented 3 years ago

Facing same issue with RPi 3 and Android 10. However, I was able to connect iPhone to the RPi.

ThibautPlg commented 1 year ago

Any news on this subject ? I have the same problem here with a Pi4 and Android12. Bluetooth through my linux desktop worked on first try. Seems like a Android related issue.

Christiancoding commented 1 month ago

I found this: https://www.youtube.com/watch?v=lxmLorWYE-c After making it look like this, it worked: ssp_command = ["sudo", "hciconfig", self.iface, "sspmode"]