laffez
(Lars)
June 28, 2023, 12:49pm
1
Hi all,
I upgraded my base-os from Debian bullseye to Debian bookworm. Afterwards, all my bluetooth units stopped working for no apparent good reason. I run home assistant in docker, and bluetooth used to work fine.
I have a few airthings waved, and a switchbot curtain. Is this a known issue? Would be happy to dump logs if I get guidance on what to dump? Does anyone have a debian 12 working with docker and bluetooth?
Debian 12 is not yet supported… What I’ve read, it should be with the next release.
I had this issue and it was because realtek firmware moved to the “non-free-firmware” component. See Firmware - Debian Wiki
laffez
(Lars)
July 24, 2023, 5:56am
4
Hi @sarthurdev
I did update the repos to include the non-free-firmware component. That updated the intel firmware. Strange thing is that it works for about a minute after reboot, but then it fails.
mill1000
(Tucker Kern)
September 5, 2023, 4:10pm
5
Also seeing the same behavior after upgrading from Debian 11 to 12. Bluetooth will operate briefly after HA is restarted and then drop out. No obvious errors in HA logs or kernel dmesg.
Saw you created an issue here (Bluetooth unstable on debian 12 · Issue #97129 · home-assistant/core · GitHub ), but looks like that’s a dead end too.
laffez
(Lars)
September 5, 2023, 6:40pm
6
Hey! I ended up downgrading to debian 11, this was a deal-breaker for me.
Let me know if you find a way to fix it. Did not try to install vanilla debian 12 directly…
mill1000
(Tucker Kern)
September 5, 2023, 8:22pm
7
I was hoping to try downgrading the firmware package and see where that gets me. I’ll let you know if there’s any good news.
mill1000
(Tucker Kern)
September 6, 2023, 3:29pm
8
So far I’ve attempted downgrading firmware-iwlwifi
to 20210315-3 and bluez
to 5.55-3.1, the versions that shipped with bullseye. No luck so far.
bdraco
(J. Nick Koston)
September 6, 2023, 5:10pm
9
Bluetooth is broken on newer Linux kernels with many adapters
There is a patch linked in this issue or alternative options if you don’t want to compile your own kernel:
opened 10:55PM - 02 May 23 UTC
waiting-for-upstream
integration: bluetooth
# Mod Issue Summary - Read First
See https://lore.kernel.org/linux-bluetooth/… [email protected] /T/#mb094e06d495879436ce9a8722ad7ad87527ea74b
A summary:
- Bluetooth initialization is unreliable/broken on newer linux kernels for a large sample of adapters
- No fixes are available without patching the kernel and it will likely be a LONG time before debian updates the kernel, if you want to manually compile and patch your kernel, see https://lore.kernel.org/linux-bluetooth/CABBYNZ+5RMqNVMyYKi+gOVaV+K6k8Z-C37KnfGa=qRUORc3dWg@mail.gmail.com/ https://github.com/home-assistant/operating-system/pull/2714
- Newer Home Assistant OS has some patches that solves the problem for some adapters so be sure you have the latest HAOS: https://github.com/home-assistant/operating-system/issues/2485 https://github.com/home-assistant/operating-system/issues/2535
- The recommended workaround if you can't run HAOS or patch the kernel manually is to use an ESPHome proxy instead https://esphome.github.io/bluetooth-proxies/
---
### The problem
Bluetooth integration in perpetual state of initializing / retrying setup.
Deleting integration, restarting HA and configuring after auto discovered, several times, does not resolve.
### What version of Home Assistant Core has the issue?
core-2023.4.6
### What was the last working version of Home Assistant Core?
_No response_
### What type of installation are you running?
Home Assistant OS
### Integration causing the issue
bluetooth
### Link to integration documentation on our website
https://www.home-assistant.io/integrations/bluetooth
### Diagnostics information
[home-assistant_bluetooth_2023-05-02T22-28-03.303Z.log](https://github.com/home-assistant/core/files/11378180/home-assistant_bluetooth_2023-05-02T22-28-03.303Z.log)
### Example YAML snippet
_No response_
### Anything in the logs that might be useful for us?
```txt
Retrying setup: hci0 (XXXXX): Failed to start Bluetooth: [org.bluez.Error.InProgress] Operation already in progress
Logger: bluetooth_auto_recovery.recover
Source: components/bluetooth/util.py:78
First occurred: 5:36:41 PM (28 occurrences)
Last logged: 5:52:42 PM
Bluetooth adapter hci0 [XXXXXXXX] could not be reset due to timeout
Logger: homeassistant.config_entries
Source: config_entries.py:1242
First occurred: 5:44:58 PM (4 occurrences)
Last logged: 5:51:51 PM
Config entry 'XXXXX' for bluetooth integration not ready yet: hci0 (XXXXX): Failed to start Bluetooth: [org.bluez.Error.InProgress] Operation already in progress; Retrying in background
```
### Additional information
Home Assistant Yellow
## System Information
version | core-2023.4.6
-- | --
installation_type | Home Assistant OS
dev | false
hassio | true
docker | true
user | root
virtualenv | false
python_version | 3.10.10
os_name | Linux
os_version | 6.1.21-v8
arch | aarch64
timezone | America/Chicago
config_dir | /config
<details><summary>Home Assistant Community Store</summary>
GitHub API | ok
-- | --
GitHub Content | ok
GitHub Web | ok
GitHub API Calls Remaining | 4929
Installed Version | 1.32.1
Stage | running
Available Repositories | 1278
Downloaded Repositories | 10
</details>
<details><summary>Home Assistant Cloud</summary>
logged_in | true
-- | --
subscription_expiration | May 3, 2023 at 7:00 PM
relayer_connected | true
relayer_region | us-east-1
remote_enabled | true
remote_connected | true
alexa_enabled | false
google_enabled | false
remote_server | us-east-1-7.ui.nabu.casa
can_reach_cert_server | ok
can_reach_cloud_auth | ok
can_reach_cloud | ok
</details>
<details><summary>Home Assistant Supervisor</summary>
host_os | Home Assistant OS 10.1
-- | --
update_channel | stable
supervisor_version | supervisor-2023.04.1
agent_version | 1.5.1
docker_version | 23.0.3
disk_total | 234.0 GB
disk_used | 9.6 GB
healthy | true
supported | true
board | yellow
supervisor_api | ok
version_api | ok
installed_addons | Mosquitto broker (6.2.1), Studio Code Server (5.5.7), Terminal & SSH (9.7.0), Network UPS Tools (0.11.2)
</details>
<details><summary>Dashboards</summary>
dashboards | 3
-- | --
resources | 6
views | 6
mode | storage
</details>
<details><summary>Recorder</summary>
oldest_recorder_run | April 24, 2023 at 3:54 AM
-- | --
current_recorder_run | May 2, 2023 at 5:36 PM
estimated_db_size | 652.32 MiB
database_engine | sqlite
database_version | 3.38.5
</details>
TLDR: use HAOS, a Bluetooth proxy, or recompile your kernel from source with the patch
2 Likes
mill1000
(Tucker Kern)
September 7, 2023, 10:32pm
10
Thanks for the information.
I’m brave/dumb enough to try patching my kernel so I’ll give that a shot.
mill1000
(Tucker Kern)
September 18, 2023, 6:38pm
11
Success!
I followed these instructions to build the kernel.
https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-common-official
Specifically the “4.5.2. Simple patching and building” with the patch from here: Bluetooth: hci_sync: Fix handling of HCI_QUIRK_STRICT_DUPLICATE_FILTER - Patchwork
The only hiccup I encountered was disabling secure boot in my BIOS to allow the unsigned kernel to boot. The docs above also cover self-signing which I may try later.
2 Likes
mill1000
(Tucker Kern)
January 19, 2024, 6:02pm
12
FYI, it appears kernel version 6.1.69-1 has resolved this issue for me.