Open joyhope opened 10 months ago
I found the mouse required encryption link. But I have no idea how to implement it with Bumble Library. Is there any encryption-related demo for the connection?
All the Bumble connect processes will stop on the HCI_LE_EXTENDED_CREATE_CONNECTION_COMMAND.
I am not sure whether it is caused by the USB dongle or other reasons.
=== Connecting to FC:D0:33:FF:2F:20... DEBUG:bumble.host:### HOST -> CONTROLLER: HCI_LE_CREATE_CONNECTION_COMMAND: le_scan_interval: 96 le_scan_window: 96 initiator_filter_policy: 0 peer_address_type: RANDOM_DEVICE_ADDRESS peer_address: FC:D0:33:FF:2F:20 own_address_type: RANDOM connection_interval_min: 12 connection_interval_max: 24 max_latency: 0 supervision_timeout: 72 min_ce_length: 0 max_ce_length: 0 DEBUG:bumble.host:### CONTROLLER -> HOST: HCI_COMMAND_STATUS_EVENT: status: PENDING num_hci_command_packets: 2 command_opcode: HCI_LE_CREATE_CONNECTION_COMMAND
I found the mouse required encryption link. But I have no idea how to implement it with Bumble Library. Is there any encryption-related demo for the connection?
If you need an encrypted connection, you should 1/ pair the two devices that communicate (you can use the pair.py
app for that), then, once you've paired and the pairing keys are stored in the key store (you only need to pair once, the key store will remember the keys), you can enable encryption on the connection by calling await connection.encrypt()
All the Bumble connect processes will stop on the HCI_LE_EXTENDED_CREATE_CONNECTION_COMMAND.
I am not sure whether it is caused by the USB dongle or other reasons.
=== Connecting to FC:D0:33:FF:2F:20... DEBUG:bumble.host:### HOST -> CONTROLLER: HCI_LE_CREATE_CONNECTION_COMMAND: le_scan_interval: 96 le_scan_window: 96 initiator_filter_policy: 0 peer_address_type: RANDOM_DEVICE_ADDRESS peer_address: FC:D0:33:FF:2F:20 own_address_type: RANDOM connection_interval_min: 12 connection_interval_max: 24 max_latency: 0 supervision_timeout: 72 min_ce_length: 0 max_ce_length: 0 DEBUG:bumble.host:### CONTROLLER -> HOST: HCI_COMMAND_STATUS_EVENT: status: PENDING num_hci_command_packets: 2 command_opcode: HCI_LE_CREATE_CONNECTION_COMMAND
Most likely here you're trying to connect to a random address that doesn't exist. If the device you're connecting to has LE privacy enabled (most phones and devices would have), their BLE random address changes periodically (typically every 15 minutes or so, plus every time a connection is established). So unless you're paired the devices (in which case the scanner can resolve those changing random addresses back to a fixed one), you'll need to scan and find out the current address of your target device each time before connecting to it.
I tried pair
`sudo ../venv/bin/python pair.py --mode le --sc true --mitm false device1.json usb:0 DF:85:B6:69:32:A6 <<< connecting to HCI... <<< connected === Connecting to DF:85:B6:69:32:A6... <<< Connection: Connection(handle=0x0E01, role=CENTRAL, address=DF:85:B6:69:32:A6) ----------------------------------- Pairing starting ***----------------------------------- Traceback (most recent call last): File "...bumble/apps/pair.py", line 404, in pair await connection.pair() File "...bumble/venv/lib/python3.10/site-packages/bumble/device.py", line 811, in pair return await self.device.pair(self) File "...bumble/venv/lib/python3.10/site-packages/bumble/device.py", line 2661, in pair return await self.smp_manager.pair(connection) File "...bumble/venv/lib/python3.10/site-packages/bumble/smp.py", line 1970, in pair return await session.pair() File "...bumble/venv/lib/python3.10/site-packages/bumble/smp.py", line 1288, in pair await self.connection.abort_on('disconnection', self.pairing_result) asyncio.exceptions.CancelledError: abort: disconnection event occurred.
During handling of the above exception, another exception occurred: `
I found the mouse will disconnect , and make active connect aagain. (I am not sure for this.)
If runs without connect
sudo ../venv/bin/python pair.py device1.json usb:0 <<< connecting to HCI... <<< connected ^C
Nothing happened.
i use scan find the address, and then make pare. I test two different logi mice, the result is the same. I'm pretty sure all the mice with security connection features.
Bumble is the most easy to use tool, I hope it could work.
I try to connect Logica Master 3, the process is stopped.
I am not know which kind of problem happened.