Closed FD0815 closed 11 months ago
also this:
12-18 01:31:49.846 25404 27283 W ServiceManager: Permission failure: android.permission.BLUETOOTH from uid=10335 pid=11358
Indeed, in the permission list of the installed app android.permission.BLUETOOTH is missing, even though it's declared in the apk manifest. Could it be that on Android 12+ installs this gets snipped but it instead expects the android.permission.BLUETOOTH_SCAN (which is not declared here)?
The android.permission.BLUETOOTH_SCAN
permission should not be necessary, since Sideband doesn't actually do any scanning for devices, but only connects to RNodes that have already been discovered and paired via the system Bluetooth settings.
What is actually causing it is currently unclear to me, though. It has been working perfectly fine on Android 12 previously, but something in a recent release may have changed that, and I currently don't have an Android 12 device to test with - only 8.1, 9, 11, 13 and 14, which all work fine. The logs from the Pixel phones would definitely help!
Just to get the obvious out of the way, can you check that you actually enabled "Connect via Bluetooth" in Hardware -> RNode settings?
According to the Android SDK docs is correct. The android.permission.BLUETOOTH
permission is only needed on Android < 12 (API level 30 and below), and Sideband includes it in the manifest only for API level 30 and below. For API levels above, the other relevant Bluetooth permissions are included.
Since nobody else have chimed in, and I haven't heard anything else indicating this is actually a general bug for Android 12, I am closing this due to lack of feedback for now. Feel free to comment with more information if available.
I also have a problem with the connection (RAK4631 RNode, Samsung A52s - Android 14, Sideband 0.8.5) Logcat :
05-29 10:05:24.019 25432 25449 I BluetoothAdapter: BluetoothAdapter() : io.unsigned.sideband
05-29 10:05:24.024 15554 15289 D BluetoothAdapterService: getBondedDevices, remove custom devices:
05-29 10:05:24.059 25432 25449 I BluetoothSocket: connect() for device XX:XX:XX:XX:E8:52 called by pid: 25432
05-29 10:05:24.063 15554 15289 I bt_btif_sock: packages/modules/Bluetooth/system/btif/src/btif_sock.cc:329 btsock_connect: btsock_connect
05-29 10:05:24.063 15554 15289 I bt_btif_sock: packages/modules/Bluetooth/system/btif/src/btif_sock.cc:169 btif_sock_connection_logger: address=xx:xx:xx:xx:e8:52, role=2, state=2
05-29 10:05:24.064 15554 15632 W btm_acl : packages/modules/Bluetooth/system/stack/acl/btm_acl.cc:1863 BTM_ReadRemoteVersion: Unable to find active acl
05-29 10:05:24.064 15554 15626 W bt_l2cap: packages/modules/Bluetooth/system/main/bte_logmsg.cc:110 LogMsg: l2cu_enqueue_ccb CID: 0x005c priority: 2
05-29 10:05:24.067 15554 15632 I bluetooth: packages/modules/Bluetooth/system/gd/hci/acl_manager/acl_scheduler.cc:169 try_dequeue_next_operation: Pending connections is not empty; so sending next connection
05-29 10:05:24.067 15554 15632 W bluetooth: packages/modules/Bluetooth/system/gd/hci/acl_manager/classic_impl.h:353 actually_create_connection: xx:xx:xx:xx:e8:52 EnqueueCommand (classic_link)
05-29 10:05:30.513 15554 15632 W bluetooth: packages/modules/Bluetooth/system/main/shim/acl.cc:1642 OnConnectFail: Connection failed classic remote:xx:xx:xx:xx:e8:52 reason:PAGE_TIMEOUT
05-29 10:05:30.514 15554 15626 W bt_l2cap: packages/modules/Bluetooth/system/main/bte_logmsg.cc:110 LogMsg: l2cu_release_ccb: cid 0x005c in_use: 1 local_id:0
05-29 10:05:30.514 15554 15626 W bt_l2cap: packages/modules/Bluetooth/system/main/bte_logmsg.cc:110 LogMsg: l2cu_dequeue_ccb CID: 0x005c
05-29 10:05:30.514 15554 15626 W bt_l2cap: packages/modules/Bluetooth/system/stack/l2cap/l2c_api.cc:982 L2CA_DisconnectReq: L2CAP - no CCB for L2CA_disc_req, CID: 92
05-29 10:05:30.515 15554 15626 I bt_btif_sock: packages/modules/Bluetooth/system/btif/src/btif_sock.cc:169 btif_sock_connection_logger: address=xx:xx:xx:xx:e8:52, role=5, state=2
05-29 10:05:30.515 15554 15697 E bt_btif_sock_rfcomm: packages/modules/Bluetooth/system/btif/src/btif_sock_rfc.cc:171 find_rfc_slot_by_id: find_rfc_slot_by_id unable to find RFCOMM slot id: 243
05-29 10:05:30.515 15554 15626 I l2c_link: packages/modules/Bluetooth/system/stack/l2cap/l2c_link.cc:251 l2c_link_hci_conn_comp: Disconnecting link handle:0xffff status:HCI_ERR_PAGE_TIMEOUT
05-29 10:05:30.515 15554 15626 W btm_acl : packages/modules/Bluetooth/system/stack/acl/btm_acl.cc:627 btm_acl_removed: Unable to find active acl
05-29 10:05:30.516 15554 15671 D BluetoothDataManager: BluetoothDataManager :: notifyConnectionFailReason() is called
05-29 10:05:30.517 15554 15671 D BluetoothAdapterService: getRemoteInfoForBigData :: Get Remote Device Information
05-29 10:05:30.525 25432 25449 I sidebandservice: [2024-05-29 10:05:30] [Error] The contained exception was: Could not connect to any Bluetooth devices
It seems like connection is tried to be made using Classic Bluetooth instead of BLE ?
I'm able to connect to RNode using Serial Bluetooth Terminal
and nRFConnect
apps.
EDIT :
In my case the problem is probably caused by using RAK4631.
It have Nordic UART Service with UUID 6E400001-B5A3-F393-E0A9-E50E24DCCA9E, but AndroidBluetoothManager
from RNodeInterface
expects well-known SPP UUID 00001101-0000-1000-8000-00805F9B34FB. Anyway, both of them should be handled in Sideband as RAK4631 become supported board.
BLE host connection for RNodes aren't "officially" supported in core RNS or Sideband yet. Both nRF and ESP32-S3 based boards are BLE only, and until a BLE-capable interface driver is merged into RNS, those devices are serial/USB only for now.
(except for some cases, for example on Linux, where you can indeed use BLE, and with some of the development versions that already have partially implemented BLE support)
If you want to help out with the BLE support, take a look at the work going on over at the RNode Firmware CE repository!
OK, thanks for clarifications. I'm already looking at new RNode repo :)
The same issue occurs on multiple RNodes. (Heltec, Lora32 v1 -- and my friend has several T-beams that appear to have the same issue with both a Pixel 5 XL and a 2 XL, although I haven't looked at his logs yet.)
Pairing works. SB on either Linux or Windows can connect both via BT or USBserial; and on an older PH-1 running Android 10 everything works, so I don't think it's the RNodes.
Via BT serial terminal I can connect, this is the logcat output for the MAC address
All permissions for SB are granted and battery optimizations are off. Not sure if I missed any step.