Closed h0bb3 closed 9 months ago
The programmatic way is probably the best as we can be more flexible and no need to mess around with docker container changes. The problem is that this is hidden behind the layers of bless somewhere and could require us to change things in bless or work around this in some way.
Here is an alternate ble docker that seems to work:
FROM python:3.12.1-bullseye
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get install -y build-essential bluetooth libdbus-1-dev libgirepository1.0-dev libudev-dev libical-dev
RUN apt-get install -y libcairo2-dev
#RUN apt-get install -y glib
#RUN apt-get install -y python3-pip
#RUN apt-get install -y python3-venv
ENV DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket
WORKDIR /code
COPY requirements.txt requirements.txt
# this is needed as packages are now installed in the venv
ENV PATH="/code/venv/bin:$PATH"
ENV PKG_CONFIG_PATH="/code/venv/lib/pkgconfig:$PKG_CONFIG_PATH"
RUN python3 -m venv /code/venv
RUN /code/venv/bin/pip install -r requirements.txt
RUN /code/venv/bin/pip install dbus-python pycairo PyGObject
RUN /code/venv/bin/pip install python-networkmanager
COPY . .
ENTRYPOINT sh docker_entrypoint.sh
leaving this here as I spent most of the day getting it to work. But then it turned out to be a balena flag in the compose that was needed:
io.balena.features.kernel-modules: 1
should be set to 1 if we want to access the hci0
stuff as per above...
The ble container could probably need some slimming as it is 1GB in size compared to the web that is 375MB and does a hell of a lot more...
Spent a lot of time experimenting. Alas no real progress what ha been tried is setting of hci0 parameters:
adv_channel_map
adv_min_interval
adv_max_interval
conn_min_interval
conn_max_interval
This has possibly helped in the gw showing up faster in the pairing dialog. But not much else.
I have tried the basic example from bless, and also implemented a new version based on Nebras ble implementation (based on this repo https://github.com/Douglas6/cputemp)
One hypothesis was that the characteristics needed proper descriptors and this could not be set easily in bless. But that also did nothing.
The symptoms are a disconnect after 30 seconds and trouble subscribing to the gatt characteristic (it works sometimes). The disconnect seems to happen even in bluethooth internals (chrome://bluetooth-internals/) However other ble devices seem to work fine on my computer. Eg accessing through chrome ble internals keeps the connection indefinitely.
It also works fine on Chrome on android...
This leads me to conclude that the GW is somehow damaged and for some reason the win 11 chrome ble is sensitive to this particular flaw.
The suggested strategy forward would be to change the GW and/or possibly reinstall the current GW (Huge Walnut Hawk)
A complete reinstall did not improve the situation. Could there be a hw issue on this GW?
btmon of the first connect that fails.
> HCI Event: LE Meta Event (0x3e) plen 12 #6 [hci0] 8.435635
LE Read Remote Used Features (0x04)
Status: Success (0x00)
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Features: 0x3f 0x00 0x00 0x00 0x00 0x00 0x00 0x00
LE Encryption
Connection Parameter Request Procedure
Extended Reject Indication
Peripheral-initiated Features Exchange
LE Ping
LE Data Packet Length Extension
< ACL Data TX: Handle 64 flags 0x00 dlen 7 #7 [hci0] 8.437800
ATT: Exchange MTU Request (0x02) len 2
Client RX MTU: 517
> HCI Event: LE Meta Event (0x3e) plen 11 #8 [hci0] 8.555317
LE Data Length Change (0x07)
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Max TX octets: 251
Max TX time: 328
Max RX octets: 251
Max RX time: 1601
< HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15 #9 [hci0] 8.712143
Min advertising interval: 95.625 msec (0x0099)
Max advertising interval: 152.500 msec (0x00f4)
Type: Connectable undirected - ADV_IND (0x00)
Own address type: Public (0x00)
Direct address type: Public (0x00)
Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
Channel map: 37, 38, 39 (0x07)
Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
> HCI Event: Command Complete (0x0e) plen 4 #10 [hci0] 8.712574
LE Set Advertising Parameters (0x08|0x0006) ncmd 1
Status: Success (0x00)
< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1 #11 [hci0] 8.712671
Advertising: Enabled (0x01)
> HCI Event: Command Complete (0x0e) plen 4 #12 [hci0] 8.713392
LE Set Advertise Enable (0x08|0x000a) ncmd 1
Status: Success (0x00)
> ACL Data RX: Handle 64 flags 0x02 dlen 7 #13 [hci0] 9.034930
ATT: Exchange MTU Request (0x02) len 2
Client RX MTU: 527
> ACL Data RX: Handle 64 flags 0x02 dlen 7 #14 [hci0] 9.035322
ATT: Exchange MTU Response (0x03) len 2
Server RX MTU: 527
< ACL Data TX: Handle 64 flags 0x00 dlen 7 #15 [hci0] 9.035933
ATT: Exchange MTU Response (0x03) len 2
Server RX MTU: 517
< ACL Data TX: Handle 64 flags 0x00 dlen 11 #16 [hci0] 9.036357
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0001-0xffff
Attribute type: Server Supported Features (0x2b3a)
> HCI Event: Number of Completed Packets (0x13) plen 5 #17 [hci0] 9.049500
Num handles: 1
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 1
> ACL Data RX: Handle 64 flags 0x02 dlen 13 #18 [hci0] 9.155048
ATT: Find By Type Value Request (0x06) len 8
Handle range: 0x0001-0xffff
Attribute type: Primary Service (0x2800)
UUID: Generic Attribute Profile (0x1801)
> ACL Data RX: Handle 64 flags 0x02 dlen 9 #19 [hci0] 9.155387
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0001
Error: Attribute Not Found (0x0a)
> HCI Event: Number of Completed Packets (0x13) plen 5 #20 [hci0] 9.155601
Num handles: 1
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
< ACL Data TX: Handle 64 flags 0x00 dlen 9 #21 [hci0] 9.155874
ATT: Find By Type Value Response (0x07) len 4
Handle range: 0x0008-0x0011
< ACL Data TX: Handle 64 flags 0x00 dlen 11 #22 [hci0] 9.156171
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0001-0xffff
Attribute type: Database Hash (0x2b2a)
> ACL Data RX: Handle 64 flags 0x02 dlen 13 #23 [hci0] 9.275040
ATT: Find By Type Value Request (0x06) len 8
Handle range: 0x0012-0xffff
Attribute type: Primary Service (0x2800)
UUID: Generic Attribute Profile (0x1801)
> HCI Event: Number of Completed Packets (0x13) plen 5 #24 [hci0] 9.275342
Num handles: 1
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
> ACL Data RX: Handle 64 flags 0x02 dlen 24 #25 [hci0] 9.275565
ATT: Read By Type Response (0x09) len 19
Attribute data length: 18
Attribute data list: 1 entry
Handle: 0x0011
Value: a6730da73a2ef5f9e37dde7e5065f2cc
< ACL Data TX: Handle 64 flags 0x00 dlen 9 #26 [hci0] 9.275868
ATT: Error Response (0x01) len 4
Find By Type Value Request (0x06)
Handle: 0x0012
Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 64 flags 0x00 dlen 11 #27 [hci0] 9.275980
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0012-0xffff
Attribute type: Database Hash (0x2b2a)
> ACL Data RX: Handle 64 flags 0x02 dlen 11 #28 [hci0] 9.395045
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0008-0x0011
Attribute type: Characteristic (0x2803)
> ACL Data RX: Handle 64 flags 0x02 dlen 9 #29 [hci0] 9.395383
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0012
Error: Attribute Not Found (0x0a)
> HCI Event: Number of Completed Packets (0x13) plen 5 #30 [hci0] 9.395596
Num handles: 1
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
< ACL Data TX: Handle 64 flags 0x00 dlen 34 #31 [hci0] 9.416602
ATT: Read By Type Response (0x09) len 29
Attribute data length: 7
Attribute data list: 4 entries
Handle: 0x0009
Value: 200a00052a
Properties: 0x20
Indicate (0x20)
Value Handle: 0x000a
Value UUID: Service Changed (0x2a05)
Handle: 0x000c
Value: 0a0d00292b
Properties: 0x0a
Read (0x02)
Write (0x08)
Value Handle: 0x000d
Value UUID: Client Supported Features (0x2b29)
Handle: 0x000e
Value: 020f002a2b
Properties: 0x02
Read (0x02)
Value Handle: 0x000f
Value UUID: Database Hash (0x2b2a)
Handle: 0x0010
Value: 0211003a2b
Properties: 0x02
Read (0x02)
Value Handle: 0x0011
Value UUID: Server Supported Features (0x2b3a)
< ACL Data TX: Handle 64 flags 0x00 dlen 8 #32 [hci0] 9.416904
ATT: Write Request (0x12) len 3
Handle: 0x000f Type: Client Supported Features (0x2b29)
Data: 05
> ACL Data RX: Handle 64 flags 0x02 dlen 11 #33 [hci0] 9.515036
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0011-0x0011
Attribute type: Characteristic (0x2803)
> ACL Data RX: Handle 64 flags 0x02 dlen 5 #34 [hci0] 9.515349
ATT: Write Response (0x13) len 0
> HCI Event: Number of Completed Packets (0x13) plen 5 #35 [hci0] 9.515596
Num handles: 1
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
< ACL Data TX: Handle 64 flags 0x00 dlen 9 #36 [hci0] 9.515972
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0011
Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 64 flags 0x00 dlen 9 #37 [hci0] 9.516137
ATT: Write Request (0x12) len 4
Handle: 0x000d Type: Client Characteristic Configuration (0x2902)
Data: 0200
Indication (0x02)
> ACL Data RX: Handle 64 flags 0x02 dlen 9 #38 [hci0] 9.635005
ATT: Find Information Request (0x04) len 4
Handle range: 0x000b-0x000b
> ACL Data RX: Handle 64 flags 0x02 dlen 5 #39 [hci0] 9.635307
ATT: Write Response (0x13) len 0
> HCI Event: Number of Completed Packets (0x13) plen 5 #40 [hci0] 9.635537
Num handles: 1
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
< ACL Data TX: Handle 64 flags 0x00 dlen 10 #41 [hci0] 9.635824
ATT: Find Information Response (0x05) len 5
Format: UUID-16 (0x01)
Handle: 0x000b
UUID: Client Characteristic Configuration (0x2902)
< ACL Data TX: Handle 64 flags 0x00 dlen 7 #42 [hci0] 9.636089
ATT: Read Request (0x0a) len 2
Handle: 0x0003 Type: Device Name (0x2a00)
> ACL Data RX: Handle 64 flags 0x02 dlen 9 #43 [hci0] 9.755023
ATT: Write Request (0x12) len 4
Handle: 0x000b Type: Client Characteristic Configuration (0x2902)
Data: 0200
Indication (0x02)
> ACL Data RX: Handle 64 flags 0x02 dlen 13 #44 [hci0] 9.755406
ATT: Read Response (0x0b) len 8
Value: 57422d3032333838
> HCI Event: Number of Completed Packets (0x13) plen 5 #45 [hci0] 9.755570
Num handles: 1
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
< ACL Data TX: Handle 64 flags 0x00 dlen 5 #46 [hci0] 9.756452
ATT: Write Response (0x13) len 0
< ACL Data TX: Handle 64 flags 0x00 dlen 7 #47 [hci0] 9.756509
ATT: Read Request (0x0a) len 2
Handle: 0x0005 Type: Appearance (0x2a01)
> ACL Data RX: Handle 64 flags 0x02 dlen 8 #48 [hci0] 9.875014
ATT: Write Request (0x12) len 3
Handle: 0x000d Type: Client Supported Features (0x2b29)
Data: 01
> ACL Data RX: Handle 64 flags 0x02 dlen 7 #49 [hci0] 9.875351
ATT: Read Response (0x0b) len 2
Value: 8000
> HCI Event: Number of Completed Packets (0x13) plen 5 #50 [hci0] 9.875545
Num handles: 1
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
< ACL Data TX: Handle 64 flags 0x00 dlen 5 #51 [hci0] 9.876381
ATT: Write Response (0x13) len 0
< ACL Data TX: Handle 64 flags 0x00 dlen 7 #52 [hci0] 9.876655
ATT: Read Request (0x0a) len 2
Handle: 0x0014 Type: PnP ID (0x2a50)
> ACL Data RX: Handle 64 flags 0x02 dlen 7 #53 [hci0] 9.994984
ATT: Read Request (0x0a) len 2
Handle: 0x000f Type: Database Hash (0x2b2a)
> ACL Data RX: Handle 64 flags 0x02 dlen 12 #54 [hci0] 9.995380
ATT: Read Response (0x0b) len 7
Value: 0106000100000a
> HCI Event: Number of Completed Packets (0x13) plen 5 #55 [hci0] 9.995548
Num handles: 1
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
< ACL Data TX: Handle 64 flags 0x00 dlen 21 #56 [hci0] 9.996349
ATT: Read Response (0x0b) len 16
Value: 9e34a6baeda95b18d4ba9973ad2ff6eb
Handle: 0x0000
Properties: 0x9e
Read (0x02)
Write Without Response (0x04)
Write (0x08)
Notify (0x10)
Unknown fields (0x80)
Value Handle: 0xa634
ba ed a9 5b 18 d4 ba 99 73 ad 2f f6 eb ...[....s./..
< ACL Data TX: Handle 64 flags 0x00 dlen 7 #57 [hci0] 9.996492
ATT: Read Request (0x0a) len 2
Handle: 0x003c Type: Media Player Name (0x2b93)
> HCI Event: Number of Completed Packets (0x13) plen 5 #58 [hci0] 10.115517
Num handles: 1
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
> ACL Data RX: Handle 64 flags 0x02 dlen 11 #59 [hci0] 10.115534
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x0001-0xffff
Attribute group type: Primary Service (0x2800)
> HCI Event: LE Meta Event (0x3e) plen 11 #60 [hci0] 10.115897
LE Remote Connection Parameter Request (0x06)
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Min connection interval: 7.50 msec (0x0006)
Max connection interval: 15.00 msec (0x000c)
Connection latency: 0 (0x0000)
Supervision timeout: 9600 msec (0x03c0)
< HCI Command: LE Remote Connection Parameter Request Reply (0x08|0x0020) plen 14 #61 [hci0] 10.116054
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Min connection interval: 7.50 msec (0x0006)
Max connection interval: 15.00 msec (0x000c)
Connection latency: 0 (0x0000)
Supervision timeout: 9600 msec (0x03c0)
Min connection length: 0.000 msec (0x0000)
Max connection length: 0.000 msec (0x0000)
> ACL Data RX: Handle 64 flags 0x02 dlen 9 #62 [hci0] 10.116044
ATT: Error Response (0x01) len 4
Read Request (0x0a)
Handle: 0x003c
Error: Insufficient Authentication (0x05)
< ACL Data TX: Handle 64 flags 0x00 dlen 6 #63 [hci0] 10.116359
SMP: Security Request (0x0b) len 1
Authentication requirement: Bonding, MITM, SC, No Keypresses, CT2 (0x2d)
> HCI Event: Command Complete (0x0e) plen 6 #64 [hci0] 10.119597
LE Remote Connection Parameter Request Reply (0x08|0x0020) ncmd 1
Status: Success (0x00)
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
> ACL Data RX: Handle 64 flags 0x02 dlen 11 #65 [hci0] 10.354964
SMP: Pairing Request (0x01) len 6
IO capability: KeyboardDisplay (0x04)
OOB data: Authentication data not present (0x00)
Authentication requirement: Bonding, MITM, SC, No Keypresses, CT2 (0x2d)
Max encryption key size: 16
Initiator key distribution: IdKey Sign LinkKey (0x0e)
Responder key distribution: EncKey IdKey Sign LinkKey (0x0f)
@ MGMT Event: Authentication Failed (0x0011) plen 8 {0x0001} [hci0] 10.355102
LE Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Status: Authentication Failed (0x05)
< ACL Data TX: Handle 64 flags 0x00 dlen 6 #66 [hci0] 10.355166
SMP: Pairing Failed (0x05) len 1
Reason: Pairing not supported (0x05)
> HCI Event: Number of Completed Packets (0x13) plen 5 #67 [hci0] 10.475224
Num handles: 1
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
> HCI Event: LE Meta Event (0x3e) plen 10 #68 [hci0] 10.655353
LE Connection Update Complete (0x03)
Status: Success (0x00)
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Connection interval: 15.00 msec (0x000c)
Connection latency: 0 (0x0000)
Supervision timeout: 9600 msec (0x03c0)
> HCI Event: Disconnect Complete (0x05) plen 4 #69 [hci0] 40.221655
Status: Success (0x00)
Handle: 64 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Reason: Remote User Terminated Connection (0x13)
@ MGMT Event: Device Disconnected (0x000c) plen 8 {0x0001} [hci0] 40.221732
LE Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Reason: Connection terminated by remote host (0x03)
This is from using chrome internals:
> HCI Event: LE Meta Event (0x3e) plen 19 #1 [hci0] 97.168748
LE Connection Complete (0x01)
Status: Success (0x00)
Handle: 65
Role: Peripheral (0x01)
Peer address type: Public (0x00)
Peer address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Connection interval: 60.00 msec (0x0030)
Connection latency: 0 (0x0000)
Supervision timeout: 9600 msec (0x03c0)
Central clock accuracy: 0x01
@ MGMT Event: Device Connected (0x000b) plen 13 {0x0001} [hci0] 97.168854
LE Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Flags: 0x00000000
Data length: 0
> HCI Event: Vendor (0xff) plen 5 #2 [hci0] 97.168764
55 00 00 41 00 U..A.
< HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2 #3 [hci0] 97.169183
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
> HCI Event: Command Status (0x0f) plen 4 #4 [hci0] 97.169567
LE Read Remote Used Features (0x08|0x0016) ncmd 1
Status: Success (0x00)
> HCI Event: Command Complete (0x0e) plen 14 #5 [hci0] 97.169653
LE Read Remote Used Features (0x08|0x0016) ncmd 1
Status: Success (0x00)
00 00 00 00 00 00 00 00 00 00 ..........
@ RAW Open: btmon (privileged) version 2.22 {0x0002} 97.170137
@ RAW Close: btmon {0x0002} 97.170181
> HCI Event: LE Meta Event (0x3e) plen 12 #6 [hci0] 97.280621
LE Read Remote Used Features (0x04)
Status: Success (0x00)
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Features: 0x3f 0x00 0x00 0x00 0x00 0x00 0x00 0x00
LE Encryption
Connection Parameter Request Procedure
Extended Reject Indication
Peripheral-initiated Features Exchange
LE Ping
LE Data Packet Length Extension
> ACL Data RX: Handle 65 flags 0x02 dlen 7 #7 [hci0] 97.280935
ATT: Exchange MTU Request (0x02) len 2
Client RX MTU: 527
< ACL Data TX: Handle 65 flags 0x00 dlen 7 #8 [hci0] 97.284788
ATT: Exchange MTU Response (0x03) len 2
Server RX MTU: 517
< ACL Data TX: Handle 65 flags 0x00 dlen 7 #9 [hci0] 97.284875
ATT: Exchange MTU Request (0x02) len 2
Client RX MTU: 517
> HCI Event: LE Meta Event (0x3e) plen 11 #10 [hci0] 97.340398
LE Data Length Change (0x07)
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Max TX octets: 251
Max TX time: 328
Max RX octets: 251
Max RX time: 1601
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #11 [hci0] 97.701045
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0001-0xffff
Attribute type: Database Hash (0x2b2a)
> HCI Event: Number of Completed Packets (0x13) plen 5 #12 [hci0] 97.701251
Num handles: 1
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
< ACL Data TX: Handle 65 flags 0x00 dlen 24 #13 [hci0] 97.701936
ATT: Read By Type Response (0x09) len 19
Attribute data length: 18
Attribute data list: 1 entry
Handle: 0x000f
Value: 9e34a6baeda95b18d4ba9973ad2ff6eb
> ACL Data RX: Handle 65 flags 0x02 dlen 7 #14 [hci0] 97.759912
ATT: Exchange MTU Response (0x03) len 2
Server RX MTU: 527
< ACL Data TX: Handle 65 flags 0x00 dlen 11 #15 [hci0] 97.760419
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0001-0xffff
Attribute type: Server Supported Features (0x2b3a)
> ACL Data RX: Handle 65 flags 0x02 dlen 9 #16 [hci0] 97.940058
ATT: Write Request (0x12) len 4
Handle: 0x000b Type: Client Characteristic Configuration (0x2902)
Data: 0200
Indication (0x02)
> ACL Data RX: Handle 65 flags 0x02 dlen 9 #17 [hci0] 97.940430
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0001
Error: Attribute Not Found (0x0a)
> HCI Event: Number of Completed Packets (0x13) plen 5 #18 [hci0] 97.940632
Num handles: 1
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
< ACL Data TX: Handle 65 flags 0x00 dlen 5 #19 [hci0] 97.940953
ATT: Write Response (0x13) len 0
< ACL Data TX: Handle 65 flags 0x00 dlen 11 #20 [hci0] 97.941227
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0001-0xffff
Attribute type: Database Hash (0x2b2a)
< HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15 #21 [hci0] 98.056162
Min advertising interval: 95.625 msec (0x0099)
Max advertising interval: 152.500 msec (0x00f4)
Type: Connectable undirected - ADV_IND (0x00)
Own address type: Public (0x00)
Direct address type: Public (0x00)
Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
Channel map: 37, 38, 39 (0x07)
Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
> HCI Event: Command Complete (0x0e) plen 4 #22 [hci0] 98.056550
LE Set Advertising Parameters (0x08|0x0006) ncmd 1
Status: Success (0x00)
< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1 #23 [hci0] 98.056652
Advertising: Enabled (0x01)
> HCI Event: Command Complete (0x0e) plen 4 #24 [hci0] 98.057100
LE Set Advertise Enable (0x08|0x000a) ncmd 1
Status: Success (0x00)
> ACL Data RX: Handle 65 flags 0x02 dlen 8 #25 [hci0] 98.060037
ATT: Write Request (0x12) len 3
Handle: 0x000d Type: Client Supported Features (0x2b29)
Data: 01
> HCI Event: Number of Completed Packets (0x13) plen 5 #26 [hci0] 98.060314
Num handles: 1
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 24 #27 [hci0] 98.060584
ATT: Read By Type Response (0x09) len 19
Attribute data length: 18
Attribute data list: 1 entry
Handle: 0x0011
Value: a6730da73a2ef5f9e37dde7e5065f2cc
< ACL Data TX: Handle 65 flags 0x00 dlen 5 #28 [hci0] 98.060751
ATT: Write Response (0x13) len 0
< ACL Data TX: Handle 65 flags 0x00 dlen 11 #29 [hci0] 98.060926
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0012-0xffff
Attribute type: Database Hash (0x2b2a)
> HCI Event: Number of Completed Packets (0x13) plen 5 #30 [hci0] 98.180569
Num handles: 1
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #31 [hci0] 98.180585
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x0001-0xffff
Attribute group type: Primary Service (0x2800)
> HCI Event: LE Meta Event (0x3e) plen 11 #32 [hci0] 98.180922
LE Remote Connection Parameter Request (0x06)
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Min connection interval: 7.50 msec (0x0006)
Max connection interval: 15.00 msec (0x000c)
Connection latency: 0 (0x0000)
Supervision timeout: 9600 msec (0x03c0)
< HCI Command: LE Remote Connection Parameter Request Reply (0x08|0x0020) plen 14 #33 [hci0] 98.181018
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Min connection interval: 7.50 msec (0x0006)
Max connection interval: 15.00 msec (0x000c)
Connection latency: 0 (0x0000)
Supervision timeout: 9600 msec (0x03c0)
Min connection length: 0.000 msec (0x0000)
Max connection length: 0.000 msec (0x0000)
< ACL Data TX: Handle 65 flags 0x00 dlen 24 #34 [hci0] 98.181062
ATT: Read By Group Type Response (0x11) len 19
Attribute data length: 6
Attribute group list: 3 entries
Handle range: 0x0001-0x0007
UUID: Generic Access Profile (0x1800)
Handle range: 0x0008-0x0011
UUID: Generic Attribute Profile (0x1801)
Handle range: 0x0012-0x001a
UUID: Volume Control (0x1844)
> ACL Data RX: Handle 65 flags 0x02 dlen 9 #35 [hci0] 98.181100
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0012
Error: Attribute Not Found (0x0a)
> HCI Event: Command Complete (0x0e) plen 6 #36 [hci0] 98.184084
LE Remote Connection Parameter Request Reply (0x08|0x0020) ncmd 1
Status: Success (0x00)
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
< ACL Data TX: Handle 65 flags 0x00 dlen 8 #37 [hci0] 98.203316
ATT: Write Request (0x12) len 3
Handle: 0x000f Type: Client Supported Features (0x2b29)
Data: 05
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #38 [hci0] 98.480073
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x001b-0xffff
Attribute group type: Primary Service (0x2800)
> ACL Data RX: Handle 65 flags 0x02 dlen 5 #39 [hci0] 98.480426
ATT: Write Response (0x13) len 0
> HCI Event: Number of Completed Packets (0x13) plen 5 #40 [hci0] 98.480630
Num handles: 1
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
< ACL Data TX: Handle 65 flags 0x00 dlen 26 #41 [hci0] 98.480717
ATT: Read By Group Type Response (0x11) len 21
Attribute data length: 20
Attribute group list: 1 entry
Handle range: 0x0052-0x0055
UUID: Vendor specific (a07498ca-ad5b-474e-940d-16f1fbe7e8cd)
< ACL Data TX: Handle 65 flags 0x00 dlen 9 #42 [hci0] 98.480847
ATT: Write Request (0x12) len 4
Handle: 0x000d Type: Client Characteristic Configuration (0x2902)
Data: 0200
Indication (0x02)
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #43 [hci0] 98.600078
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x0056-0xffff
Attribute group type: Primary Service (0x2800)
> ACL Data RX: Handle 65 flags 0x02 dlen 5 #44 [hci0] 98.600381
ATT: Write Response (0x13) len 0
< ACL Data TX: Handle 65 flags 0x00 dlen 9 #45 [hci0] 98.600440
ATT: Error Response (0x01) len 4
Read By Group Type Request (0x10)
Handle: 0x0056
Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 65 flags 0x00 dlen 7 #46 [hci0] 98.600549
ATT: Read Request (0x0a) len 2
Handle: 0x0003 Type: Device Name (0x2a00)
> HCI Event: Number of Completed Packets (0x13) plen 5 #47 [hci0] 98.600957
Num handles: 1
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #48 [hci0] 98.720087
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0001-0x0007
Attribute type: Include (0x2802)
> ACL Data RX: Handle 65 flags 0x02 dlen 13 #49 [hci0] 98.720488
ATT: Read Response (0x0b) len 8
Value: 57422d3032333838
< ACL Data TX: Handle 65 flags 0x00 dlen 9 #50 [hci0] 98.720627
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0001
Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 65 flags 0x00 dlen 7 #51 [hci0] 98.720844
ATT: Read Request (0x0a) len 2
Handle: 0x0005 Type: Appearance (0x2a01)
> HCI Event: Number of Completed Packets (0x13) plen 5 #52 [hci0] 98.720895
Num handles: 1
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
> HCI Event: LE Meta Event (0x3e) plen 10 #53 [hci0] 98.721281
LE Connection Update Complete (0x03)
Status: Success (0x00)
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Connection interval: 15.00 msec (0x000c)
Connection latency: 0 (0x0000)
Supervision timeout: 9600 msec (0x03c0)
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #54 [hci0] 98.750072
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0001-0x0007
Attribute type: Characteristic (0x2803)
> ACL Data RX: Handle 65 flags 0x02 dlen 7 #55 [hci0] 98.750444
ATT: Read Response (0x0b) len 2
Value: 8000
< ACL Data TX: Handle 65 flags 0x00 dlen 27 #56 [hci0] 98.750529
ATT: Read By Type Response (0x09) len 22
Attribute data length: 7
Attribute data list: 3 entries
Handle: 0x0002
Value: 020300002a
Properties: 0x02
Read (0x02)
Value Handle: 0x0003
Value UUID: Device Name (0x2a00)
Handle: 0x0004
Value: 020500012a
Properties: 0x02
Read (0x02)
Value Handle: 0x0005
Value UUID: Appearance (0x2a01)
Handle: 0x0006
Value: 020700a62a
Properties: 0x02
Read (0x02)
Value Handle: 0x0007
Value UUID: Central Address Resolution (0x2aa6)
> HCI Event: Number of Completed Packets (0x13) plen 5 #57 [hci0] 98.750622
Num handles: 1
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
< ACL Data TX: Handle 65 flags 0x00 dlen 7 #58 [hci0] 98.750688
ATT: Read Request (0x0a) len 2
Handle: 0x0014 Type: PnP ID (0x2a50)
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #59 [hci0] 98.780516
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0007-0x0007
Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5 #60 [hci0] 98.780852
Num handles: 1
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
< ACL Data TX: Handle 65 flags 0x00 dlen 9 #61 [hci0] 98.781106
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0007
Error: Attribute Not Found (0x0a)
> ACL Data RX: Handle 65 flags 0x02 dlen 12 #62 [hci0] 98.794966
ATT: Read Response (0x0b) len 7
Value: 0106000100000a
< ACL Data TX: Handle 65 flags 0x00 dlen 7 #63 [hci0] 98.795420
ATT: Read Request (0x0a) len 2
Handle: 0x003c Type: Media Player Name (0x2b93)
> ACL Data RX: Handle 65 flags 0x02 dlen 7 #64 [hci0] 98.809948
ATT: Read Request (0x0a) len 2
Handle: 0x0007 Type: Central Address Resolution (0x2aa6)
< ACL Data TX: Handle 65 flags 0x00 dlen 6 #65 [hci0] 98.812388
ATT: Read Response (0x0b) len 1
Value: 01
Handle: 0x0000
Properties: 0x01
Broadcast (0x01)
Value Handle: invalid size
> ACL Data RX: Handle 65 flags 0x02 dlen 9 #66 [hci0] 98.824986
ATT: Error Response (0x01) len 4
Read Request (0x0a)
Handle: 0x003c
Error: Insufficient Authentication (0x05)
< ACL Data TX: Handle 65 flags 0x00 dlen 6 #67 [hci0] 98.825261
SMP: Security Request (0x0b) len 1
Authentication requirement: Bonding, MITM, SC, No Keypresses, CT2 (0x2d)
> HCI Event: Number of Completed Packets (0x13) plen 5 #68 [hci0] 98.825378
Num handles: 1
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 7 #69 [hci0] 98.839937
ATT: Read Request (0x0a) len 2
Handle: 0x0005 Type: Appearance (0x2a01)
< ACL Data TX: Handle 65 flags 0x00 dlen 7 #70 [hci0] 98.840479
ATT: Read Response (0x0b) len 2
Value: 0000
< ACL Data TX: Handle 65 flags 0x00 dlen 7 #71 [hci0] 98.841310
ATT: Read Request (0x0a) len 2
Handle: 0x003c Type: Media Player Name (0x2b93)
> HCI Event: Number of Completed Packets (0x13) plen 5 #72 [hci0] 98.855312
Num handles: 1
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 7 #73 [hci0] 98.870031
ATT: Read Request (0x0a) len 2
Handle: 0x0003 Type: Device Name (0x2a00)
> ACL Data RX: Handle 65 flags 0x02 dlen 9 #74 [hci0] 98.870395
ATT: Error Response (0x01) len 4
Read Request (0x0a)
Handle: 0x003c
Error: Insufficient Authentication (0x05)
> HCI Event: Number of Completed Packets (0x13) plen 5 #75 [hci0] 98.870584
Num handles: 1
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #76 [hci0] 98.884949
SMP: Pairing Request (0x01) len 6
IO capability: KeyboardDisplay (0x04)
OOB data: Authentication data not present (0x00)
Authentication requirement: Bonding, MITM, SC, No Keypresses, CT2 (0x2d)
Max encryption key size: 16
Initiator key distribution: IdKey Sign LinkKey (0x0e)
Responder key distribution: EncKey IdKey Sign LinkKey (0x0f)
@ MGMT Event: Authentication Failed (0x0011) plen 8 {0x0001} [hci0] 98.885050
LE Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Status: Authentication Failed (0x05)
< ACL Data TX: Handle 65 flags 0x00 dlen 6 #77 [hci0] 98.885097
SMP: Pairing Failed (0x05) len 1
Reason: Pairing not supported (0x05)
> HCI Event: Number of Completed Packets (0x13) plen 5 #78 [hci0] 99.051754
Num handles: 1
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Count: 1
> HCI Event: Disconnect Complete (0x05) plen 4 #79 [hci0] 129.006483
Status: Success (0x00)
Handle: 65 Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Reason: Remote User Terminated Connection (0x13)
@ MGMT Event: Device Disconnected (0x000c) plen 8 {0x0001} [hci0] 129.006570
LE Address: A4:F9:33:E4:CD:2E (OUI A4-F9-33)
Reason: Connection terminated by remote host (0x03)
btmon when connecting with crome on android (note that in this case the connection message is also sent and received)
> HCI Event: LE Meta Event (0x3e) plen 12 #6 [hci0] 7.421738
LE Read Remote Used Features (0x04)
Status: Success (0x00)
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Features: 0x3f 0x00 0x00 0x00 0x00 0x00 0x00 0x00
LE Encryption
Connection Parameter Request Procedure
Extended Reject Indication
Peripheral-initiated Features Exchange
LE Ping
LE Data Packet Length Extension
< ACL Data TX: Handle 65 flags 0x00 dlen 7 #7 [hci0] 7.423031
ATT: Exchange MTU Request (0x02) len 2
Client RX MTU: 517
> HCI Event: LE Meta Event (0x3e) plen 11 #8 [hci0] 7.471759
LE Data Length Change (0x07)
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Max TX octets: 251
Max TX time: 2120
Max RX octets: 251
Max RX time: 2120
< HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15 #9 [hci0] 7.688109
Min advertising interval: 95.625 msec (0x0099)
Max advertising interval: 152.500 msec (0x00f4)
Type: Connectable undirected - ADV_IND (0x00)
Own address type: Public (0x00)
Direct address type: Public (0x00)
Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
Channel map: 37, 38, 39 (0x07)
Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
> HCI Event: Command Complete (0x0e) plen 4 #10 [hci0] 7.688511
LE Set Advertising Parameters (0x08|0x0006) ncmd 1
Status: Success (0x00)
< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1 #11 [hci0] 7.688577
Advertising: Enabled (0x01)
> HCI Event: Command Complete (0x0e) plen 4 #12 [hci0] 7.689021
LE Set Advertise Enable (0x08|0x000a) ncmd 1
Status: Success (0x00)
> ACL Data RX: Handle 65 flags 0x02 dlen 7 #13 [hci0] 7.771475
ATT: Exchange MTU Response (0x03) len 2
Server RX MTU: 517
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #14 [hci0] 7.771831
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x0001-0xffff
Attribute group type: Primary Service (0x2800)
< ACL Data TX: Handle 65 flags 0x00 dlen 24 #15 [hci0] 7.772451
ATT: Read By Group Type Response (0x11) len 19
Attribute data length: 6
Attribute group list: 3 entries
Handle range: 0x0001-0x0007
UUID: Generic Access Profile (0x1800)
Handle range: 0x0008-0x0011
UUID: Generic Attribute Profile (0x1801)
Handle range: 0x0012-0x001a
UUID: Volume Control (0x1844)
< ACL Data TX: Handle 65 flags 0x00 dlen 11 #16 [hci0] 7.772591
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0001-0xffff
Attribute type: Server Supported Features (0x2b3a)
> HCI Event: Number of Completed Packets (0x13) plen 5 #17 [hci0] 7.921967
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #18 [hci0] 7.971372
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x001b-0xffff
Attribute group type: Primary Service (0x2800)
< ACL Data TX: Handle 65 flags 0x00 dlen 26 #19 [hci0] 7.971714
ATT: Read By Group Type Response (0x11) len 21
Attribute data length: 20
Attribute group list: 1 entry
Handle range: 0x0052-0x0055
UUID: Vendor specific (a07498ca-ad5b-474e-940d-16f1fbe7e8cd)
> ACL Data RX: Handle 65 flags 0x02 dlen 9 #20 [hci0] 7.972040
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0001
Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 65 flags 0x00 dlen 11 #21 [hci0] 7.972281
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x0001-0xffff
Attribute group type: Primary Service (0x2800)
> HCI Event: Number of Completed Packets (0x13) plen 5 #22 [hci0] 8.022305
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #23 [hci0] 8.071406
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x0056-0xffff
Attribute group type: Primary Service (0x2800)
< ACL Data TX: Handle 65 flags 0x00 dlen 9 #24 [hci0] 8.071770
ATT: Error Response (0x01) len 4
Read By Group Type Request (0x10)
Handle: 0x0056
Error: Attribute Not Found (0x0a)
> ACL Data RX: Handle 65 flags 0x02 dlen 18 #25 [hci0] 8.071901
ATT: Read By Group Type Response (0x11) len 13
Attribute data length: 6
Attribute group list: 2 entries
Handle range: 0x0001-0x0003
UUID: Generic Attribute Profile (0x1801)
Handle range: 0x0014-0x001a
UUID: Generic Access Profile (0x1800)
< ACL Data TX: Handle 65 flags 0x00 dlen 11 #26 [hci0] 8.072169
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x001b-0xffff
Attribute group type: Primary Service (0x2800)
> HCI Event: Number of Completed Packets (0x13) plen 5 #27 [hci0] 8.121825
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #28 [hci0] 8.171440
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0001-0x0007
Attribute type: Include (0x2802)
> ACL Data RX: Handle 65 flags 0x02 dlen 26 #29 [hci0] 8.172064
ATT: Read By Group Type Response (0x11) len 21
Attribute data length: 20
Attribute group list: 1 entry
Handle range: 0x0028-0x002e
UUID: Vendor specific (11c8b310-80e4-4276-afc0-f81590b2177f)
< ACL Data TX: Handle 65 flags 0x00 dlen 9 #30 [hci0] 8.172240
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0001
Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 65 flags 0x00 dlen 11 #31 [hci0] 8.172577
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x002f-0xffff
Attribute group type: Primary Service (0x2800)
> HCI Event: Number of Completed Packets (0x13) plen 5 #32 [hci0] 8.221868
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #33 [hci0] 8.271442
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0001-0x0007
Attribute type: Characteristic (0x2803)
> ACL Data RX: Handle 65 flags 0x02 dlen 18 #34 [hci0] 8.271916
ATT: Read By Group Type Response (0x11) len 13
Attribute data length: 6
Attribute group list: 2 entries
Handle range: 0x002f-0x0039
UUID: HUAWEI Technologies Co., Ltd (0xfe35)
Handle range: 0x003a-0xffff
UUID: Unknown (0x046a)
< ACL Data TX: Handle 65 flags 0x00 dlen 27 #35 [hci0] 8.272142
ATT: Read By Type Response (0x09) len 22
Attribute data length: 7
Attribute data list: 3 entries
Handle: 0x0002
Value: 020300002a
Properties: 0x02
Read (0x02)
Value Handle: 0x0003
Value UUID: Device Name (0x2a00)
Handle: 0x0004
Value: 020500012a
Properties: 0x02
Read (0x02)
Value Handle: 0x0005
Value UUID: Appearance (0x2a01)
Handle: 0x0006
Value: 020700a62a
Properties: 0x02
Read (0x02)
Value Handle: 0x0007
Value UUID: Central Address Resolution (0x2aa6)
< ACL Data TX: Handle 65 flags 0x00 dlen 11 #36 [hci0] 8.275872
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x0001-0xffff
Attribute group type: Secondary Service (0x2801)
> HCI Event: Number of Completed Packets (0x13) plen 5 #37 [hci0] 8.321986
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
> HCI Event: LE Meta Event (0x3e) plen 10 #38 [hci0] 8.372933
LE Connection Update Complete (0x03)
Status: Success (0x00)
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Connection interval: 50.00 msec (0x0028)
Connection latency: 0 (0x0000)
Supervision timeout: 5000 msec (0x01f4)
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #39 [hci0] 8.421412
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0007-0x0007
Attribute type: Characteristic (0x2803)
> ACL Data RX: Handle 65 flags 0x02 dlen 9 #40 [hci0] 8.421794
ATT: Error Response (0x01) len 4
Read By Group Type Request (0x10)
Handle: 0x0001
Error: Unsupported Group Type (0x10)
< ACL Data TX: Handle 65 flags 0x00 dlen 9 #41 [hci0] 8.422139
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0007
Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 65 flags 0x00 dlen 11 #42 [hci0] 8.422399
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0001-0xffff
Attribute type: Include (0x2802)
> HCI Event: LE Meta Event (0x3e) plen 11 #43 [hci0] 8.471782
LE Remote Connection Parameter Request (0x06)
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Min connection interval: 7.50 msec (0x0006)
Max connection interval: 7.50 msec (0x0006)
Connection latency: 0 (0x0000)
Supervision timeout: 5000 msec (0x01f4)
< HCI Command: LE Remote Connection Parameter Request Reply (0x08|0x0020) plen 14 #44 [hci0] 8.471881
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Min connection interval: 7.50 msec (0x0006)
Max connection interval: 7.50 msec (0x0006)
Connection latency: 0 (0x0000)
Supervision timeout: 5000 msec (0x01f4)
Min connection length: 0.000 msec (0x0000)
Max connection length: 0.000 msec (0x0000)
> HCI Event: Number of Completed Packets (0x13) plen 5 #45 [hci0] 8.472413
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
> HCI Event: Command Complete (0x0e) plen 6 #46 [hci0] 8.475404
LE Remote Connection Parameter Request Reply (0x08|0x0020) ncmd 1
Status: Success (0x00)
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #47 [hci0] 8.521440
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0008-0x0011
Attribute type: Include (0x2802)
> ACL Data RX: Handle 65 flags 0x02 dlen 9 #48 [hci0] 8.521834
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0001
Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 65 flags 0x00 dlen 9 #49 [hci0] 8.521982
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0008
Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 65 flags 0x00 dlen 11 #50 [hci0] 8.522178
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0001-0xffff
Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5 #51 [hci0] 8.573551
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #52 [hci0] 8.621442
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0008-0x0011
Attribute type: Characteristic (0x2803)
< ACL Data TX: Handle 65 flags 0x00 dlen 34 #53 [hci0] 8.622018
ATT: Read By Type Response (0x09) len 29
Attribute data length: 7
Attribute data list: 4 entries
Handle: 0x0009
Value: 200a00052a
Properties: 0x20
Indicate (0x20)
Value Handle: 0x000a
Value UUID: Service Changed (0x2a05)
Handle: 0x000c
Value: 0a0d00292b
Properties: 0x0a
Read (0x02)
Write (0x08)
Value Handle: 0x000d
Value UUID: Client Supported Features (0x2b29)
Handle: 0x000e
Value: 020f002a2b
Properties: 0x02
Read (0x02)
Value Handle: 0x000f
Value UUID: Database Hash (0x2b2a)
Handle: 0x0010
Value: 0211003a2b
Properties: 0x02
Read (0x02)
Value Handle: 0x0011
Value UUID: Server Supported Features (0x2b3a)
> ACL Data RX: Handle 65 flags 0x02 dlen 83 #54 [hci0] 8.622746
ATT: Read By Type Response (0x09) len 78
Attribute data length: 7
Attribute data list: 11 entries
Handle: 0x0002
Value: 200300052a
Properties: 0x20
Indicate (0x20)
Value Handle: 0x0003
Value UUID: Service Changed (0x2a05)
Handle: 0x0015
Value: 021600002a
Properties: 0x02
Read (0x02)
Value Handle: 0x0016
Value UUID: Device Name (0x2a00)
Handle: 0x0017
Value: 021800012a
Properties: 0x02
Read (0x02)
Value Handle: 0x0018
Value UUID: Appearance (0x2a01)
Handle: 0x0019
Value: 021a00a62a
Properties: 0x02
Read (0x02)
Value Handle: 0x001a
Value UUID: Central Address Resolution (0x2aa6)
Handle: 0x0029
Value: 3a2a00002b
Properties: 0x3a
Read (0x02)
Write (0x08)
Notify (0x10)
Indicate (0x20)
Value Handle: 0x002a
Value UUID: Unknown (0x2b00)
Handle: 0x002c
Value: 3a2d00012b
Properties: 0x3a
Read (0x02)
Write (0x08)
Notify (0x10)
Indicate (0x20)
Value Handle: 0x002d
Value UUID: Unknown (0x2b01)
Handle: 0x0030
Value: 0a3100002a
Properties: 0x0a
Read (0x02)
Write (0x08)
Value Handle: 0x0031
Value UUID: Device Name (0x2a00)
Handle: 0x0032
Value: 303300012a
Properties: 0x30
Notify (0x10)
Indicate (0x20)
Value Handle: 0x0033
Value UUID: Appearance (0x2a01)
Handle: 0x0035
Value: 083600022a
Properties: 0x08
Write (0x08)
Value Handle: 0x0036
Value UUID: Peripheral Privacy Flag (0x2a02)
Handle: 0x0037
Value: 303800032a
Properties: 0x30
Notify (0x10)
Indicate (0x20)
Value Handle: 0x0038
Value UUID: Reconnection Address (0x2a03)
Handle: 0x003b
Value: 0a3c006c04
Properties: 0x0a
Read (0x02)
Write (0x08)
Value Handle: 0x003c
Value UUID: Unknown (0x046c)
< ACL Data TX: Handle 65 flags 0x00 dlen 11 #55 [hci0] 8.623190
ATT: Read By Type Request (0x08) len 6
Handle range: 0x003c-0xffff
Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5 #56 [hci0] 8.722080
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #57 [hci0] 8.771453
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0011-0x0011
Attribute type: Characteristic (0x2803)
> ACL Data RX: Handle 65 flags 0x02 dlen 9 #58 [hci0] 8.771852
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x003c
Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 65 flags 0x00 dlen 9 #59 [hci0] 8.772480
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0011
Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 65 flags 0x00 dlen 9 #60 [hci0] 8.772603
ATT: Find Information Request (0x04) len 4
Handle range: 0x003d-0xffff
> HCI Event: Number of Completed Packets (0x13) plen 5 #61 [hci0] 8.821846
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 9 #62 [hci0] 8.921381
ATT: Find Information Request (0x04) len 4
Handle range: 0x000b-0x000b
> ACL Data RX: Handle 65 flags 0x02 dlen 9 #63 [hci0] 8.921805
ATT: Error Response (0x01) len 4
Find Information Request (0x04)
Handle: 0x003d
Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 65 flags 0x00 dlen 10 #64 [hci0] 8.921987
ATT: Find Information Response (0x05) len 5
Format: UUID-16 (0x01)
Handle: 0x000b
UUID: Client Characteristic Configuration (0x2902)
> HCI Event: LE Meta Event (0x3e) plen 10 #65 [hci0] 8.922540
LE Connection Update Complete (0x03)
Status: Success (0x00)
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Connection interval: 7.50 msec (0x0006)
Connection latency: 0 (0x0000)
Supervision timeout: 5000 msec (0x01f4)
< ACL Data TX: Handle 65 flags 0x00 dlen 7 #66 [hci0] 8.929555
ATT: Read Request (0x0a) len 2
Handle: 0x0016
> HCI Event: Number of Completed Packets (0x13) plen 5 #67 [hci0] 8.936828
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #68 [hci0] 8.943905
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0012-0x001a
Attribute type: Include (0x2802)
< ACL Data TX: Handle 65 flags 0x00 dlen 9 #69 [hci0] 8.944195
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0012
Error: Attribute Not Found (0x0a)
> ACL Data RX: Handle 65 flags 0x02 dlen 16 #70 [hci0] 8.944384
ATT: Read Response (0x0b) len 11
Value: 68336c6c306e3334727468
Handle: 0x0000
Properties: 0x68
Write (0x08)
Indicate (0x20)
Authorize (0x40)
Extended Properties (0x80)
Value Handle: 0x6c33
6c 30 6e 33 34 72 74 68 l0n34rth
< ACL Data TX: Handle 65 flags 0x00 dlen 7 #71 [hci0] 8.944623
ATT: Read Request (0x0a) len 2
Handle: 0x0018
> HCI Event: Number of Completed Packets (0x13) plen 5 #72 [hci0] 8.951817
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #73 [hci0] 8.958906
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0012-0x001a
Attribute type: Characteristic (0x2803)
> ACL Data RX: Handle 65 flags 0x02 dlen 7 #74 [hci0] 8.959289
ATT: Read Response (0x0b) len 2
Value: 0000
< ACL Data TX: Handle 65 flags 0x00 dlen 27 #75 [hci0] 8.959566
ATT: Read By Type Response (0x09) len 22
Attribute data length: 7
Attribute data list: 3 entries
Handle: 0x0013
Value: 1214007d2b
Properties: 0x12
Read (0x02)
Notify (0x10)
Value Handle: 0x0014
Value UUID: Volume State (0x2b7d)
Handle: 0x0016
Value: 0817007e2b
Properties: 0x08
Write (0x08)
Value Handle: 0x0017
Value UUID: Volume Control Point (0x2b7e)
Handle: 0x0018
Value: 1219007f2b
Properties: 0x12
Read (0x02)
Notify (0x10)
Value Handle: 0x0019
Value UUID: Volume Flags (0x2b7f)
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #76 [hci0] 8.974068
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0019-0x001a
Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5 #77 [hci0] 8.974265
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
< ACL Data TX: Handle 65 flags 0x00 dlen 9 #78 [hci0] 8.974538
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0019
Error: Attribute Not Found (0x0a)
> ACL Data RX: Handle 65 flags 0x02 dlen 9 #79 [hci0] 8.988847
ATT: Find Information Request (0x04) len 4
Handle range: 0x0015-0x0015
< ACL Data TX: Handle 65 flags 0x00 dlen 10 #80 [hci0] 8.989252
ATT: Find Information Response (0x05) len 5
Format: UUID-16 (0x01)
Handle: 0x0015
UUID: Client Characteristic Configuration (0x2902)
> ACL Data RX: Handle 65 flags 0x02 dlen 9 #81 [hci0] 9.003972
ATT: Find Information Request (0x04) len 4
Handle range: 0x001a-0x001a
> HCI Event: Number of Completed Packets (0x13) plen 5 #82 [hci0] 9.004277
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
< ACL Data TX: Handle 65 flags 0x00 dlen 10 #83 [hci0] 9.004482
ATT: Find Information Response (0x05) len 5
Format: UUID-16 (0x01)
Handle: 0x001a
UUID: Client Characteristic Configuration (0x2902)
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #84 [hci0] 9.018849
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0052-0x0055
Attribute type: Include (0x2802)
< ACL Data TX: Handle 65 flags 0x00 dlen 9 #85 [hci0] 9.019478
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0052
Error: Attribute Not Found (0x0a)
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #86 [hci0] 9.034122
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0052-0x0055
Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5 #87 [hci0] 9.034473
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
< ACL Data TX: Handle 65 flags 0x00 dlen 27 #88 [hci0] 9.034769
ATT: Read By Type Response (0x09) len 22
Attribute data length: 21
Attribute data list: 1 entry
Handle: 0x0053
Value: 2a54001b02ec2f4ed6f9b4e546d83ebb12ff51
Properties: 0x2a
Read (0x02)
Write (0x08)
Indicate (0x20)
Value Handle: 0x0054
Value UUID: Vendor specific (51ff12bb-3ed8-46e5-b4f9-d64e2fec021b)
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #89 [hci0] 9.048871
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0054-0x0055
Attribute type: Characteristic (0x2803)
< ACL Data TX: Handle 65 flags 0x00 dlen 9 #90 [hci0] 9.049362
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0054
Error: Attribute Not Found (0x0a)
> ACL Data RX: Handle 65 flags 0x02 dlen 9 #91 [hci0] 9.064047
ATT: Find Information Request (0x04) len 4
Handle range: 0x0055-0x0055
> HCI Event: Number of Completed Packets (0x13) plen 5 #92 [hci0] 9.064257
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
< ACL Data TX: Handle 65 flags 0x00 dlen 10 #93 [hci0] 9.064784
ATT: Find Information Response (0x05) len 5
Format: UUID-16 (0x01)
Handle: 0x0055
UUID: Client Characteristic Configuration (0x2902)
> HCI Event: LE Meta Event (0x3e) plen 11 #94 [hci0] 9.079383
LE Remote Connection Parameter Request (0x06)
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Min connection interval: 50.00 msec (0x0028)
Max connection interval: 50.00 msec (0x0028)
Connection latency: 0 (0x0000)
Supervision timeout: 5000 msec (0x01f4)
> ACL Data RX: Handle 65 flags 0x02 dlen 7 #95 [hci0] 9.079398
ATT: Exchange MTU Request (0x02) len 2
Client RX MTU: 517
< HCI Command: LE Remote Connection Parameter Request Reply (0x08|0x0020) plen 14 #96 [hci0] 9.079523
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Min connection interval: 50.00 msec (0x0028)
Max connection interval: 50.00 msec (0x0028)
Connection latency: 0 (0x0000)
Supervision timeout: 5000 msec (0x01f4)
Min connection length: 0.000 msec (0x0000)
Max connection length: 0.000 msec (0x0000)
< ACL Data TX: Handle 65 flags 0x00 dlen 7 #97 [hci0] 9.079843
ATT: Exchange MTU Response (0x03) len 2
Server RX MTU: 517
> HCI Event: Command Complete (0x0e) plen 6 #98 [hci0] 9.082909
LE Remote Connection Parameter Request Reply (0x08|0x0020) ncmd 1
Status: Success (0x00)
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
> HCI Event: Number of Completed Packets (0x13) plen 5 #99 [hci0] 9.101593
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 9 #100 [hci0] 9.123828
ATT: Write Request (0x12) len 4
Handle: 0x0055 Type: Client Characteristic Configuration (0x2902)
Data: 0200
Indication (0x02)
< ACL Data TX: Handle 65 flags 0x00 dlen 5 #101 [hci0] 9.125063
ATT: Write Response (0x13) len 0
> ACL Data RX: Handle 65 flags 0x02 dlen 79 #102 [hci0] 9.172153
ATT: Write Request (0x12) len 74
Handle: 0x0054 Type: Vendor specific (1b02ec2f-4ed6-f9b4-e546-d83ebb12ff51)
Data: 474554202f6170692f6e616d65204547575454502f312e310d0a436f6e74656e742d547970653a20746578742f6a736f6e0d0a436f6e74656e742d4c656e6774683a20300d0a0d0a
> HCI Event: LE Meta Event (0x3e) plen 10 #103 [hci0] 9.172433
LE Connection Update Complete (0x03)
Status: Success (0x00)
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Connection interval: 50.00 msec (0x0028)
Connection latency: 0 (0x0000)
Supervision timeout: 5000 msec (0x01f4)
> HCI Event: Number of Completed Packets (0x13) plen 5 #104 [hci0] 9.300969
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 1
< ACL Data TX: Handle 65 flags 0x00 dlen 5 #105 [hci0] 9.955385
ATT: Write Response (0x13) len 0
< ACL Data TX: Handle 65 flags 0x00 dlen 121 #106 [hci0] 9.955865
ATT: Handle Value Indication (0x1d) len 116
Handle: 0x0054 Type: Vendor specific (1b02ec2f-4ed6-f9b4-e546-d83ebb12ff51)
Data: 45475754502f312e3120323030204f4b0d0a4c6f636174696f6e3a202f6170692f6e616d650d0a436f6e74656e742d547970653a20746578742f6a736f6e0d0a436f6e74656e742d4c656e6774683a2032380d0a0d0a7b226e616d65223a2022487567652057616c6e7574204861776b227d
> ACL Data RX: Handle 65 flags 0x02 dlen 5 #107 [hci0] 10.021461
ATT: Handle Value Confirmation (0x1e) len 0
> HCI Event: Number of Completed Packets (0x13) plen 5 #108 [hci0] 10.021738
Num handles: 1
Handle: 65 Address: 61:8A:88:05:15:A0 (Resolvable)
Count: 2
We can note that on Android there is no paring request, and there is thus no failed authentication.
using bluetoothctl in the bluethooth container some interesting stuff appears. Apparently windows sends a request to pair using a passkey. This does not happen when pairing from mobile.
One possibility that seems to work is to adapt the bluethoot agent in different ways. The NoInputNoOutput agent capability seems important. Possibly the agent should not allow for pairing.
When adding this the computer got paired to the raspberry pi (even spotify now seems to send to the rpi via some sound GATT standard)
Some windows specific ble info: https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/bluetooth-swift-pair
slow progress - but it is def related to the fact that windows want to properly pair with the gw (the whole dialog thing going on). If that succeeds then the connection is stable.
The problem is the actual paring - this does not seem to happen in the usual smooth way bur rather manual codes need to be exchanged. This seems to be related to what agent for authentication is used on the rpi. https://raspberrypi.stackexchange.com/questions/107400/what-bluetoothctl-agents-are-there
Successfull pairing has been done with the tool blutetoothctl
agent command. Problem is that this in interactive tool intended for diagnostics and testing. The agent will not run if this tool is not executed via ssh etc.
Some attempts have been made to install an agent via bluez-tools (bt-agent) it seems to work but no paring has been successful. Windows at mist shows a dialog "tap to configure your bluethoot device" but after that nothing happens.
I also tried to write my own agent based on https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/bluezutils.py This also seemed to work but no pairing has been done using the NoInputNoOutput
capability
Another step in this direction worth trying is to use https://github.com/spacecheese/bluez_peripheral where the whole service can be build... yay third implementation...
There is also information from m$ regarding their swift paring https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/bluetooth-swift-pair
All in all productive but no real solution up and working as of yet...
Windows now seems to give a connection failed regardless of agent.... baybe a reboot is in order soon...
Reboot did not help much. The device seemed to remember the connection to the computer in some strange way.
This could be fixed using bluetoothctl remove device.
Interestingly after this the custom ble agent worked and the computer and pi could be paired normally.
Another interesting find is the use of custom ble agent in the balena Bluetooth image: https://github.com/balena-labs-projects/bluetooth
They seem to have a pretty massive block for ble - unfortunately based on python 3.9 it seems. nevertheless this could be an important inspiration.
Yes, this finally seems to work ok on Windows 11. There could be some quirks to iron out for cases like rebooting the gateway, computer, and removing the gateway from the computer ble connections.
It also seems to work well on android chrome.
hciconfig is a handy tool https://manpages.ubuntu.com/manpages/trusty/en/man8/hciconfig.8.html
so the final thing is managing when either side unpairs the other. If windows unpairs the windows computer is remembered as paired on the gw (for some reason - but we can imagine removal happens when the laptop is not near the gw so the case still remains) This unfortunately means that a new pairing will not be allowed (this seems to be for security reasons).
The option now is to remove the computer from the gw. But the problem is when to do this. As we do not have a button for ble (yet) I opted to do this at start of the ble service. When booting the gw will check for any paired devices and try to reconnect to them, if reconnection fails then the device will be removed.
The downside is that you can end up with a computer that thinks it is still paired to the gw. This can happen if eg the gw is rebooted and the computer is not near the gw startup. The user will then need to remove the gw from the paired ble devices and then it should work.
When we get a button this behavior can be moved to some paring mode initiated by a button press.
So in general this seems to work. There are some scenarios:
Scenarios 4 and 5 are the tricky ones. It seems that windows sometimes remembers the gw even that it is removed (this can bee seen in the ble tray as a connection coming and going and you need to click the gateway label that shows (this is not very intuitive) Possibly this can be solved by turning ble on and off - or by looking at more windows specific pairing stuff as in the documentation.
So the gw does not seem to be able to reconnect when the gw is rebooted (works fine if the service is just restored) This could be caused by ble services not fully started yet etc. Have tried some different approaches here including simply just waiting for 60 seconds but it does not seem to change things.
So there seems to be no good way of actually coping with the need for repairing of a device when it has been removed from windows. This seems to be the major reason for having a button on all ble devices. You can throw away the old pairings and start over from scratch.
My proposal now is that we have some special commands in the ble client for this. Then you can at least log in via an android phone and hit reset. Then you should be able to pair again on Windows.
But there is a button for BLE on the RAK GW, Helium FW. Maybe this can be utilised?
Yes that we will definitely do. Basically that is why it is there :)
Some more tests. I had an hypotheses that pairing is caused by additional ble services added as a default by bluez in the balena host os. Removing all plugin services seem to remove the need for pairing in windows.
The fix is somewhat ugly and involves stopping ble in the host os, and then restarting it in the container whit the correct parameters. This seems somewhat cumbersome and inconvenient.
There should be a dropin configuration available but idk where and how this should be edited. Tried to create it in /lib/systemd/system/bluetooth.service.d/bluetooth.service
but that did not seem to make any change.
some info here: https://forums.balena.io/t/balena-sound-bluetooth-volume-synchronisation/40901/25
At this point ther have been some instances where the connection works well, but also some where the subscription does not work and is terminated after ~30 seconds. More testing is likely needed here preferably on a computer that has not been fiddled with as much as mine...
This seems to work very well. I will create a new branch where this will be cleaned up to the current solution and then it will be merged with beta.
Some concluing remarks. It seems the agent is needed on windows and it is in general a good idea to disable Bluetooth (and enable) to get a reset ble driver on windows.
phew....
for some reason this has stopped working again (at least on my computer) basically from one build to another (and going back does not seem to help). Debugging the ble suggests windows terminates the connection with a timeout for some reason.
> HCI Event: Disconnect Complete (0x05) plen 4 #53 [hci0] 22.860223
Status: Success (0x00)
Handle: 64 Address: A4:F9:33:E4:CD:2E (Intel Corporate)
Reason: Connection Timeout (0x08)
@ MGMT Event: Device Disconnected (0x000c) plen 8 {0x0001} [hci0] 22.860339
LE Address: A4:F9:33:E4:CD:2E (Intel Corporate)
Reason: Connection timeout (0x01)
and now it seems to work again without any apparent changes... did some changes that really should not relate to this...
I suspect it could be a good idea to pin docker base images and versions of python libs to specific versions - this could possibly be a vulnerability in the future and also provides stability.
Interesting flags to investigate:
/etc/systemd/system/dbus-org.bluez.service
ControllerMode
, can be dual, le and something else more btmon this time from a windows 11 computer running a MediaTek bluetooth device
Bluetooth monitor ver 5.66
= Note: Linux version 5.15.92-v8 (aarch64) 0.258516
= Note: Bluetooth subsystem version 2.22 0.258534
= New Index: E4:5F:01:9A:BF:6C (Primary,UART,hci0) [hci0] 0.258544
= Open Index: E4:5F:01:9A:BF:6C [hci0] 0.258553
= Index Info: E4:5F:01:9A:BF:6C (Cypress Semiconductor) [hci0] 0.258559
@ MGMT Open: bluetoothd (privileged) version 1.21 {0x0001} 0.258564
> HCI Event: LE Meta Event (0x3e) plen 19 #1 [hci0] 8.612756
LE Connection Complete (0x01)
Status: Success (0x00)
Handle: 65
Role: Peripheral (0x01)
Peer address type: Public (0x00)
Peer address: 2C:3B:70:6D:48:0E (OUI 2C-3B-70)
Connection interval: 60.00 msec (0x0030)
Connection latency: 0 (0x0000)
Supervision timeout: 9600 msec (0x03c0)
Central clock accuracy: 0x01
@ MGMT Event: Device Connected (0x000b) plen 13 {0x0001} [hci0] 8.612866
LE Address: 2C:3B:70:6D:48:0E (OUI 2C-3B-70)
Flags: 0x00000000
Data length: 0
> HCI Event: Vendor (0xff) plen 5 #2 [hci0] 8.612768
55 00 00 41 00 U..A.
< HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2 #3 [hci0] 8.613210
Handle: 65 Address: 2C:3B:70:6D:48:0E (OUI 2C-3B-70)
> HCI Event: Command Status (0x0f) plen 4 #4 [hci0] 8.613612
LE Read Remote Used Features (0x08|0x0016) ncmd 1
Status: Success (0x00)
> HCI Event: Command Complete (0x0e) plen 14 #5 [hci0] 8.613734
LE Read Remote Used Features (0x08|0x0016) ncmd 1
Status: Success (0x00)
00 00 00 00 00 00 00 00 00 00 ..........
@ RAW Open: btmon (privileged) version 2.22 {0x0002} 8.616263
@ RAW Close: btmon {0x0002} 8.616319
> ACL Data RX: Handle 65 flags 0x02 dlen 7 #6 [hci0] 8.695480
ATT: Exchange MTU Request (0x02) len 2
Client RX MTU: 527
> HCI Event: LE Meta Event (0x3e) plen 12 #7 [hci0] 8.696124
LE Read Remote Used Features (0x04)
Status: Success (0x00)
Handle: 65 Address: 2C:3B:70:6D:48:0E (OUI 2C-3B-70)
Features: 0x3d 0x00 0x00 0x00 0x00 0x00 0x00 0x00
LE Encryption
Extended Reject Indication
Peripheral-initiated Features Exchange
LE Ping
LE Data Packet Length Extension
< ACL Data TX: Handle 65 flags 0x00 dlen 7 #8 [hci0] 8.697363
ATT: Exchange MTU Response (0x03) len 2
Server RX MTU: 517
< ACL Data TX: Handle 65 flags 0x00 dlen 7 #9 [hci0] 8.697490
ATT: Exchange MTU Request (0x02) len 2
Client RX MTU: 517
> HCI Event: LE Meta Event (0x3e) plen 11 #10 [hci0] 8.876019
LE Data Length Change (0x07)
Handle: 65 Address: 2C:3B:70:6D:48:0E (OUI 2C-3B-70)
Max TX octets: 251
Max TX time: 2120
Max RX octets: 251
Max RX time: 328
> ACL Data RX: Handle 65 flags 0x02 dlen 13 #11 [hci0] 8.935668
ATT: Find By Type Value Request (0x06) len 8
Handle range: 0x0001-0xffff
Attribute type: Primary Service (0x2800)
UUID: Generic Attribute Profile (0x1801)
> ACL Data RX: Handle 65 flags 0x02 dlen 7 #12 [hci0] 8.936018
ATT: Exchange MTU Response (0x03) len 2
Server RX MTU: 527
> HCI Event: Number of Completed Packets (0x13) plen 5 #13 [hci0] 8.936162
Num handles: 1
Handle: 65 Address: 2C:3B:70:6D:48:0E (OUI 2C-3B-70)
Count: 2
< ACL Data TX: Handle 65 flags 0x00 dlen 9 #14 [hci0] 8.936661
ATT: Find By Type Value Response (0x07) len 4
Handle range: 0x0008-0x0011
< ACL Data TX: Handle 65 flags 0x00 dlen 11 #15 [hci0] 8.936829
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0001-0xffff
Attribute type: Server Supported Features (0x2b3a)
> ACL Data RX: Handle 65 flags 0x02 dlen 13 #16 [hci0] 9.055668
ATT: Find By Type Value Request (0x06) len 8
Handle range: 0x0012-0xffff
Attribute type: Primary Service (0x2800)
UUID: Generic Attribute Profile (0x1801)
> ACL Data RX: Handle 65 flags 0x02 dlen 9 #17 [hci0] 9.056059
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0001
Error: Attribute Not Found (0x0a)
> HCI Event: Number of Completed Packets (0x13) plen 5 #18 [hci0] 9.056167
Num handles: 1
Handle: 65 Address: 2C:3B:70:6D:48:0E (OUI 2C-3B-70)
Count: 2
< ACL Data TX: Handle 65 flags 0x00 dlen 9 #19 [hci0] 9.056396
ATT: Error Response (0x01) len 4
Find By Type Value Request (0x06)
Handle: 0x0012
Error: Attribute Not Found (0x0a)
< ACL Data TX: Handle 65 flags 0x00 dlen 11 #20 [hci0] 9.056615
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x0001-0xffff
Attribute group type: Primary Service (0x2800)
> ACL Data RX: Handle 65 flags 0x02 dlen 11 #21 [hci0] 9.235642
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0008-0x0011
Attribute type: Characteristic (0x2803)
> HCI Event: Number of Completed Packets (0x13) plen 5 #22 [hci0] 9.235925
Num handles: 1
Handle: 65 Address: 2C:3B:70:6D:48:0E (OUI 2C-3B-70)
Count: 2
< ACL Data TX: Handle 65 flags 0x00 dlen 34 #23 [hci0] 9.236219
ATT: Read By Type Response (0x09) len 29
Attribute data length: 7
Attribute data list: 4 entries
Handle: 0x0009
Value: 200a00052a
Properties: 0x20
Indicate (0x20)
Value Handle: 0x000a
Value UUID: Service Changed (0x2a05)
Handle: 0x000c
Value: 0a0d00292b
Properties: 0x0a
Read (0x02)
Write (0x08)
Value Handle: 0x000d
Value UUID: Client Supported Features (0x2b29)
Handle: 0x000e
Value: 020f002a2b
Properties: 0x02
Read (0x02)
Value Handle: 0x000f
Value UUID: Database Hash (0x2b2a)
Handle: 0x0010
Value: 0211003a2b
Properties: 0x02
Read (0x02)
Value Handle: 0x0011
Value UUID: Server Supported Features (0x2b3a)
< HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15 #24 [hci0] 10.131054
Min advertising interval: 95.625 msec (0x0099)
Max advertising interval: 152.500 msec (0x00f4)
Type: Connectable undirected - ADV_IND (0x00)
Own address type: Public (0x00)
Direct address type: Public (0x00)
Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
Channel map: 37, 38, 39 (0x07)
Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
> HCI Event: Command Complete (0x0e) plen 4 #25 [hci0] 10.131517
LE Set Advertising Parameters (0x08|0x0006) ncmd 1
Status: Success (0x00)
< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1 #26 [hci0] 10.131588
Advertising: Enabled (0x01)
> HCI Event: Command Complete (0x0e) plen 4 #27 [hci0] 10.132012
LE Set Advertise Enable (0x08|0x000a) ncmd 1
Status: Success (0x00)
> HCI Event: Number of Completed Packets (0x13) plen 5 #28 [hci0] 18.836679
Num handles: 1
Handle: 65 Address: 2C:3B:70:6D:48:0E (OUI 2C-3B-70)
Count: 1
> HCI Event: Disconnect Complete (0x05) plen 4 #29 [hci0] 18.836698
Status: Success (0x00)
Handle: 65 Address: 2C:3B:70:6D:48:0E (OUI 2C-3B-70)
Reason: Connection Timeout (0x08)
@ MGMT Event: Device Disconnected (0x000c) plen 8 {0x0001} [hci0] 18.836822
LE Address: 2C:3B:70:6D:48:0E (OUI 2C-3B-70)
Reason: Connection timeout (0x01)
It ends with a time out for some reason. In the client the call to getPrimaryService seems be where it gets stuck...
Try this: /etc/bluetooth/main.conf the option ReverseServiceDiscovery.
ReverseServiceDiscovery = false
In general the web-ble works poorly on windows 11 and chrome browsers.
It seems there are frequent disconnects (this causes messages to not be delivered and responses to not be triggered). Even if just connecting and doing nothing the connection does not seem stable.
Some links for further reading: https://developer.apple.com/library/archive/qa/qa1931/_index.html
It seems the approach is to set the connection parameters.
This can maybe be done programmatically: https://github.com/colin-guyon/py-bluetooth-utils/blob/416a8925682d6ee4ad607936d897646a3a83a331/bluetooth_utils.py#L233
or in the container os itself (though not supported in image python:3.11)
https://github.com/NebraLtd/hm-config/blob/master/start-gateway-config.sh
One interesting note is that the above Nebra container also needs to wait for dbus to respond (we also have this problem but the container is simply restarted until it works it seems)