Bluetooth not working ona RPI3B+

I have a problem getting bluetooth running on a DietPi v8.21.1 system on a Raspberry 3B+.
The bluetooth service runs, rfkill (after installing) shows everything “unblocked”, power is on. So, everything I read about bluetoothctl power off / on and rfkill unblock etc. - I already tried it.
systemctl status bluetooth gives me a lot of red messages:

Sep 19 18:21:43 benserver bluetoothd[1321]: profiles/audio/vcp.c:vcp_init() D-Bus experimental not enabled
Sep 19 18:21:43 benserver bluetoothd[1321]: src/plugin.c:plugin_init() Failed to init vcp plugin
Sep 19 18:21:43 benserver bluetoothd[1321]: profiles/audio/mcp.c:mcp_init() D-Bus experimental not enabled
Sep 19 18:21:43 benserver bluetoothd[1321]: src/plugin.c:plugin_init() Failed to init mcp plugin
Sep 19 18:21:43 benserver bluetoothd[1321]: profiles/audio/bap.c:bap_init() D-Bus experimental not enabled
Sep 19 18:21:43 benserver bluetoothd[1321]: src/plugin.c:plugin_init() Failed to init bap plugin
Sep 19 18:21:43 benserver bluetoothd[1321]: Bluetooth management interface 1.22 initialized
Sep 19 18:21:43 benserver bluetoothd[1321]: profiles/sap/server.c:sap_server_register() Sap driver initialization failed.
Sep 19 18:21:43 benserver bluetoothd[1321]: sap-server: Operation not permitted (1)
Sep 19 18:21:45 benserver bluetoothd[1321]: Failed to set mode: Authentication Failed (0x05)

Almost allof them are gone, when I change the service to start the daemon with the option --experimental via dietpi-services. Still not working.

Required Information

  • DietPi version | G_DIETPI_VERSION_CORE=8 G_DIETPI_VERSION_SUB=21 G_DIETPI_VERSION_RC=1 G_GITBRANCH='master' G_GITOWNER='MichaIng'
  • Distro version | bookworm 0
  • Kernel version | Linux DietPi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
  • Architecture | arm64
  • SBC model | RPi 3 Model B+ (aarch64)
  • Power supply used | 5V 2A
  • SD card used | SanDisk Extreme Pro A2

Additional Information (if applicable)

  • Can this issue be replicated on a fresh installation of DietPi?
    • No, there the output of systemctl status bluetooth is similar:
      Sep 18 19:28:54 DietPi bluetoothd[369]: src/plugin.c:plugin_init() Failed to init vcp plugin
      Sep 18 19:28:54 DietPi bluetoothd[369]: profiles/audio/mcp.c:mcp_init() D-Bus experimental not enabled
      Sep 18 19:28:54 DietPi bluetoothd[369]: src/plugin.c:plugin_init() Failed to init mcp plugin
      Sep 18 19:28:54 DietPi bluetoothd[369]: profiles/audio/bap.c:bap_init() D-Bus experimental not enabled
      Sep 18 19:28:54 DietPi bluetoothd[369]: src/plugin.c:plugin_init() Failed to init bap plugin
      Sep 18 19:28:54 DietPi bluetoothd[369]: Bluetooth management interface 1.22 initialized
      Sep 18 19:28:54 DietPi bluetoothd[369]: profiles/sap/server.c:sap_server_register() Sap driver initialization failed.
      Sep 18 19:28:54 DietPi bluetoothd[369]: sap-server: Operation not permitted (1)
      Sep 18 19:28:54 DietPi bluetoothd[369]: Failed to set privacy: Rejected (0x0b)
      Sep 18 19:28:58 DietPi bluetoothd[369]: src/adv_monitor.c:btd_adv_monitor_power_down() Unexpected NULL btd_adv_monitor_manager object upon power down
      
      but bluetooth works. It’s the same hardware, just a fresh dietpi installation a different card. So a hardware defect can be ruled out.

