Giter VIP home page Giter VIP logo

Comments (22)

limpkin avatar limpkin commented on June 2, 2024

same issue confirmed on logitec keyboard craft, on bluez 5.55 compiled from source on ubuntu.
I'll try on another machine, in case it comes from the HW

from bluez.

limpkin avatar limpkin commented on June 2, 2024

So it doesn't seem like the pairing issue is related to the impossibility to read characteristics.
This issue was initially reported for a Linux OS running in a VM. When trying natively on a machine, the first pairing attempt does fail while the second goes through (somehow...).
The bluetooth dongle remains the same for both configurations..... odd.

from bluez.

Vudentz avatar Vudentz commented on June 2, 2024

@limpkin Can you collect the HCI trace using btmon? It seems very weird that it fails to pair sometimes and works in others, maybe the pairing agent is not responding in time and it timeouts for some reason. Btw, could you please inform how you are connecting to the device? Are you using bluetoothctl?

from bluez.

gearhead avatar gearhead commented on June 2, 2024

Just read on the mail list that a log is needed. Mine is attached
need to repeat the pair attempt many times until it pairs then I can trust and it works, the pairing is the painful part.
failed_keyboard_pair.txt

from bluez.

limpkin avatar limpkin commented on June 2, 2024

@gearhead thanks a lot for this... sorry we never got to.

from bluez.

gearhead avatar gearhead commented on June 2, 2024

Just compiled and installed 5.56 on arch and get the same result. many many attempts to pair and maybe if I am lucky it pairs. can I manually pair it (editing text files) until this gets resolved.

# pacman -Q | grep bluez
bluez 5.56-1
bluez-libs 5.56-1
bluez-tools 0.2.0-5
bluez-utils 5.56-1

from bluez.

Vudentz avatar Vudentz commented on June 2, 2024

Just read on the mail list that a log is needed. Mine is attached
need to repeat the pair attempt many times until it pairs then I can trust and it works, the pairing is the painful part.
failed_keyboard_pair.txt

This doesn't seems to be related to the original problem since this is actually paring over BR/EDR:

@ MGMT Event: Device Connected (0x000b) plen 47                                                                                                                          {0x0001} [hci0] 23.677411
        **BR/EDR** Address: 08:B7:38:11:A6:C2 (Lite-On Technogy Corp.)
        Flags: 0x00000000
        Data length: 34
        Name (complete): HP Bluetooth Keyboard K4000
        Class: 0x002540
          Major class: Peripheral (mouse, joystick, keyboards)
          Minor class: 0x10
          Limited Discoverable Mode

Or is the peripheral dual-mode or needs GATT over BR/EDR? Anyway for BR/EDR the pairing is actually handled by the link layer which is down in the controller firmware, perhaps you might want to try another controller to check if this is hardware specific error.

from bluez.

gearhead avatar gearhead commented on June 2, 2024

If I try pairing it to another controller, I loose this connection the need to spend another hour trying until it pairs? Seriously, this used to be easy. bluetoothctl, power on keyboard, put in pairing mode, default-agent, scan on, pair XXXXXXXX, trust XXXXXX done. What could have changed? Once paired, The /var/lib/bluetooth/xxx/xxx/info shows:

[General]
Name=HP Bluetooth Keyboard K4000
Class=0x000540
SupportedTechnologies=BR/EDR;
Trusted=true
Blocked=false
WakeAllowed=true
Services=00001000-0000-1000-8000-00805f9b34fb;00001124-0000-1000-8000-00805f>

[LinkKey]
Key=143AC49B423B2E0584298707A185D1C9
Type=5
PINLength=0

[DeviceID]
Source=2
Vendor=1226
Product=121
Version=1281

from bluez.

gearhead avatar gearhead commented on June 2, 2024

just tried it on an intel BT adapter on a computer running Arch Linux and have the same result. Repeated failure to pair. It asks for the 6 digit code, I type it in and it sits a while then finally says failed to pair. over and over again.

[bluetooth]# pair 08:B7:38:11:A6:C2
Attempting to pair with 08:B7:38:11:A6:C2
[CHG] Device 08:B7:38:11:A6:C2 Connected: yes
[agent] Passkey: 614594
[agent] Passkey: 614594
[agent] Passkey: 614594
[agent] Passkey: 614594
[agent] Passkey: 614594
[agent] Passkey: 614594
[agent] Passkey: 614594
[HP Bluetooth Keyboard K4000]#
Failed to pair: org.bluez.Error.AuthenticationFailed
[CHG] Device 08:B7:38:11:A6:C2 Connected: no

