Hi, I need to enable Bluetooth on my dietpi (rpi 4) in order to expose a bluetooth device, how can I do so? I have it enabled in the advanced settings, but I don’t think it’s working. Here’s the logs:
root@DietPi:~# journalctl -u bluetooth -u hciuart
-- Journal begins at Fri 2022-09-02 16:24:25 BST, ends at Fri 2022-09-02 16:25:33 BST. --
Sep 02 16:24:26 DietPi systemd[1]: Starting Configure Bluetooth Modems connected by UART...
Sep 02 16:24:33 DietPi btuart[454]: bcm43xx_init
Sep 02 16:24:33 DietPi btuart[454]: Flash firmware /lib/firmware/brcm/BCM4345C0.hcd
Sep 02 16:24:33 DietPi btuart[454]: Set Controller UART speed to 3000000 bit/s
Sep 02 16:24:33 DietPi btuart[454]: Device setup complete
Sep 02 16:24:33 DietPi systemd[1]: Started Configure Bluetooth Modems connected by UART.
Sep 02 16:24:33 DietPi systemd[1]: Starting Bluetooth service...
Sep 02 16:24:33 DietPi bluetoothd[831]: Bluetooth daemon 5.55
Sep 02 16:24:33 DietPi systemd[1]: Started Bluetooth service.
Sep 02 16:24:33 DietPi bluetoothd[831]: Starting SDP server
Sep 02 16:24:33 DietPi bluetoothd[831]: Bluetooth management interface 1.21 initialized
Sep 02 16:24:33 DietPi bluetoothd[831]: profiles/sap/server.c:sap_server_register() Sap driver initialization failed.
Sep 02 16:24:33 DietPi bluetoothd[831]: sap-server: Operation not permitted (1)
Sep 02 16:24:34 DietPi bluetoothd[831]: Failed to set privacy: Rejected (0x0b)
Starting bluetoothd with the option “–noplugin=sap” by default (as
already suggested) would be one way to do it. Another way would be to
patch the bootstrap-configure file in the source root directory, to
change --enable-sap to --disable-sap.
Option 1 is to go into dietpi-services, select the bluetooth service and hit the edit button.
Then you search in the [Service] section for the line which begins with #ExexStart= (be carefull, there are also maybe some ExexStartPre and ExexStartPost statements, but you need just ExexStart=. I have no time now to have a look into the actual service.config, it’s probably something like #ExecStart=/usr/libexec/bluetooth/bluetoothd)
Delete the # and add at the end of this line --noplugin=sap.
Also, add one line above ExecStart=, now you are left withsomething like:
No, I’m just trying to enable it in order to get it to pair with an accessory (blinds motor) to later control with Node-Red.
Edit: I was able to pair it with devices (using bluetoothctl pair [mac address] and it worked. But for example, in NR, the device doesn’t show up when running the “scan bluetooth” option. They have in the docs to run
Alright I had now time to try this by myself on my RPi 4.
The service file is at /etc/systemd/system/bluetooth.target.wants/bluetooth.service. Edit the file and add the --noplugin=sap at the end of the ExecStart= line. This time it’s not needed to put another ExecStart in front.
Reload the service with
sudo systemctl daemon-reload && sudo service bluetooth restart