Cannot power on bluetooth from bluetoothctl if it was powered off from the GNOME Settings

I first switch off bluetooth by clicking on the switch button inside GNOME Settings.
Then, I want to power on bluetooth from the command line, but I get an error.

❯ bluetoothctl power on
Failed to set power on: org.bluez.Error.Failed

I tried to sudo bluetoothctl power on, but the issue remains.

However, if I switch on bluetooth from GNOME Settings, then use bluetoothctl to switch bluetooth on and off, it works fine.

So, my problem is that if I had switched bluetooth off from GNOME Settings, I cannot switch it back on using the command line.

Thanks for help.

Here are my system’s information (sorry for it’s in french).

❯ bluetoothctl --version
bluetoothctl: 5.75
❯ bluetoothd  --version
5.75

Rapport d’informations du système


Détails du compte rendu

  • Date de génération : 2024-10-29 11:58:55

Informations liées au matériel :

  • Modèle du matériel : ASUSTeK COMPUTER INC. ZenBook UX425IA_UM425IA
  • Mémoire : 8,0 Gio
  • Processeur : AMD Ryzen™ 7 4700U with Radeon™ Graphics × 8
  • Carte graphique : AMD Radeon™ Graphics
  • Capacité du disque : 512,1 Go

Informations liées au logiciel :

  • Version du micrologiciel : UX425IA.311
  • Nom du système d’exploitation : NixOS 24.05 (Uakari)
  • Construction du système d’exploitation : 24.05.5919.32e940c7c420
  • Type de système d’exploitation : 64 bits
  • Version de GNOME : 46
  • Système de fenêtrage : Wayland
  • Version du noyau : Linux 6.6.58

I can reproduce it.

It appears that Settings app sets some state in the Bluetooth adpater / driver code which causes this. Below are the debug logs for bluetoothd.

bluetoothd[]: src/adapter.c:property_set_mode() sending Set Powered command for index 0
bluetoothd[]: src/shared/mgmt.c:send_request() [0x0000] command 0x0005
bluetoothd[]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x05 status: 0x03
bluetoothd[]: src/adapter.c:property_set_mode_complete() Failed (0x03)
bluetoothd[]: Failed to set mode: Failed (0x03)

Unfortunately, the adapter returns an error code of 0x03 which is a generic Failed error code as in bluez/lib/mgmt.h#L1250.

You can file an issue at https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/.

1 Like

Thank you @Sid I opened an issue at Cannot power on bluetooth from bluetoothctl if it was powered off from the GNOME Setting (#3242) · Issues · GNOME / Settings · GitLab with your details as well.

1 Like

The following works as mentioned here.

$ bluetoothctl power on
Failed to set power on: org.bluez.Error.Failed

$ rfkill
ID TYPE      DEVICE      SOFT      HARD
 0 bluetooth hci0     blocked unblocked
 1 wlan      phy0   unblocked unblocked

$ rfkill unblock 0

$ bluetoothctl power on
Changing power on succeeded

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.