from bluez.

gearhead avatar gearhead commented on June 2, 2024

Should I open a new issue on this? It takes repeated attempts then eventually it pairs. As you can see, it will connect to allow me to type the code in, but then it waits a while end eventually says failed to pair. try again and again and again and finally success then I can trust and it works every time. It used to be one time and done.

from bluez.

gearhead avatar gearhead commented on June 2, 2024

please? It is maddening. over and over again and finally it pairs.... then it works fine until I have to pair it again. I do not know if it is the sheer number of tries or a random assortment of numbers that I type in, but it takes many many (maybe an hour of trying) and then it finally pairs. This should be easy. It took 27 attempts before I got the:

[bluetooth]# pair 08:B7:38:11:A6:C2
Attempting to pair with 08:B7:38:11:A6:C2
[CHG] Device 08:B7:38:11:A6:C2 Connected: yes
[agent] Passkey: 454835
[agent] Passkey: 454835
[agent] Passkey: 454835
[agent] Passkey: 454835
[agent] Passkey: 454835
[agent] Passkey: 454835
[agent] Passkey: 454835
[CHG] Device 08:B7:38:11:A6:C2 Modalias: usb:v04CAp0079d0501
[CHG] Device 08:B7:38:11:A6:C2 UUIDs: 00001000-0000-1000-8000-00805f9b34fb
[CHG] Device 08:B7:38:11:A6:C2 UUIDs: 00001124-0000-1000-8000-00805f9b34fb
[CHG] Device 08:B7:38:11:A6:C2 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 08:B7:38:11:A6:C2 ServicesResolved: yes
[CHG] Device 08:B7:38:11:A6:C2 Paired: yes
Pairing successful

from bluez.

limpkin avatar limpkin commented on June 2, 2024

so it does look this issue was fixed in one of these 3 commits as I was able to pair today and not with 5.58, building from source:
d971ca5
8f15296
b5b7e62

from bluez.

gearhead avatar gearhead commented on June 2, 2024

wish i could build it to test. I get this:

