core: bluetooth integration constant state of initializing / retrying setup (bluetooth is broken with some adapters on newer linux kernels, kernel must be manually patched, workaround is to switch to ESPHome proxies instead)
Mod Issue Summary - Read First
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
Example YAML snippet
No response
Anything in the logs that might be useful for us?
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 |
Home Assistant Community Store
| 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 |
Home Assistant Cloud
| 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 |
Home Assistant Supervisor
| 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) |
Dashboards
| dashboards | 3 |
|---|---|
| resources | 6 |
| views | 6 |
| mode | storage |
Recorder
| 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 |
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 8
- Comments: 71 (7 by maintainers)
Same here - HA Core 2023.11.1 - Beelink mini S12 -
Running 2023.6.2 and still seeing this issue. Constantly initializing and retrying setup but never actually finishing/working.
I’ve been having the same problem for a week
Also having an issue with Bluetooth, since I upgraded to 2024.1.4 (the issue is still present in 2024.1.5).
I’m on a Rasberry Pi 4
Core 2024.1.5 Supervisor 2023.12.1 Operating System 11.4 Frontend 20240104.0
The same for me on 2023.7.2, Fedora 38, HA running in a container.
I’ve tried it with multiple different BT adapters as well.
Adding how I was finally able to get HA Yellow running HAOS to correctly use the on-board bluetooth.
Props / thanks to @hughobrien for the above. While my specific issue was not directly fixed in the same way, it was useful to be able to log in via SSH, and
bluetoothctlto get observability into that layer of the stack, and seeing the fix resolve! Cheers!FYI, I have just installed HA OS version 12.0rc1. The RPi controller has connected without the passive mode, and my device has been reporting without issues for a few hours now. 🤞
I am having the the problem with Bluetooth on a MacMini from 2012 (core duo 2), fails to initialize. Here is some log that might be useful https://gist.github.com/ssbarnea/eb647871942af5a38fe1e17aa7f32ced - the interesting part is " BleakError while starting bluetooth; attempt: (2/3): [org.bluez.Error.InProgress] Operation already in progress"
I have the same problem. HA Core 2023.8.0 su Docker su Linux Debian. Bluetooth adaptor: ZEXMTE The bluetooth works for a couple of days then this error:
I can confirm ESP32 Bluetooth Proxy to be a workable solution for me.
For those who wonder how this is done:
Mine worked for a couple days, then this week’s update seemed to break.
Retrying setup: hci0 (REDACTED): Failed to start Bluetooth: [org.bluez.Error.NotReady] Resource Not ReadySeems like it’s fixed here in the latest update from yesterday… mine is not flapping after the update restart 👍