Orange Pi zero 2w Bluetooth

3 issues upon basis installation

Gpu
Sound
Bluetooth, focussing on this here

Creating a bug report/issue

I have searched the existing open and closed issues

I did see a nanopi issue in line with the issue but don’t know if it is similar here

Required Information

  • DietPi version | 971 master michaIng
  • Distro version | 'bookworm`
  • Kernel version | `6.6.31-current-sunxi64’
  • Architecture | arm64
  • SBC model | Orange pi zero 2w
  • Power supply used | (5V 2.1A)
  • SD card used | (SanDisk ultra)

Steps to reproduce

  1. fresh installation with Bluetooth on from the config
  2. And after installing blueZ blueman Bluetooth-manager (I think this was all, asked chatgpt for what I needed :wink: )

Expected behaviour

  • Bluetooth adapter should work

Actual behaviour

  • Cannot detect hci0 only vhci
  • Bluetooth manager window pops up and disappears
  • Eventually I managed to open the BT manager menu, but I could not press search
  • Bluetooth adapter is not working, but a BT USB dongle works and I connected a device

Could ralink cause firmware clash?

I worked a lot with chatgpt, it helps noobs.
Been playing with linux for 2 months now and I like Dietpi.
Hope you can help so I can work on retropie optimization :sweat_smile:, thanks in advance!

Wifi adapter works, menu would be nice eventually

PS: earlier found the gpu fix and the dtb replacement fix for the no Soundcard issue.

Dietpi doesn’t support this hardware.

Thanks for the quick reply,

I might be miscommunicating. I called it pci, but it is an integrated Bluetooth/wifi adapter. It works with any other OS that I’ve tried so far.

OrangePI
Armbian

v9.5
(2024-06-09)

Bug fixes:

  • Orange Pi Zero 2W | Resolved an issue where the onboard Ethernet adapter did not work.

Which hardware are you referring to, the orange pi zero 2w or the Bluetooth?

Sorry for the possible mixup.

I mean internal Bluetooth that comes with the board

let me ping @MichaIng , maybe he has an idea

1 Like

IIRC, WiFi (the WiFi kernel module) needs to be enabled for Bluetooth to work. Please try this:

echo 'sprdwl_ng' | sudo tee -a /etc/modules-load.d/dietpi-enable_bluetooth.conf
reboot

I’ll implement it ASAP into dietpi-config, if it works.

@boxer last warning: If I see you one more time spreading false facts like this, I’ll permanently ban you. It is embarrassing and somewhat sad to see you wasting your time, desperately trying to sabotage other projects, instead of investing this time into your own project. I cannot see into your mind, but what you do is self-destruction. You are making a fool of yourself here, in case you are unable to recognise this yourself.

3 Likes

Tried your cmd… :smiling_face_with_tear: no luck

Connection to BlueZ failed.

Bluez daemon is not running, blueman-manager cannot continue. No Bluetooth adapter detected or Bluetooth daemon was not started.

After retrying and rebooting:

Menu openen with the question below. After automatically enabling Bluetooth, each time I open the BT-manager it pops up and disappears.

root@DietPi:~# blueman-manager

(blueman-manager:1807): dbind-WARNING **: 18:06:43.254: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
blueman-manager 18.06.44 ERROR    Manager:147 on_dbus_name_appeared: Default adapter not found, trying first available.
blueman-manager 18.06.44 ERROR    Manager:151 on_dbus_name_appeared: No adapter(s) found, exiting
root@DietPi:~# sudo hciconfig hci0 up
Can't get device info: No such device
root@DietPi:~# rfkill
ID TYPE      DEVICE         SOFT      HARD
 0 bluetooth bluetooth unblocked unblocked
 1 wlan      phy0      unblocked unblocked

Again to confirm.
Asus Bluetooth dongle works as intended. If inserted, Bluetooth icon appears on the right next to the volume icon (in my case)

Checking this out : ended up being the input of your cmd too many times :smiley:

nano now looks like this
sprdbt_tty (was in her and is default in armbian)
btusb (added myself)
hci_uart (added myself)
sprdwl_ng

bluetooth.service - Bluetooth service was skipped because of an unmet condition check (ConditionPathIsDirectory=/sys/class/bluetooth).

end of today: still no luck, sad

Ah wait I missed that UART attachment needed for the onboard Bluetooth here. Please try this:

sudo curl -fo /usr/local/bin/hciattach_opi 'https://raw.githubusercontent.com/orangepi-xunlong/orangepi-build/refs/heads/next/external/packages/blobs/bt/hciattach/hciattach_opi_arm64'
sudo chmod +x /usr/local/bin/hciattach_opi
cat << '_EOF_' | sudo tee /etc/systemd/system/sprd-bluetooth.service
[Unit]
Description=Spreadtrum (sprd) Bluetooth support
After=bluetooth.service

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

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

Please also check which kernel modules are loaded:

lsmod

sprdwl_ng and sprdbt_tty somehow did not want to load both via /etc/modules-load.d, or the order was relevant. And after the need for the UART-attachment, I am actually not sure anymore whether sprdwl_ng (WiFi driver) is really needed or not.

1 Like

works!!!

But problem returns after reboot :frowning:

1 Like

do you want me to try with and without wifi driver? i can remove it, test, put it back

1 Like

FYI lsmod

root@DietPi:~# lsmod
Module                  Size  Used by
uhid                   16384  1
rfcomm                 73728  12
algif_hash             12288  1
algif_skcipher         12288  1
af_alg                 20480  6 algif_hash,algif_skcipher
bnep                   28672  2
ath3k                  20480  0
snd_soc_hdmi_codec     20480  1
sunxi_cedrus           49152  0
polyval_ce             12288  0
sunxi_cir              16384  0
v4l2_mem2mem           32768  1 sunxi_cedrus
rc_core                45056  2 sunxi_cir
polyval_generic        12288  1 polyval_ce
snd_soc_sunxi_ahub     32768  4
videobuf2_dma_contig    20480  1 sunxi_cedrus
sun50iw9_codec         24576  3
snd_soc_sunxi_machine    20480  0
snd_soc_sunxi_ahub_dam    20480  1 snd_soc_sunxi_ahub
videobuf2_memops       16384  1 videobuf2_dma_contig
dw_hdmi_i2s_audio      12288  0
dw_hdmi_cec            12288  0
videobuf2_v4l2         20480  2 sunxi_cedrus,v4l2_mem2mem
videodev              221184  3 sunxi_cedrus,videobuf2_v4l2,v4l2_mem2mem
videobuf2_common       45056  5 sunxi_cedrus,videobuf2_dma_contig,videobuf2_v4l2,v4l2_mem2mem,videobuf2_memops
mc                     57344  5 sunxi_cedrus,videodev,videobuf2_v4l2,videobuf2_common,v4l2_mem2mem
joydev                 28672  0
panfrost               69632  6
pwm_sunxi_enhance      16384  1
dump_reg               20480  0
gpu_sched              32768  1 panfrost
drm_shmem_helper       16384  1 panfrost
display_connector      16384  0
cpufreq_dt             16384  0
binfmt_misc            20480  1
sprdwl_ng             344064  0
sunxi_addr             16384  1 sprdwl_ng
cfg80211              385024  1 sprdwl_ng
hci_uart              135168  1
btqca                  20480  1 hci_uart
btusb                  57344  0
btrtl                  28672  2 hci_uart,btusb
btintel                40960  2 hci_uart,btusb
btbcm                  16384  2 hci_uart,btusb
bluetooth             700416  46 btrtl,btqca,btintel,hci_uart,btbcm,bnep,ath3k,btusb,rfcomm
ecdh_generic           12288  2 bluetooth
ecc                    28672  1 ecdh_generic
sprdbt_tty             36864  2
uwe5622_bsp_sdio      204800  2 sprdbt_tty,sprdwl_ng
rfkill                 24576  8 sprdbt_tty,bluetooth,cfg80211
fuse                  126976  1
dm_mod                131072  0
sunxi_gmac             40960  0
sunxi_ephy             16384  1 sunxi_gmac
sunxi_ac200            12288  1 sunxi_ephy

Great! Ah, the service needs to be enabled, of course:

sudo systemctl enable sprd-bluetooth

Would be indeed great if you could test it without WiFi driver:

sudo sed -i '/sprdwl_ng/d' /etc/modules-load.d/dietpi-enable_bluetooth.conf
sudo reboot

Also good to know that both modules did load successfully via /etc/modules-load.d in your case.

1 Like

Works without Wifi driver

1 Like

Thanks for the amazing service. Didn’t expect this at first. Keep doing what you are doing!! :heart:

I hope to get Retropie working tomorrow evening :rofl: <edit: got it working>

Will the 3 issues be able to be implemented in a fresh install IMG for Orange Pi zero 2w?

No dietpieEnv Gpu overlays, thanks @urostor + michaIng
No Soundcard detected, thanks @Totof
No Bluetooth, thanks @MichaIng

5 Likes

Can you try this:

systemctl disable --now sprd-bluetooth
rm /etc/systemd/system/sprd-bluetooth.service /usr/local/bin/hciattach_opi
apt update
apt install sprd-bluetooth

I just created a package with this binary and service and will implement the installation of this into dietpi-config: v9.8 · MichaIng/DietPi@e857d43 · GitHub

@Arrafart
Answering via email does not work on our forum yet, since we do not run an own webserver here. But I got your mail, that it worked :slightly_smiling_face:. Thanks for testing. I’ll have a look into the other issues as well.

1 Like

My 8bitdo modkit controllers are recognized, successfully connected, by Dietpi, but not inside retropie, it was all good with Armbian OS.

Anything were are missing?

Edit: This is a modkit issue. Alternates between 2 startup modes. “Szmy power Ltd” and “*30 modkit”