...
mesh-cfgtest.c:(.text+0x93c): undefined reference to `l_tester_get_stage'
/usr/bin/ld: tools/mesh-cfgtest.o:mesh-cfgtest.c:(.text+0x944): more undefined references to `l_tester_get_stage' follow
/usr/bin/ld: tools/mesh-cfgtest.o: in function `main':
mesh-cfgtest.c:(.text.startup+0x208): undefined reference to `l_tester_add_full'
/usr/bin/ld: mesh-cfgtest.c:(.text.startup+0x298): undefined reference to `l_tester_add_full'
collect2: error: ld returned 1 exit status
distcc[307515] ERROR: compile (null) on localhost failed
make[1]: *** [Makefile:5888: tools/mesh-cfgtest] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:4062: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

I had to wipe my image and after trying for 30 minutes, It will not re-pair. Grrr.

from bluez.

gearhead avatar gearhead commented on June 2, 2024

Just tried this and still get the same result. I built and installed ell-git and bluez-git on my target device (RPi b3+) and tried, again, to pair my keyboard and get:

[bluetooth]# pair 08:B7:38:11:A6:C2
Attempting to pair with 08:B7:38:11:A6:C2
[CHG] Device 08:B7:38:11:A6:C2 Connected: yes
[agent] Passkey: 457425
[agent] Passkey: 457425
[agent] Passkey: 457425
[agent] Passkey: 457425
[agent] Passkey: 457425
[agent] Passkey: 457425
[agent] Passkey: 457425
Failed to pair: org.bluez.Error.AuthenticationFailed
[CHG] Device 08:B7:38:11:A6:C2 Connected: no

Multiple attempts result in the same thing. I can type in the pass code and it responds when I do it, but it never pairs. I do not know if it has gotten worse, but I was able to pair it eventually and now I have tried repeatedly and get nothing. kernel 5.10.27

Just tried this with a different BT keyboard and get the same thing.

from bluez.

gearhead avatar gearhead commented on June 2, 2024

Still does not want to pair. Takes repeated attempts until it finally connects. This is on an RPi 3b+ running aarch64 kernel 5.10.36 and bluez 5.58 built from git with HEAD at 6a92290. If another scan is needed for information to fix this, please let me know. Very disappointing that I can connect a media device but not a simple keyboard.

from bluez.

macmpi avatar macmpi commented on June 2, 2024

have you tried if setting JustWorksRepairing=always in /etc/bluetooth/main.conf is of any help?

from bluez.

gearhead avatar gearhead commented on June 2, 2024

I tried the JustWorksRepairing=always and get the same result. It will not pair a keyboard. After I type in the code, it waits a bit then responds with the Auth Failed. This is with current broadcom firmware and bluez 5.51 or 5.58.

With current firmware and bluez 5.58, I can pair and connect and play from a phone and to a set of bluetooth headphones. I was able to build and install bluez 5.51 (5.50 would not build due to an ell function issue) and have the same result. I can pair and connect headphones and a phone, but not a keyboard. If I try many many times I can eventually get it to accept the code and pair. Please advise if there is anything else I can test.

from bluez.

gearhead avatar gearhead commented on June 2, 2024

Just tried with 5.59 which recently landed on Arch Arm. Same thing. The btmon log is attached.

What appears to be happening is my keys are not mapped correctly. the code is 513160 and I entered this. Is th4ere some strange hex to dec conversion issue? 7d488 is indeed 513160 and btmon recorded all my key presses. I have tried this again and get the same thing. This used to work. Is it a driver issue?

[bluetooth]# pair  A4:9A:58:6C:BE:7A
Attempting to pair with A4:9A:58:6C:BE:7A
[CHG] Device A4:9A:58:6C:BE:7A Connected: yes
[agent] Passkey: 513160
[agent] Passkey: 513160
[agent] Passkey: 513160
[agent] Passkey: 513160
[agent] Passkey: 513160
[agent] Passkey: 513160
[agent] Passkey: 513160
[DEL] Device 08:62:66:E1:82:18 Nexus Player
[CHG] Controller 43:45:C0:00:1F:AC Discoverable: no
Failed to pair: org.bluez.Error.AuthenticationFailed
[CHG] Device A4:9A:58:6C:BE:7A Connected: no

btmon_.5.59.log

My dmesg:

root@rune64(rw):~# dmesg | grep Blue
[    6.886662] Bluetooth: Core ver 2.22
[    6.886763] Bluetooth: HCI device and connection manager initialized
[    6.886782] Bluetooth: HCI socket layer initialized
[    6.886792] Bluetooth: L2CAP socket layer initialized
[    6.886811] Bluetooth: SCO socket layer initialized
[    6.919426] Bluetooth: HCI UART driver ver 2.3
[    6.919439] Bluetooth: HCI UART protocol H4 registered
[    6.919444] Bluetooth: HCI UART protocol BCSP registered
[    6.919550] Bluetooth: HCI UART protocol LL registered
[    6.919556] Bluetooth: HCI UART protocol ATH3K registered
[    6.919599] Bluetooth: HCI UART protocol Three-wire (H5) registered
[    6.919775] Bluetooth: HCI UART protocol Broadcom registered
[    7.290597] Bluetooth: hci0: BCM: chip id 107
[    7.290942] Bluetooth: hci0: BCM: features 0x2f
[    7.292120] Bluetooth: hci0: BCM4345C0
[    7.292138] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0000
[    7.301032] Bluetooth: hci0: BCM4345C0 'brcm/BCM4345C0.hcd' Patch
[    8.019719] Bluetooth: hci0: BCM43455 37.4MHz Raspberry Pi 3+
[    8.019738] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0342
[    9.428299] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    9.428311] Bluetooth: BNEP filters: protocol multicast
[    9.428329] Bluetooth: BNEP socket layer initialized
[   10.279977] Bluetooth: RFCOMM TTY layer initialized
[   10.280023] Bluetooth: RFCOMM socket layer initialized
[   10.280052] Bluetooth: RFCOMM ver 1.11

from bluez.

Vudentz avatar Vudentz commented on June 2, 2024
> HCI Event: User Passkey Notification (0x3b) plen 10       #24 [hci0] 7.453183
        Address: A4:9A:58:6C:BE:7A (Samsung Electronics Co.,Ltd)
        Passkey: 513160
@ MGMT Event: Passkey Notify (0x0017) plen 12          {0x0001} [hci0] 7.453238
        BR/EDR Address: A4:9A:58:6C:BE:7A (Samsung Electronics Co.,Ltd)
        Passkey: 0x0007d488
        Entered: 0
> HCI Event: Keypress Notification (0x3c) plen 7            #25 [hci0] 7.456309
        Address: A4:9A:58:6C:BE:7A (Samsung Electronics Co.,Ltd)
        Notification type: Passkey entry started (0x00)
> HCI Event: Keypress Notification (0x3c) plen 7           #26 [hci0] 11.727688
        Address: A4:9A:58:6C:BE:7A (Samsung Electronics Co.,Ltd)
        Notification type: Passkey digit entered (0x01)
@ MGMT Event: Passkey Notify (0x0017) plen 12         {0x0001} [hci0] 11.727743
        BR/EDR Address: A4:9A:58:6C:BE:7A (Samsung Electronics Co.,Ltd)
        Passkey: 0x0007d488
        Entered: 1
> HCI Event: Keypress Notification (0x3c) plen 7           #27 [hci0] 11.960225
        Address: A4:9A:58:6C:BE:7A (Samsung Electronics Co.,Ltd)
        Notification type: Passkey digit entered (0x01)
@ MGMT Event: Passkey Notify (0x0017) plen 12         {0x0001} [hci0] 11.960289
        BR/EDR Address: A4:9A:58:6C:BE:7A (Samsung Electronics Co.,Ltd)
        Passkey: 0x0007d488
        Entered: 2
> HCI Event: Keypress Notification (0x3c) plen 7           #28 [hci0] 12.242704
        Address: A4:9A:58:6C:BE:7A (Samsung Electronics Co.,Ltd)
        Notification type: Passkey digit entered (0x01)
@ MGMT Event: Passkey Notify (0x0017) plen 12         {0x0001} [hci0] 12.242755
        BR/EDR Address: A4:9A:58:6C:BE:7A (Samsung Electronics Co.,Ltd)
        Passkey: 0x0007d488
        Entered: 3
> HCI Event: Keypress Notification (0x3c) plen 7           #29 [hci0] 12.510204
        Address: A4:9A:58:6C:BE:7A (Samsung Electronics Co.,Ltd)
        Notification type: Passkey digit entered (0x01)
@ MGMT Event: Passkey Notify (0x0017) plen 12         {0x0001} [hci0] 12.510262
        BR/EDR Address: A4:9A:58:6C:BE:7A (Samsung Electronics Co.,Ltd)
        Passkey: 0x0007d488
        Entered: 4
> HCI Event: Keypress Notification (0x3c) plen 7           #30 [hci0] 13.307712
        Address: A4:9A:58:6C:BE:7A (Samsung Electronics Co.,Ltd)
        Notification type: Passkey digit entered (0x01)
@ MGMT Event: Passkey Notify (0x0017) plen 12         {0x0001} [hci0] 13.307772
        BR/EDR Address: A4:9A:58:6C:BE:7A (Samsung Electronics Co.,Ltd)
        Passkey: 0x0007d488
        Entered: 5
> HCI Event: Keypress Notification (0x3c) plen 7           #31 [hci0] 13.490239
        Address: A4:9A:58:6C:BE:7A (Samsung Electronics Co.,Ltd)
        Notification type: Passkey digit entered (0x01)
@ MGMT Event: Passkey Notify (0x0017) plen 12         {0x0001} [hci0] 13.490335
        BR/EDR Address: A4:9A:58:6C:BE:7A (Samsung Electronics Co.,Ltd)
        Passkey: 0x0007d488
        Entered: 6

It looks like there are 7 keys entered, not sure if the last one was enter key but it does seem to cause another key press, not sure if that is actually causing the problem or not.

from bluez.

Vudentz avatar Vudentz commented on June 2, 2024

@gearhead This is not even the same problem as the original one is a LE(HoG) and this is using classic HID, please create another issue, also paring with classic devices is down to the link layer which is part of the controller firmware, so there is probably nothing we can in the host.

from bluez.

gearhead avatar gearhead commented on June 2, 2024

I finally figured out what is going on here. When pairing it asks for the 6 digits but does not ask for a Return. I was not typing a 'Return' so it waited then timed out before checking that I had typed the 6 digits correctly. When I type a return (My Windows machine prompted me for that but Linux does not) after the 6 digits, it pairs immediately.

from bluez.

Vudentz avatar Vudentz commented on June 2, 2024

I finally figured out what is going on here. When pairing it asks for the 6 digits but does not ask for a Return. I was not typing a 'Return' so it waited then timed out before checking that I had typed the 6 digits correctly. When I type a return (My Windows machine prompted me for that but Linux does not) after the 6 digits, it pairs immediately.

Interesting, so the windows does track down how many keys has been entered and then wroks the user to push enter? Perhaps this would be a good idea to be added to bluetoothctl, gnome, etc.

from bluez.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.