No adapter bluetooth found, can't find hciuart service to run

Creating a bug report/issue

I have searched the existing open and closed issues

Required Information

  • DietPi version : 8.25
  • Distro version : bullseye
  • Kernel version : Linux DietPi 5.15.76-rockchip64 #22.08.8 SMP PREEMPT Sun Oct 30 10:57:32 CET 2022 aarch64 GNU/Linux
  • Architecture : arm64
  • SBC model : Generic Rockchip RK3399 (aarch64) (orange pi 4 lts)

Steps to reproduce

  1. Enable Bluetooth from dietpi-config
  2. See Bluetooth status
Jan 01 13:27:08 DietPi systemd[1]: Starting Bluetooth service...
Jan 01 13:27:08 DietPi bluetoothd[14297]: Bluetooth daemon 5.55
Jan 01 13:27:08 DietPi systemd[1]: Started Bluetooth service.
Jan 01 13:27:08 DietPi bluetoothd[14297]: Starting SDP server
Jan 01 13:27:08 DietPi bluetoothd[14297]: Bluetooth management interface 1.21 initialized
  1. Run sudo bluetoothctl
  2. Run show to list Bluetooth adapter, got No default controller available
  3. Try to check status hciuart service, got Unit hciuart.service could not be found

Expected behaviour

  • Bluetooth adapter found
  • hciuart service is exists

Actual behaviour

  • Bluetooth adapter not found
  • hciuart service not found

Extra details

I am installing the dietpi from this image Releases · Felipe Mazieri / orange · GitLab

weird, now i got

/boot/dietpi/func/dietpi-set_hardware: line 1277:  4353 Segmentation fault      modprobe "$i" 2> /dev/null

when trying to disable and enable the Bluetooth again

usually this means some file system or data corruption.

Is there any way to fix the corruption without wipe clean? My system is still fine.


update: I manually install the Bluetooth package, btusb and bnep, via apt and modprob it got succeded and the bluetoothctl is running. But still no adapter found.

Maybe we lack kernel that must be installed on orange pi 4 lts?

update 2: the one making segmentation fault is sprdbt_tty kernel

With the help of dietpi-drive_manager you can perform filesystem checks of your partitions.

hmm this is a module we load on OrangePi but not sure where it is located and if it can be repaired easily.

@MichaIng any ideas?

I just installed it manually before the Bluetooth, and the installation was successful (I got no segmentation fault).

Back to the original problem, I still can’t detect my Bluetooth device. I will just buy a USB Bluetooth dongle. Will update back if the Bluetooth shown.

Thanks!

not sure if this is going to change anything if sprdbt_tty module has issues.

Hi guys, i bought cheap usb bluetooth dongle 5.0 and it worked. But, I need to disable SAP at the bluetooth.service. Thanks!

Are you sure that a hciuart.service is required in this case, i.e. whether onboard Bluetooth is really internally attached via UART interface?

The sprdbt_tty module is correct for Orange Pi Zero 3 and Orange Pi 3B, but not sure whether the Orange Pi 4 uses the same chip/driver, actually I doubt it, and hence this error is unrelated.

dietpi-set_hardware indeed loops through all known Bluetooth drivers and tries to load the modules. The error output is muted, but I guess this segmentation fault is thrown by the kernel itself and hence cannot be muted via shell redirect. I just excluded this particular module on all devices but Orange Pi Zero 3 and 3B.

EDIT: Ah okay, the module IS required, it seems. At least Armbian loads it as well: build/config/boards/orangepi4-lts.conf at 9c4c0409a6a9e28c023c577d200e7133f601bc65 · armbian/build · GitHub
There is also the hint about the “custom hciattach_opi binary”. Try this:

curl -sSfo /usr/local/bin/hciattach_opi 'https://raw.githubusercontent.com/armbian/build/main/packages/bsp/rk3399/hciattach_opi'
cat << '_EOF_' > /etc/systemd/system/sprd-bluetooth.service
[Unit]
Description=Spreadtrum (sprd) bluetooth support
Before=bluetooth.service

[Service]
RemainAfterExit=yes
ExecStartPre=/usr/sbin/modprobe sprdbt_tty
ExecStart=/usr/local/bin/hciattach_opi -n -s 1500000 /dev/ttyBT0 sprd

[Install]
WantedBy=multi-user.target
_EOF_
systemctl daemon-reload
systemctl enable --now sprd-bluetooth

However, if sprdbt_tty fails to load, I guess /dev/ttyBT0 does not exist?

Your kernel is outdated, but should actually been upgraded already. Can you check:

dpkg -l | grep 'linux-'

For orange pi zero 3 working solution is:

sudo su -

curl -sSfo /usr/local/bin/hciattach_opi 'https://raw.githubusercontent.com/armbian/build/main/packages/bsp/rk3399/hciattach_opi'

cat << '_EOF_' > /etc/systemd/system/sprd-bluetooth.service
[Unit]
Description=Spreadtrum (sprd) bluetooth support
Before=bluetooth.service

[Service]
RemainAfterExit=yes
ExecStartPre=/bin/sleep 60
ExecStartPre=/usr/sbin/modprobe sprdwl_ng
ExecStartPre=/usr/sbin/modprobe sprdbt_tty
ExecStart=/usr/local/bin/hciattach_opi -n -s 1500000 /dev/ttyBT0 sprd

[Install]
WantedBy=multi-user.target
_EOF_

chmod +x /usr/local/bin/hciattach_opi

systemctl daemon-reload

systemctl enable --now sprd-bluetooth

And after that unblock it through rfkill