How to monitor battery level of bluetooth device?

I’ve bought a new Bluetooth dongle and can successfully connect to my headset via Bluetooth.
I wanted to know how I could check the device battery level on manjaro?

inxi -Fazy:

System:
  Kernel: 5.15.55-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.1.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.15-x86_64
    root=UUID=3a81af0d-a5c0-428a-95b7-84fb1fa4afe9 rw quiet apparmor=1
    security=apparmor udev.log_priority=3
  Desktop: KDE Plasma v: 5.24.6 tk: Qt v: 5.15.5 wm: kwin_x11 vt: 1 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop System: ASUS product: N/A v: N/A serial: <superuser required>
  Mobo: ASUSTeK model: PRIME H510M-A v: Rev 1.xx
    serial: <superuser required> UEFI: American Megatrends v: 0820
    date: 04/27/2021
CPU:
  Info: model: Intel Core i3-10100 bits: 64 type: MT MCP arch: Comet Lake
    gen: core 10 built: 2020 process: Intel 14nm family: 6 model-id: 0xA5 (165)
    stepping: 3 microcode: 0xF0
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB
    L3: 6 MiB desc: 1x6 MiB
  Speed (MHz): avg: 800 min/max: 800/4300 scaling: driver: intel_pstate
    governor: powersave cores: 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800
    8: 800 bogomips: 57616
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl and seccomp
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 status: Vulnerable: eIBRS with unprivileged eBPF
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA GK208B [GeForce GT 710] vendor: ASUSTeK driver: nvidia
    v: 470.129.06 alternate: nouveau,nvidia_drm non-free: 470.xx+
    status: legacy-active (EOL~2023/24) arch: Fermi 2 process: TSMC 28nm
    built: 2010-16 pcie: gen: 2 speed: 5 GT/s lanes: 8 bus-ID: 01:00.0
    chip-ID: 10de:128b class-ID: 0300
  Display: x11 server: X.Org v: 21.1.4 compositor: kwin_x11 driver: X:
    loaded: nvidia gpu: nvidia display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 54 s-size: 903x508mm (35.55x20.00")
    s-diag: 1036mm (40.79")
  Monitor-1: HDMI-0 res: 1920x1080 hz: 60 dpi: 55
    size: 885x498mm (34.84x19.61") diag: 1015mm (39.98") modes: N/A
  OpenGL: renderer: NVIDIA GeForce GT 710/PCIe/SSE2
    v: 4.6.0 NVIDIA 470.129.06 direct render: Yes
Audio:
  Device-1: Intel vendor: ASUSTeK driver: snd_hda_intel v: kernel
    bus-ID: 00:1f.3 chip-ID: 8086:f0c8 class-ID: 0403
  Device-2: NVIDIA GK208 HDMI/DP Audio vendor: ASUSTeK driver: snd_hda_intel
    v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 8 bus-ID: 01:00.1
    chip-ID: 10de:0e0f class-ID: 0403
  Sound Server-1: ALSA v: k5.15.55-1-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.21 running: no
  Sound Server-3: PulseAudio v: 16.1 running: yes
  Sound Server-4: PipeWire v: 0.3.56 running: yes
Network:
  Device-1: Intel Ethernet I219-V vendor: ASUSTeK driver: e1000e v: kernel
    port: N/A bus-ID: 00:1f.6 chip-ID: 8086:15fa class-ID: 0200
  IF: eno1 state: down mac: <filter>
  Device-2: Qualcomm Atheros AR9271 802.11n type: USB driver: ath9k_htc
    bus-ID: 1-9.3:5 chip-ID: 0cf3:9271 class-ID: ff00 serial: <filter>
  IF: wlp0s20f0u9u3 state: up mac: <filter>
  IF-ID-1: br-44843efba035 state: up speed: 10000 Mbps duplex: unknown
    mac: <filter>
  IF-ID-2: br-83967b164190 state: down mac: <filter>
  IF-ID-3: docker0 state: down mac: <filter>
  IF-ID-4: veth186c00a state: up speed: 10000 Mbps duplex: full
    mac: <filter>
  IF-ID-5: vethe1be356 state: up speed: 10000 Mbps duplex: full
    mac: <filter>
Bluetooth:
  Device-1: Realtek Bluetooth Radio type: USB driver: btusb v: 0.8
    bus-ID: 1-7:8 chip-ID: 0bda:8771 class-ID: e001 serial: <filter>
  Report: bt-adapter ID: hci0 rfk-id: 2 state: up address: <filter>
Drives:
  Local Storage: total: 1.24 TiB used: 1012.04 GiB (79.4%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: SanDisk model: ADATA SX6000LNP
    size: 119.24 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s
    lanes: 4 type: SSD serial: <filter> rev: VC0S032Q temp: 34.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: A-Data model: SU650 size: 223.57 GiB
    block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD
    serial: <filter> rev: 01D2 scheme: GPT
  ID-3: /dev/sdb maj-min: 8:16 type: USB vendor: Western Digital
    model: WD Elements 25A2 size: 931.48 GiB block-size: physical: 512 B
    logical: 512 B type: N/A serial: <filter> rev: 1021 scheme: GPT
Partition:
  ID-1: / raw-size: 145.25 GiB size: 141.91 GiB (97.70%) used: 47 GiB (33.1%)
    fs: ext4 dev: /dev/sda4 maj-min: 8:4
  ID-2: /boot/efi raw-size: 100 MiB size: 96 MiB (96.00%)
    used: 25.3 MiB (26.3%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 7.81 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/sda3 maj-min: 8:3
Sensors:
  System Temperatures: cpu: 50.0 C mobo: N/A gpu: nvidia temp: 54 C
  Fan Speeds (RPM): N/A
Info:
  Processes: 314 Uptime: 1h 54m wakeups: 0 Memory: 7.62 GiB
  used: 4.46 GiB (58.5%) Init: systemd v: 251 default: graphical
  tool: systemctl Compilers: gcc: 12.1.0 clang: 14.0.6 Packages: 1365
  pacman: 1351 lib: 336 flatpak: 2 snap: 12 Shell: Zsh v: 5.9 default: Bash
  v: 5.1.16 running-in: yakuake inxi: 3.3.19

Hi @Leviathan,

Have a look at this. It might help.

https://bluez-cheat-sheet.readthedocs.io/en/latest/

Edit:

Bluez is in the extra repositories:

$ pamac search bluez
[...]
bluez                                                                                                                                                                                                        [Installed] 5.64-2                   extra
Daemons for the bluetooth protocol stack

So, if not already installed, it can be installed with:

pamac install bluez

Hope this helps!

I see nothing to show the battery level here.

I don’t use bluetooth. Oh, I have a dongle connected, but I don’t actually use it. So all else I can point you to is:

https://wiki.archlinux.org/title/Bluetooth

Already saw that, but didn’t help me.
I think I should look for a kde extension to do that for me.

On that page it states:

BluedevilKDE’s Bluetooth tool. If there is no Bluetooth icon visible in Dolphin and in the system tray, enable it in the system tray options or add a widget. You can configure Bluedevil and detect Bluetooth devices by clicking the icon. An interface is also available from the KDE System Settings.

And it’s in the extra repositories:

$ pamac search bluedevil

[...]
bluedevil                                                                                                                                                                                                      [Installed] 1:5.24.6-1                 extra
Integrate the Bluetooth technology within KDE workspace and applications

So can be installed using:

pamac install bluedevil

I have no idea what, if any, effect this will have. So do at own risk. Anything more, I honestly don’t know, I’m already wingin’ it here.

Do your headset support this feature? Not every device send info about battery – for example one of my mouses and headset don’t send it :frowning: If device support this feature it should be visible out of box.

EDIT: In some cases enabling experimental feature may help (but also you must use Pipewire instead PulseAudio), see here Bluetooth headset - ArchWiki

Didn’t understand anything from it…

Alright tried that one

Is there any extension for it?

I also had similar query in the past.

My headphones are using proprietary (non-standard) AT-commands (such as AT+XAPL and AT+IPHONEACCEV) to get the battery level.

PipeWire supports polling these commands and providing information using BlueZ.
You can enable this experimental feature in Bluez.

Restart the service or do a reboot after enabling the experimental option.

2 Likes

Thanks a lot
Do I need to replace PulseAudio with pipewire?
Can you give me the correct steps for it, please?

Yes. It’s simple, you need only install manjaro-pipewire:

pamac install manjaro-pipewire
1 Like

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