Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry Pi Zero 2 W - bluetoothctl problem #6666

Closed
Rhiz3K opened this issue Oct 6, 2023 · 10 comments
Closed

Raspberry Pi Zero 2 W - bluetoothctl problem #6666

Rhiz3K opened this issue Oct 6, 2023 · 10 comments
Labels
Milestone

Comments

@Rhiz3K
Copy link

Rhiz3K commented Oct 6, 2023

Creating a bug report/issue

Required Information

  • DietPi version | cat /boot/dietpi/.version
    G_DIETPI_VERSION_CORE=8
    G_DIETPI_VERSION_SUB=22
    G_DIETPI_VERSION_RC=3
    G_GITBRANCH='master'
    G_GITOWNER='MichaIng'

  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
    bookworm 0

  • Kernel version | uname -a
    Linux DietPi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux

  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)
    RPi Zero 2 W (aarch64)

  • Power supply used | (EG: 5V 1A RAVpower)
    AXAGON ACU-DPQ65

  • SD card used | (EG: SanDisk ultra)
    SanDisk MicroSDHC 32GB Extreme

Additional Information (if applicable)

  • Software title | (EG: Nextcloud)
    bluetoothctl
  • Was the software title installed freshly or updated/migrated?
    fresh installation
  • Can this issue be replicated on a fresh installation of DietPi?
    possibly yes
  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

  1. dietpi-config / Advanced Options / Bluetooth set from Off to On then restart
  2. bluetoothctl

Expected behaviour

Agent registered
[bluetooth]

Actual behaviour

after bluetoothctl is showing only Waiting to connect to bluetoothd....

Extra details

everything was done under root user

journalctl -u bluetooth
It showed: configurationDirectory 'bluetooth' already exists but the mode is different. (File system: 755 ConfigurationDirectoryMode: 555)

  • Used:
    sudo chmod 555 /etc/bluetooth
    sudo systemctl restart bluetooth

  • it fixed the issue until next reboot now journalctl -u bluetooth showing:
    Oct 06 10:51:17 DietPi systemd[1]: bluetooth.service - Bluetooth service was skipped because of an unmet
    condition check (ConditionPathIsDirectory=/sys/class/bluetooth).

fixed by commenting ConditionPathIsDirectory=/sys/class/bluetooth in /etc/systemd/system/bluetooth.target.wants/bluetooth.service

  • 2nd issue until restart and now:
    scan on
    No default controller available

hciconfig -a
hciconfig hci0 up
Can't get device info: No such device
hciconfig hci0 reset
Can't get device info: No such device

  • current status of "journalctl -u bluetooth":
    Oct 06 11:35:12 DietPi systemd[1]: Starting bluetooth.service - Bluetooth service...
    Oct 06 11:35:13 DietPi bluetoothd[1559]: Bluetooth daemon 5.66
    Oct 06 11:35:13 DietPi systemd[1]: Started bluetooth.service - Bluetooth service.
    Oct 06 11:35:13 DietPi bluetoothd[1559]: Starting SDP server
    Oct 06 11:35:13 DietPi bluetoothd[1559]: profiles/audio/vcp.c:vcp_in
    it() D-Bus experimental not enabled
    Oct 06 11:35:13 DietPi bluetoothd[1559]: src/plugin.c:plugin_init() Failed to in
    it vcp plugin
    Oct 06 11:35:13 DietPi bluetoothd[1559]: profiles/audio/mcp.c:mcp_in
    it() D-Bus experimental not enabled
    Oct 06 11:35:13 DietPi bluetoothd[1559]: src/plugin.c:plugin_init() Failed to in
    it mcp plugin
    Oct 06 11:35:13 DietPi bluetoothd[1559]: profiles/audio/bap.c:bap_in
    it() D-Bus experimental not enabled
    Oct 06 11:35:13 DietPi bluetoothd[1559]: src/plugin.c:plugin_init() Failed to in
    it bap plugin
    Oct 06 11:35:13 DietPi bluetoothd[1559]: Bluetooth management interface 1.22 initialized
@MichaIng
Copy link
Owner

MichaIng commented Oct 6, 2023

Can you check the hciuart service logs?

journalctl -u hciuart

@Rhiz3K
Copy link
Author

Rhiz3K commented Oct 6, 2023

Can you check the hciuart service logs?

journalctl -u hciuart

-- No entries --

@MichaIng
Copy link
Owner

MichaIng commented Oct 6, 2023

Strange, that service is forcefully started and enabled when enabling Bluetooth on RPi via dietpi-config. Does this work?