Steps to reproduce

  1. Switch on bluetooth via dietpi-config
  2. start bluetoothctl and scan on

Expected behaviour

  • list of bluetooth device in proximity

Actual behaviour

  • error message Failed to start discovery: org.bluez.Error.InProgress

Extra details

  • find /proc/device-tree/ -name status -exec echo -ne '\n{}: ' \; -exec cat {} \; give same results on both systems
  • on the not working system, there is a wifi hotspot installed and this software list:
    [ ] 0    OpenSSH Client: Feature-rich SSH, SFTP and SCP client                                                     
    [ ] 5    ALSA: Advanced Linux Sound Architecture                                                                  
    [ ] 6    X.Org X Server: aka X11 - X Window System implementation                                                
    [ ] 17   Git: Clone and manage Git repositories locally                                                            
    [ ] 103  DietPi-RAMlog: Makes /var/log a RAM disk, preserves file structure on reboot
    [ ] 105  OpenSSH Server: Feature-rich SSH server with SFTP and SCP support                                          
    [ ] 113  Chromium: web browser for desktop or autostart                                                             
    [ ] 123  Mosquitto: MQTT messaging broker                                                                           
    [ ] 130  Python 3: Runtime system, pip package installer and development headers                                    
    [ ] 157  Home Assistant: Open source home automation platform                        
    

Ok, on the second system I installed the same software as on the first - bluetooth still works. I don’t know what else to try?

Is the ttyAMA0 serial console disabled in dietpi-config > Advanced Options > Serial/UART? And you did not switch Bluetooth over to the mini UART ttyS0, did you? This can be done with a device tree overlay entry like dtoverlay=bt-miniuart or so in /boot/config.txt.

And what does the hciuart service say?

journalctl -u hciuart

No, none of that. boot/config.txt contains enable_uart=0 on both systems (the working and the not working). Both systems have no bt-miniuart or anything like that in there. And on both is ttyAMA0 console : [Off] and ttyS0 (mini UART) device : [Off] in dietpi-config.
And both show

Sep 19 20:24:33 benserver systemd[1]: Starting hciuart.service - Configure Bluetooth Modems connected by UART...
Sep 19 20:24:34 benserver btuart[375]: Cannot open directory '/etc/firmware': No such file or directory
Sep 19 20:24:34 benserver btuart[375]: Patch not found, continue anyway
Sep 19 20:24:34 benserver btuart[375]: bcm43xx_init
Sep 19 20:24:34 benserver btuart[375]: Set BDADDR UART: b8:27:eb:18:db:76
Sep 19 20:24:34 benserver btuart[375]: Set Controller UART speed to 3000000 bit/s
Sep 19 20:24:34 benserver btuart[375]: Device setup complete
Sep 19 20:24:34 benserver systemd[1]: Started hciuart.service - Configure Bluetooth Modems connected by UART.

(except different times and different numbers behind btuart).

In the meantime I also installed the wifi hotspot on the new system, still bluetooth works, after reboot.
So, that’s the way I’ll go: I’ll reinstall everything I need and had on the old system. Of course, it doesn’t make sense any more for me to search the error on the old system, if I then have a fully configured new one anyway. I’ll still check bluetooth after every installation / configuration step, so in case I stumble across that very moment, where bluetooth stops working on the new system, of course, I’ll report here.
And of course, I’m still open for some solution ideas.

Thank You very much!

1 Like

I’ve also no idea then what the issue on the is system is/was. Let’s not further waste time investigating it if the one works, until you our someone else runs into the same issue again.

1 Like

I found it out. Although very embarrassing, I report as promised:
It was my very own script, started as a service at system start, which opens /dev/ttyAMA0.
So, as I read here, this is connected to bluetooth on the RPi3B+. I used this script before on a Pi Zero W 2, there it worked, but maybe because I swiched off bluetooth there.

1 Like