0

I have a raspberry pi b+ and i'm currently trying to establish connection over bluetooth with my pc/phone to send some data from a sensor.

I have plugged in a generic usb bluetooth dongle and it is detected by the OS since the GUI allows me to enable and disable bluetooth, and search for devices.

When I try to search for devices by GUI it doesn't find any, and when I try to set the raspi as visible i can't find it on any other device.

I tried configuring the bluetooth via terminal but i still failed. Whenever I try something using bluetoothctl I get

pi@raspberrypi:~ $ sudo bluetoothctl show
No default controller available

When trying to start hciuart and checking its status i get

pi@raspberrypi:~ $ sudo systemctl start hciuart.service
pi@raspberrypi:~ $ sudo systemctl status hciuart.service
* hciuart.service - Configure Bluetooth Modems connected by UART
   Loaded: loaded (/lib/systemd/system/hciuart.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
Condition: start condition failed at Wed 2021-10-27 03:26:33 BST; 4s ago
           `- ConditionFileNotEmpty=/proc/device-tree/soc/gpio@7e200000/bt_pins/brcm,pins was not met

Oct 27 03:13:36 raspberrypi systemd[1]: Condition check resulted in Configure Bluetooth Modems connected by UART being skipped.

I checked the folder /proc/device-tree/soc/gpio@7e200000/bt_pins/brcm,pins and it indeed doesn't exist, and it wont let me create it since it is under sys.

Also tried checking if it is being blocked by rfkill but it is not

pi@raspberrypi:~ $ rfkill list all
0: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no

My BlueZ version is 5.50.

EDIT: Trying some new debug commands

bluetoothctl list

Shows nothing as a result, even with sudo, so bluetoothctl is not detecting any devices.

 pi@raspberrypi:~ $ busctl tree org.bluez
`-/org
  `-/org/bluez

The tree shows no other devices, so bluez is not detecting it either. The bluetooth service status shows up and running:

    bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2021-05-07 16:07:58 BST; 5 months 21 days ago
     Docs: man:bluetoothd(8)
 Main PID: 447 (bluetoothd)
   Status: "Running"
    Tasks: 1 (limit: 877)
   CGroup: /system.slice/bluetooth.service
           └─447 /usr/lib/bluetooth/bluetoothd

May 07 16:07:55 raspberrypi systemd[1]: Starting Bluetooth service...
May 07 16:07:57 raspberrypi bluetoothd[447]: Bluetooth daemon 5.50
May 07 16:07:58 raspberrypi systemd[1]: Started Bluetooth service.
May 07 16:07:58 raspberrypi bluetoothd[447]: Starting SDP server
May 07 16:07:59 raspberrypi bluetoothd[447]: Bluetooth management interface 1.18 initialized

And when i try sudo btmon, these are the results

pi@raspberrypi:~ $ sudo btmon
Bluetooth monitor ver 5.50
= Note: Linux version 5.10.17+ (armv6l)                                0.540552
= Note: Bluetooth subsystem version 2.22                               0.540579
= New Index: 00:1A:7D:DA:71:12 (Primary,USB,hci0)               [hci0] 0.540587
@ MGMT Open: bluetoothd (privileged) version 1.18             {0x0001} 0.540601
@ MGMT Open: btmon (privileged) version 1.18                  {0x0002} 0.540864

So the dongle is being detected by de rpi, with the name of hci0 I also tried to see if it showed up with hcitool dev but it doesn't show any devices.

Also, when I try to check using hciconfig, the device shows up as follows:

pi@raspberrypi:~ $ hciconfig -a
hci0:   Type: Primary  Bus: USB
        BD Address: 00:1A:7D:DA:71:12  ACL MTU: 679:8  SCO MTU: 48:16
        DOWN
        RX bytes:1468 acl:0 sco:0 events:48 errors:0
        TX bytes:148 acl:0 sco:0 commands:48 errors:0
        Features: 0xbf 0x3e 0x4d 0xfa 0xdb 0x3d 0x7b 0xc7
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy:
        Link mode: SLAVE ACCEPT

It is showing as down, when I try to turn it back up, this is what it shows

pi@raspberrypi:~ $ hciconfig hci0 up
Can't init device hci0: Operation not permitted (1)
pi@raspberrypi:~ $ sudo hciconfig hci0 up
Can't init device hci0: Invalid argument (22)
pi@raspberrypi:~ $ sudo hciconfig hci0 reset
Can't init device hci0: Invalid argument (22)

So, the dongle is detected but it cant be initiated. I tried following this thread, which states that it is a bug present in the latest updates of the OS, and a downgrade to a specific kernel is needed to fix it. I tried to do it, like this

rpi-update 8234d5148aded657760e9ecd622f324d140ae891

But everytime I try it, the rpi gets bricked (doesn't even boot) and I have to install raspberry pi OS from scratch.

EDIT: Added journalctl report:

pi@raspberrypi:~/Documents $ journalctl -f -u bluetooth
-- Logs begin at Thu 2019-02-14 10:12:02 GMT. --
Oct 30 19:45:40 raspberrypi systemd[1]: Condition check resulted in Bluetooth service being skipped.
Oct 30 19:46:23 raspberrypi systemd[1]: Condition check resulted in Bluetooth service being skipped.
Oct 30 19:55:57 raspberrypi systemd[1]: Starting Bluetooth service...
Oct 30 19:55:58 raspberrypi bluetoothd[3453]: Bluetooth daemon 5.50
Oct 30 19:55:58 raspberrypi systemd[1]: Started Bluetooth service.
Oct 30 19:55:58 raspberrypi bluetoothd[3453]: Starting SDP server
Oct 30 19:55:58 raspberrypi bluetoothd[3453]: Bluetooth management interface 1.18 initialized
5
  • If your system is setup correctly you shouldn't need to use sudo with bluetoothctl. Which generation of B+ are you using? I think hciuart.service is just for the internal bluetooth devices (not USB attached devices). bluetoothctl list should give you a list of attached devices. busctl tree org.bluez should show what devices BlueZ sees. hci* are the dongles/adapters. To get more debug information use service bluetooth status, journalctl -f -u bluetooth, sudo busctl monitor org.bluez, and sudo btmon
    – ukBaz
    Oct 27 '21 at 7:24
  • @ukBaz Hi! well first of all, I have a 1 B+ (kinda old ik but it is what it is). I have tried the commands that u told me and updated the post with the results. Oct 28 '21 at 15:33
  • @ukBaz im sorry, I was doing some more testing, I have posted the updates now Oct 28 '21 at 18:41
  • Does lsusb report your device? Are there any error messages in journalctl?
    – ukBaz
    Oct 29 '21 at 7:22
  • @ukBaz lsusb reports the dongle as Bus 001 Device 005: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode). I also added the message that journalctl shows. Oct 30 '21 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.