G2 Bluetooth and Subsurface on Arch

Linus Torvalds torvalds at linux-foundation.org
Thu Oct 12 14:11:29 PDT 2017


On Thu, Oct 12, 2017 at 1:53 PM, Pedro Neves <nevesdiver at gmail.com> wrote:
>
> I did the re-pairing and tried the download again:

Ok, this looks much better.

> connected to the controller for device 00:13:43:54:88:8D
>   .. discovering services

Now it's connecting, and correctly finding the services.

>  .. discovering details
> qt.bluetooth.bluez: Received size: 23 data:
> "0915380012390068af729e876212813d499ceaf0680caa"
> qt.bluetooth.bluez: Found handle: 38 properties: QFlags(0x2|0x10) value
> handle: 39 uuid: "{aa0c68f0-ea9c-493d-8112-62879e72af68}"
> qt.bluetooth.bluez: Sending read_by_type request, startHandle: 39 endHandle:
> 3a type: 2803 packet: "0839003a000328"
> qt.bluetooth.bluez: Received size: 5 data: "010839000a"
> qt.bluetooth.bluez: Error1: "no attribute in given range found" last command: 8 handle: 39
> qt.bluetooth.bluez: Reading all characteristic values for
> "{fdcdeaaa-295d-470e-bf15-04217b7aa0a0}"
> qt.bluetooth.bluez: Received size: 5 data: "010a390005"
> qt.bluetooth.bluez: Error1: "needs authentication - permissions" last command: a handle: 39
> qt.bluetooth.bluez: Requesting encrypted link
> qt.bluetooth.bluez: Setting new l2cp sec level: 3
> qt.bluetooth.bluez: HCI event triggered, type: 5
> qt.bluetooth.bluez: void QBluetoothSocketPrivate::_q_readNotify() 17 error: -1 "Connection reset by peer"
>     "{a188b7dd-debb-449a-852d-c243d46b4b1a}"
>     "{aa0c68f0-ea9c-493d-8112-62879e72af68}"
> failed to find suitable service on 00:13:43:54:88:8D

Hmm. That "Connection reset by peer" shouldn't happen, and I think
that's the problem here, it results in us not seeing the descriptors.

That sequence after the "needs authentication" *should* look like this:

qt.bluetooth.bluez: Requesting encrypted link
qt.bluetooth.bluez: Setting new l2cp sec level: 3
qt.bluetooth.bluez: HCI event triggered, type: f
qt.bluetooth.bluez: HCI event triggered, type: 8
qt.bluetooth.bluez: HCI Encrypt change, status: Success handle: 40 encrypt: 1
qt.bluetooth.bluez: Current l2cp sec level: 3
qt.bluetooth.bluez: Received size: 2 data: "0b00"
qt.bluetooth.bluez: Discovering descriptor values for
"{fdcdeaaa-295d-470e-bf15-04217b7aa0a0}"
qt.bluetooth.bluez: Sending find_info request (36, 38) 36
qt.bluetooth.bluez: Received size: 6 data: "050136000328"
qt.bluetooth.bluez: Suppressing primary/characteristic 2803
qt.bluetooth.bluez: Sending find_info request (36, 38) 37
qt.bluetooth.bluez: Received size: 20 data:
"050237001a4b6bd443c22d859a44bbdeddb788a1"
qt.bluetooth.bluez: Suppressing char handle 37
qt.bluetooth.bluez: Sending find_info request (38) 38
qt.bluetooth.bluez: Received size: 6 data: "050138000328"
qt.bluetooth.bluez: Suppressing primary/characteristic 2803
qt.bluetooth.bluez: Sending find_info request (38) 39
qt.bluetooth.bluez: Received size: 20 data:
"0502390068af729e876212813d499ceaf0680caa"
qt.bluetooth.bluez: Suppressing char handle 39
qt.bluetooth.bluez: Sending find_info request (38) 3a
qt.bluetooth.bluez: Received size: 6 data: "05013a000229"
qt.bluetooth.bluez: Descriptor found, uuid:
"{00002902-0000-1000-8000-00805f9b34fb}" descriptor handle: 3a
qt.bluetooth.bluez: Reading all descriptor values for
"{fdcdeaaa-295d-470e-bf15-04217b7aa0a0}"
qt.bluetooth.bluez: Received size: 3 data: "0b0000"
    "{a188b7dd-debb-449a-852d-c243d46b4b1a}"
    "{aa0c68f0-ea9c-493d-8112-62879e72af68}"
 .. enabling notifications
Descriptor list with 1 elements
Descriptor: "Client Characteristic Configuration" uuid:
"{00002902-0000-1000-8000-00805f9b34fb}"
now writing "0x0100" to the descriptor "{00002902-0000-1000-8000-00805f9b34fb}"
qt.bluetooth.bluez: Writing descriptor 3a (size: 5 )
qt.bluetooth.bluez: Writing characteristic 36 (size: 5 with response:
true signed: false )
qt.bluetooth.bluez: Received size: 1 data: "13"
... actual data download continues here ..

> Any hints?

So I'd worry about two things:

 - older subsurface with older Qt library. That 4.6.4-720 thing is
from early August, and so it was built with the hacked-up Qt libraries
from before the 5.9.2 release. It might be missing some of the
required patches.

 - older bluez code. I don't know what version Arch is on.

I have my own self-built subsurface with my own self-built Qt-5.9
branch etc, I don't know if Dirk has newer Linux binaries anywhere..

                 Linus


More information about the subsurface mailing list