systemctl enable --now hciuart
sleep 2
journalctl -u hciuart

@Rhiz3K
Copy link
Author

Rhiz3K commented Oct 7, 2023

Strange, that service is forcefully started and enabled when enabling Bluetooth on RPi via dietpi-config. Does this work?

systemctl enable --now hciuart

sleep 2

journalctl -u hciuart

New fresh install done today:

bluetoothctl
Waiting to connect to bluetoothd...
systemctl enable --now hciuart
sleep 2
journalctl -u hciuart
Unit /lib/systemd/system/hciuart.service is added as a dependency to a non-existent unit dev-serial1.device.
Job for hciuart.service failed because the control process exited with error code.
See "systemctl status hciuart.service" and "journalctl -xeu hciuart.service" for details.
Oct 07 10:50:52 DietPi systemd[1]: Starting hciuart.service - Configure Bluetooth Modems connected by UART...
Oct 07 10:50:52 DietPi btuart[985]: Can't open serial port: No such file or directory
Oct 07 10:50:52 DietPi btuart[985]: Can't initialize device: No such file or directory
Oct 07 10:50:52 DietPi systemd[1]: hciuart.service: Control process exited, code=exited, status=1/FAILURE
Oct 07 10:50:52 DietPi systemd[1]: hciuart.service: Failed with result 'exit-code'.
Oct 07 10:50:52 DietPi systemd[1]: Failed to start hciuart.service - Configure Bluetooth Modems connected by UART.

@Rhiz3K
Copy link
Author

Rhiz3K commented Oct 7, 2023

Also dbus.service is not active, cannot reload. appeared in red when tried to turn off/on bluetooth again:

Setting up dbus-bin (1.14.8-2~deb12u1) ...
Setting up dbus-daemon (1.14.8-2~deb12u1) ...
Setting up dbus (1.14.8-2~deb12u1) ...
dbus.service is a disabled or a static unit, not starting it.
Setting up bluez (5.66-1) ...
dbus.service is not active, cannot reload.
invoke-rc.d: initscript dbus, action "force-reload" failed.
Created symlink /etc/systemd/system/dbus-org.bluez.service → /lib/systemd/system/bluetooth.service.
Created symlink /etc/systemd/system/bluetooth.target.wants/bluetooth.service → /lib/systemd/system/bluetooth.service.
Setting up pi-bluetooth (0.1.19) ...
Created symlink /etc/systemd/system/dev-serial1.device.wants/hciuart.service → /lib/systemd/system/hciuart.service.
Unit /lib/systemd/system/hciuart.service is added as a dependency to a non-existent unit dev-serial1.device.
Processing triggers for libc-bin (2.36-9+deb12u3) ...

@MichaIng
Copy link
Owner

MichaIng commented Oct 7, 2023

The required secondary serial device is missing. Can you check the following:

ls -l /dev/{ttyAMA0,ttyS0,serial0,serial1}

@Rhiz3K
Copy link
Author

Rhiz3K commented Oct 7, 2023

ls -l /dev/{ttyAMA0,ttyS0,serial0,serial1}
ls: cannot access '/dev/serial0': No such file or directory
ls: cannot access '/dev/serial1': No such file or directory
crw-rw---- 1 root dialout 204, 64 Oct 7 11:31 /dev/ttyAMA0
crw-rw---- 1 root dialout 4, 64 Oct 7 11:31 /dev/ttyS0

@MichaIng MichaIng added this to the v8.23 milestone Oct 8, 2023
@MichaIng
Copy link
Owner

MichaIng commented Oct 8, 2023

I can replicate the issue of the missing serial0/serial1 symlinks. Currently investigating the reason for this.

MichaIng added a commit that referenced this issue Oct 8, 2023
- Raspberry Pi | Resolved an issue where the /dev/serial* symlinks were missing if binutils was not installed, which broke Bluetooth support among other things. Many thanks to @Rhiz3K for reporting this issue: #6666
@MichaIng MichaIng added Solution available 🥂 Definite solution has been done and removed Investigating 🤔 labels Oct 8, 2023
@MichaIng
Copy link
Owner

MichaIng commented Oct 8, 2023

Fixed with: 0812ad7

Please do this:

curl -fo package.deb 'https://dietpi.com/downloads/binaries/raspberrypi-sys-mods.deb'
dpkg -i --force-confdef,confold package.deb
rm package.deb
reboot

@Rhiz3K
Copy link
Author

Rhiz3K commented Oct 8, 2023

Working! Thank you very much for superb support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants