Jakeler / ble-serial

"RFCOMM for BLE" a UART over Bluetooth low energy (4+) bridge for Linux, Mac and Windows
https://blog.ja-ke.tech/tags/#bluetooth
MIT License
251 stars 37 forks source link

No Route to host #38

Closed drannex42 closed 2 years ago

drannex42 commented 2 years ago

Describe the bug I am running your script ble-scan and I am seeing my device (a OnePlus 5T), and after plugging in the ble-serial -d 94:65:2d:db:d8:c4 to connect it keeps telling me that there is Bluetooth connection failed: [org.bluez.Error.Failed] No route to host. I attempted to try this same thing with getting the characteristic using a deep scan, but I am receiving the same issue.

Log messages

18:35:56.592 | DEBUG | main.py: Running: Namespace(adapter='hci0', addr_type='public', binlog=False, device='94:65:2D:DB:D8:C4', filename=None, mode='rw', mtu=20, port='/tmp/ttyBLE', read_uuid=None, timeout=5.0, verbose=True, write_uuid=None)
18:35:56.593 | DEBUG | selector_events.py: Using selector: EpollSelector
18:35:56.596 | INFO | linux_pty.py: Slave created on /tmp/ttyBLE -> /dev/pts/0
18:35:56.596 | INFO | ble_interface.py: Receiver set up
18:35:56.606 | INFO | ble_interface.py: Trying to connect with 94:65:2D:DB:D8:C4
18:35:57.352 | ERROR | main.py: Bluetooth connection failed: [org.bluez.Error.Failed] No route to host
18:35:57.353 | WARNING | main.py: Shutdown initiated
18:35:57.353 | INFO | linux_pty.py: Serial reader and symlink removed
18:35:57.354 | INFO | main.py: Shutdown complete.

Setup:

drannex42 commented 2 years ago

I'm closing this as I solved the issue, I had enabled an SP interface to start with a compat version of bluez for access to the RFCOMM on another application. (I really should have remembered....)

For anyone else: Just modify your /usr/lib/systemd/system/bluetooth.service and replace your ExecStart line with:

ExecStart=/usr/lib/bluetooth/bluetoothd -d
#ExecStart=/usr/lib/bluetooth/bluetoothd -C
#ExecStartPost=/usr/bin/sdptool add SP