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

Bluetooth failing after upgrade to HAOS 10 on Raspberry Pi #2485

Closed
ghost opened this issue Apr 19, 2023 · 168 comments
Closed

Bluetooth failing after upgrade to HAOS 10 on Raspberry Pi #2485

ghost opened this issue Apr 19, 2023 · 168 comments
Labels
bluetooth board/raspberrypi Raspberry Pi Boards board/yellow Home Assistant Yellow bug stable-kernel-regression Issue which appears to be an upstream stable kernel regression

Comments

@ghost
Copy link

ghost commented Apr 19, 2023

Describe the issue you are experiencing

I'm running a HA Yellow with a BT/WiFi CM4.
After a non consistant uptime the internal Bluetooth adapter is stopping to work and the integrations fail.
6 devices have been integrated, but even after reducing to 3 devices the problem occurs.
Unlike on HAOS 9.5, Bluetooth doesn't seem to recover from intermittend issues.

What operating system image do you use?

yellow (Home Assistant Yellow)

What version of Home Assistant Operating System is installed?

10

Did you upgrade the Operating System.

Yes

Steps to reproduce the issue

  1. Upgrade to HAOS 10
  2. Reboot
  3. Wait for failing BT integrations

Anything in the Supervisor logs that might be useful for us?

No error messages in Supervisor logs

Anything in the Host logs that might be useful for us?

Apr 19 09:13:10 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:13:15 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:13:15 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:13:15 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:13:15 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:13:15 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:13:15 homeassistant kernel: Bluetooth: hci0: stop background scanning failed: -16
Apr 19 09:13:35 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:13:35 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:13:40 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:13:40 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:13:40 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:13:40 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:13:40 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:13:40 homeassistant kernel: Bluetooth: hci0: stop background scanning failed: -16
Apr 19 09:13:40 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:13:40 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:13:45 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:13:45 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:13:45 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:13:45 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:13:45 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:13:45 homeassistant kernel: Bluetooth: hci0: stop background scanning failed: -16
Apr 19 09:14:05 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:14:05 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:14:10 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:14:10 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:14:10 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:14:10 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:14:10 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:14:10 homeassistant kernel: Bluetooth: hci0: stop background scanning failed: -16
Apr 19 09:14:10 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:14:10 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:14:15 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:14:15 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:14:15 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:14:15 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:14:15 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:14:15 homeassistant kernel: Bluetooth: hci0: stop background scanning failed: -16
Apr 19 09:14:35 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:14:35 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:14:40 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:14:40 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:14:40 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:14:40 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:14:40 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:14:40 homeassistant kernel: Bluetooth: hci0: stop background scanning failed: -16
Apr 19 09:14:40 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:14:40 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:14:45 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:14:45 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:14:45 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:14:45 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:14:45 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:14:45 homeassistant kernel: Bluetooth: hci0: stop background scanning failed: -16
Apr 19 09:15:05 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:15:05 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:15:10 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:15:10 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:15:10 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:15:10 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:15:10 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:15:10 homeassistant kernel: Bluetooth: hci0: stop background scanning failed: -16
Apr 19 09:15:10 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:15:10 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:15:15 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:15:15 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:15:15 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:15:15 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:15:15 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:15:15 homeassistant kernel: Bluetooth: hci0: stop background scanning failed: -16
Apr 19 09:15:35 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:15:35 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:15:40 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:15:40 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:15:40 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:15:40 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:15:40 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:15:40 homeassistant kernel: Bluetooth: hci0: stop background scanning failed: -16
Apr 19 09:15:40 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:15:40 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:15:45 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:15:45 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:15:45 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:15:45 homeassistant kernel: Bluetooth: hci0: Opcode 0x200c failed: -16
Apr 19 09:15:45 homeassistant kernel: Bluetooth: hci0: Unable to disable scanning: -16
Apr 19 09:15:45 homeassistant kernel: Bluetooth: hci0: stop background scanning failed: -16

System information

System Information

version core-2023.4.5
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 Europe/Berlin
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.32.1
Stage running
Available Repositories 1346
Downloaded Repositories 64
HACS Data ok
Home Assistant Cloud
logged_in true
subscription_expiration 17. Mai 2023 um 02:00
relayer_connected true
relayer_region eu-central-1
remote_enabled true
remote_connected true
alexa_enabled true
google_enabled true
remote_server eu-central-1-4.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.0
update_channel stable
supervisor_version supervisor-2023.04.0
agent_version 1.5.1
docker_version 23.0.3
disk_total 916.9 GB
disk_used 48.8 GB
healthy true
supported true
board yellow
supervisor_api ok
version_api ok
installed_addons SSH & Web Terminal (13.1.0), Studio Code Server (5.5.6), MariaDB (2.5.2), AirCast (3.5.2), RPC Shutdown (2.2), Samba share (10.0.0), AdGuard Home (4.8.6), AppDaemon (0.12.1), Network UPS Tools (0.11.2), phpMyAdmin (0.8.5), ESPHome (2023.3.2), Node-RED (14.1.4), Vaultwarden (Bitwarden) (0.19.3), Spotify Connect (0.12.3), Samba Backup (5.2.0), Matter Server (4.3.1), Mosquitto broker (6.2.0), MQTT Explorer (browser-1.0.1), VLC (0.1.3), NetDaemon V3.1 (.NET 7) (23.15.0), Nginx Proxy Manager (0.12.3), Z-Wave JS (0.1.77), OpenThread Border Router (1.2.0)
Dashboards
dashboards 5
resources 22
views 29
mode storage
Recorder
oldest_recorder_run 9. April 2023 um 09:07
current_recorder_run 19. April 2023 um 00:54
estimated_db_size 964.77 MiB
database_engine mysql
database_version 10.6.10
Spotify
api_endpoint_reachable ok

Additional information

Core Logs:
`Logger: bluetooth_auto_recovery.recover
Source: components/bluetooth/util.py:78
First occurred: 01:03:46 (2437 occurrences)
Last logged: 11:13:15

Bluetooth adapter hci0 [E4:5F:01:6F:FF:84] could not be reset due to timeout`

`Logger: homeassistant.components.bluetooth.scanner
Source: components/bluetooth/scanner.py:305
Integration: Bluetooth (documentation, issues)
First occurred: 01:03:47 (1219 occurrences)
Last logged: 11:13:15

hci0 (E4:5F:01:6F:FF:84): Failed to restart Bluetooth scanner: hci0 (E4:5F:01:6F:FF:84): Failed to start Bluetooth: [org.bluez.Error.InProgress] Operation already in progress
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 223, in _async_start
await self.scanner.start() # type: ignore[no-untyped-call]
File "/usr/local/lib/python3.10/site-packages/bleak/init.py", line 182, in start
await self._backend.start()
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/scanner.py", line 191, in start
self._stop = await manager.active_scan(
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 368, in active_scan
assert_reply(reply)
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/utils.py", line 22, in assert_reply
raise BleakDBusError(reply.error_name, reply.body)
bleak.exc.BleakDBusError: [org.bluez.Error.InProgress] Operation already in progress

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 350, in _async_restart_scanner
await self._async_start()
File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 305, in _async_start
raise ScannerStartError(
homeassistant.components.bluetooth.scanner.ScannerStartError: hci0 (E4:5F:01:6F:FF:84): Failed to start Bluetooth: [org.bluez.Error.InProgress] Operation already in progress`

@ghost ghost added the bug label Apr 19, 2023
@agners agners added board/yellow Home Assistant Yellow bluetooth labels Apr 19, 2023
@agners
Copy link
Member

agners commented Apr 19, 2023

HAOS 10 uses the same firmware git hash as HAOS 9 is using:

So that would mean that the new BlueZ version (5.66) or the new Kernel 6.1 is causing this problem.

@bdraco have you seen such regressions with newer BlueZ/Kernel versions?

@Dillton
Copy link

Dillton commented Apr 19, 2023

Hi.
I am experiencing similar issue with my HP mini PC running HA in Proxmox and using Intel 9560 with iwlwifi firmware.
VM log:
Bluetooth: hci0: Opcode 0x2043 failed: -110
Bluetooth: hci0: request failed to create LE connection: err -110
Bluetooth: hci0: Opcode 0x 401 failed: -16

Inside HA I am using Awox community integration for Awox bluetooth lights and since yesterday update its completely unusable. Below screen from history of lights mesh and one light where you can see before 7PM (time of updating my system) the connection was stable.
image

FYI:
BT device is correctly recognized in my system.
image

@Heronimonimo
Copy link

Same issue here after upgrading to 10.0 running on a Proxmox VM on a Intel Nuc from the 8th generation.

@scetu
Copy link

scetu commented Apr 20, 2023

Same issue, Odroid N2+, my switchbots are mostly not responding.

@cnestande
Copy link

I experience the same issue on an Intel NUC with HAOS 10, worked fine before the upgrade to HAOS 10.

@Heronimonimo
Copy link

Same issue here after upgrading to 10.0 running on a Proxmox VM on a Intel Nuc from the 8th generation.

Downgrading HA OS to 9.5 fixed it for me.

@240Sidan
Copy link

Same issue here after upgrading to 10.0 running on a Proxmox VM on a Intel Nuc from the 8th generation.

Downgrading HA OS to 9.5 fixed it for me.

Is it the core you downgraded? Or how do you downgrade to 9.5?

@ghost
Copy link
Author

ghost commented Apr 20, 2023

Is it the core you downgraded? Or how do you downgrade to 9.5?

With the command:
ha os update --version 9.5

@240Sidan
Copy link

Same issue here after upgrading to 10.0 running on a Proxmox VM on a Intel Nuc from the 8th generation.

Downgrading HA OS to 9.5 fixed it for me.

Is it the core you downgraded? Or how do you downgrade to 9.5?

Thanks will try it when I get home

@cmangla
Copy link

cmangla commented Apr 20, 2023

I'm experiencing a similar issue on Raspberry Pi 3: logs below.

    raise ScannerStartError(
homeassistant.components.bluetooth.scanner.ScannerStartError: hci0 (B8:27:EB:0C:C4:F6): Failed to start Bluetooth: [org.bluez.Error.InProgress] Operation already in progress
2023-04-20 11:08:42.554 WARNING (MainThread) [bluetooth_auto_recovery.recover] Bluetooth adapter hci0 [B8:27:EB:0C:C4:F6] could not be reset due to timeout
2023-04-20 11:08:47.969 WARNING (MainThread) [bluetooth_auto_recovery.recover] Bluetooth adapter hci0 [B8:27:EB:0C:C4:F6] could not be reset due to timeout
2023-04-20 11:08:48.046 ERROR (MainThread) [homeassistant.components.bluetooth.scanner] hci0 (B8:27:EB:0C:C4:F6): Failed to restart Bluetooth scanner: hci0 (B8:27:EB:0C:C4:F6): Failed to start Bluetooth: [org.bluez.Error.InProgress] Operation already in progress
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 223, in _async_start
    await self.scanner.start()  # type: ignore[no-untyped-call]
  File "/usr/local/lib/python3.10/site-packages/bleak/__init__.py", line 182, in start
    await self._backend.start()
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/scanner.py", line 191, in start
    self._stop = await manager.active_scan(
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 368, in active_scan
    assert_reply(reply)
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/utils.py", line 22, in assert_reply
    raise BleakDBusError(reply.error_name, reply.body)
bleak.exc.BleakDBusError: [org.bluez.Error.InProgress] Operation already in progress
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 350, in _async_restart_scanner
    await self._async_start()
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 305, in _async_start
    raise ScannerStartError(
homeassistant.components.bluetooth.scanner.ScannerStartError: hci0 (B8:27:EB:0C:C4:F6): Failed to start Bluetooth: [org.bluez.Error.InProgress] Operation already in progress

@agners agners added board/generic-x86-64 Generic x86-64 Boards (like Intel NUC) board/raspberrypi Raspberry Pi Boards labels Apr 20, 2023
@teranex
Copy link

teranex commented Apr 20, 2023

Same here with HAOS 10 on RPi3. Bluetooth (used for Xiaomi BLE LYWSD03MMC temperature) works for a few hours, then fails and doesn't come back. In 9.5 this sometimes also happened (once every few days), but after a few minutes it automatically came back. Now only a full system reboot helps

@Puma7
Copy link

Puma7 commented Apr 20, 2023

Same here on 2 Intel NUC.
One Intel NUC 11 Essential Kit NUC11ATKC4
and One Intel NUC 12 Pro Kit NUC12WSHi3

on both HA is installed on the internal nvme

config_entry-bluetooth-68b370091bd9558e25d68e230e7092cd.json.txt

config_entry-bluetooth-394b387a8cee694d2e66bb4f34072697.json.txt

@240Sidan
Copy link

Have reverted back to HAOS 9.5 now, and it is much more reliable but sometimes it keeps disconnecting.

Getting this message and then have to reload the Bluetooth integration. 2023-04-20 19:21:15.348 ERROR (MainThread) [homeassistant.components.bluetooth.scanner] hci0 (XX:XX:XX:XX:XX:XX): Error stopping scanner: [org.bluez.Error.InProgress] Operation already in progress

@gcarrarom
Copy link

gcarrarom commented Apr 20, 2023

Same on RPi4. Reboot doesn't help. I'll try to rollback to 9.5 as it used to "kinda" work there - only failing every hour but recovering.
Log entry on v10 of the OS:
Timed out starting Bluetooth after 15 seconds; Retrying in background

@gcarrarom
Copy link

Smells like BLE issue for RPi4:

[core-ssh ~]$ dmesg | grep Blue
89.173721] Bluetooth: Core ver 2.22
89.173853] Bluetooth: HI device and connection manager initialized
89.173873] Bluetooth: HI socket layer initialized
89.173883] Bluetooth: L2CAP socket layer initialized
89.173900] Bluetooth: SCO socket layer initialized
89.184081] Bluetooth: HI UART driver ver 2.3
89.184104] Bluetooth: HI UART protocol H4 registered
89.184176] Bluetooth: HI UART protocol Three-wire (H5) registered
89.184342] Bluetooth: HI UART protocol Broadcom registered
89.660433] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
89.660453] Bluetooth: BNEP filters: protocol multicast
89.660470] Bluetooth: BNEP socket layer initialized
89.665767] Bluetooth: MGMT ver 1.22
137.963015] Bluetooth: RFCOMM TTY layer initialized
137.963052] Bluetooth: RFCOMM socket layer initialized
137.963081] Bluetooth: RFCOM ver 1.11
[22987.140431] Bluetooth: hi0: Opcode 0x200d failed: -110
[22987.140494] Bluetooth: hi: request failed to create LE connection: err -110

@GlenWi
Copy link

GlenWi commented Apr 20, 2023

I had the same problem - 6 Xiaomi humidity/temp sensors not working on HA 10, fine on HA9.5.
I have an Intel NUC running Linux Mint with HA in a Oracle VirtualBox. Using an external Bluetooth dongle on a 1m USB cable - covers the whole house with the 6 sensors.
Screenshot from 2023-04-21 06-50-54

@megaz555
Copy link

Same issue here, running on Intel NUC 7th gen with Proxmox (latest version).

Based on the above feedback, it looks like something is very seriously broken with Bluetooth drivers in HAOS 10.

@obol2
Copy link

obol2 commented Apr 21, 2023

Same with my Intel NUC (HA running on Proxmox). Reverting to version 9.5 fixed the problem.

@osaether
Copy link

osaether commented Apr 21, 2023

Issues here as well. Running HA in a VM in Proxmox.
I have 15 Xiaomi sensors and two Inkbird. A restart of HA bring some back but looses others. I have not managed to get all back.
Reverting to OS v9.5 fixes the problems.

@mcc05
Copy link

mcc05 commented Apr 21, 2023

Same here my bluetooth dongle is not longer recognised
Ok on 9.5

@mariusnauj
Copy link

I experience the same issue on an Intel NUC with HAOS 10, worked fine before the upgrade to HAOS 10.

@240Sidan
Copy link

I experience the same issue on an Intel NUC with HAOS 10, worked fine before the upgrade to HAOS 10.

Try revert back to 9.5 it worked for me
With the command:
ha os update --version 9.5

@mariusnauj
Copy link

Yes we can revert to 9.5, but need that HA fix this issue.

@sairon
Copy link
Member

sairon commented Jun 21, 2023

@bcutter Actually there was this change, as discussed few posts above:

Add patch to fix Bluetooth LE advertisement stall (#2535) (#2598)

Since many of the BT devices are reporting sensor data through BLE advertisements, there is significant chance most of the issues could be resolved with this patch.

@ghost
Copy link

ghost commented Jun 22, 2023

I'm having Bluetooth issue after latest upgrade.

Update:
It is my Bluetooth device running out of battery. Fix seemed to be valid, cheers!

Home Assistant 2023.6.2
Supervisor 2023.06.2
Operating System 10.3
Frontend 20230608.0 - latest

Error I'm getting:
Bluetooth: hci0: Frame reassembly failed (-84)

@thomasvochten
Copy link

thomasvochten commented Jun 22, 2023

Update: seems to be fixed!
My BT devices have been connected for two full days now, so I think it's fixed with OS 10.3

@agners
Copy link
Member

agners commented Jun 22, 2023

On my end too, the Raspberry Pi 3 where I've previously (see #2485 (comment)) was able to reproduce didn't show the problem in 24h+. There are still Bluetooth: hci0: Frame reassembly failed (-84) errors (and the overrun counter on the tty counts up), but it seems with the fix added with PR #2598 indeed addresses the Raspberry Pi issue as well.

I consider this issue closed. If you have Bluetooth issues still, please open a new issue.

@almirus
Copy link

almirus commented Jul 5, 2023

Raspberry Pi 4 and Bluetooth dongle CSR8510 A10

2023-07-04 21:39:04.116 ERROR (MainThread) [root] A message handler raised an exception: 'org.bluez.Device1'.
Traceback (most recent call last):
File "src/dbus_fast/message_bus.py", line 811, in dbus_fast.message_bus.BaseMessageBus._process_message
File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/manager.py", line 854, in _parse_msg
condition_callback()
File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/manager.py", line 709, in callback
self._properties[device_path][defs.DEVICE_INTERFACE][property_name]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'org.bluez.Device1'

after that, i have tons of IO on my SSD

[core-ssh ~]$ iostat -m
Linux 6.1.21-v8 (core-ssh)      07/05/23        _aarch64_       (4 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           6.35    0.00    2.38    0.04    0.00   91.23

Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn
zram1             0.00         0.00         0.00          0          0
zram2             0.13         0.00         0.00          0        150
sda               3.29         0.01         0.03       2232       8375
sda           14938.25         7.29         7.27 9007199254738772 9007199254732713

@agners
Copy link
Member

agners commented Jul 5, 2023

@almirus the logs are from Home Assistant Core, please report the issue in the Core repository.

If the OS indeed has a problem with that particular dongle, please open a new issue since this issue is about the built-in Bluetooth support.

@agners agners added the stable-kernel-regression Issue which appears to be an upstream stable kernel regression label Jul 6, 2023
@agners agners unpinned this issue Jul 6, 2023
@bobmarley2021
Copy link

With the command: ha os update --version 9.5

Thank you! I've been struggling with this for days and have only just come across this issue.

To the HA team:

This is NOT fixed in HA OS 10.3 or 10.4 for me:

Screenshot 2023-08-16 at 20 05 03

Screenshot 2023-08-16 at 20 05 33

Screenshot 2023-08-16 at 20 13 57

I downgraded to 9.5.. works 👍 back to 10.4, it breaks 👎

This whole issue is yet another massive HA goof!... you should rename it Home 'it breaks weekly' Assistant.

The reason I run HA in Proxmox is because of the high likelihood of breakages from updates and changes. I can just snap it and revert. One such goof that springs to mind was that database upgrade failure that caused boot loops requiring manual file deletion and loss of history when you made the initial startup faster. NOT fun!

Perhaps the team need to take a step back from the new features and interface beautifying and look at what really matters: STABILITY.

It's no damn fun when something that runs your entire house has constant issues after updates. April 19th this issue was opened and for me it's still not fixed.

If HA wasn't the most compatible solution (ie. device support) I'd have ditched it long ago for OpenHAB.

Sorry for the rant but this kind of stuff has to stop! I've recommended HA to a couple of people recently and they ditched it because of issues like this! Stop trying to add new features and release updates at the rate of Apple, and focus on making the damn thing not break!

@moroz-slavomir
Copy link

I believe this issue follows up on the problem for other board vendors and VMs #2612. At least the symptoms looks the same.

@agners
Copy link
Member

agners commented Aug 16, 2023

I am very sorry for the troubles you have.

Unfortunately, that regression is not a problem directly caused by changes on our side. Instead, this is a problem in the upstream Linux kernel. Between Linux 5.15 and 6.1 larger parts of the Bluetooth stack got reworked, and this seems to cause havoc especially on our use case.

Large part of the regression we've been able to solve by reverting changes made in the latest version of Linux (see this mailing list post and the many reports who say thigns work now for them, in this issue as well as in #2535). FWIW, I've tried to understand and fix the issues but the Bluetooth stack is not trivial, and the problem seems to be related to a race condition, which are especially hard to find and fix. Currently we do live with the work around, and it seems to have fixed many installations, including the unit I had here where I was able to reproduce the problem.

Unfortunately there seems more to it, and your installation has troubles still 😢

@bobmarley2021 BUT: It realllly doesn't help to comment on a issue, which is not related to your board (this is about RPi), and where the symptoms look different! If you want us to have a real look into your particular issue, please open a new issue, along with all the relevant information (such as type of Bluetooth hardware).

Unfortunately, we work with very very diverse type of hardware. Heck we found bugs in x86-64 which even large distros like Ubuntu didn't catch, just because HAOS users run on very old x86 machines at times. We simply can't guarantee stability on every platform in the world. That is exactly why we have the option to downgrade the operating system, to bridge the time until the issue has been addressed.

If HA wasn't the most compatible solution (ie. device support) I'd have ditched it long ago for OpenHAB.

I can pretty much guarantee you that if OpenHAB would have that Bluetooth support, you'd run into the same issue, since the issue is actually in the Linux kernel.

@ellnic please share such generic rants in the community forum or somewhere else, it is really not helpful in an issue tracker.

@ellnic
Copy link

ellnic commented Aug 16, 2023

@agners My appologies - I've deleted my comment. FWIW though, I do feel bobmarley2021's pain. Issues with HA are not few and far between.

@bdraco
Copy link
Member

bdraco commented Aug 16, 2023

The Linux kernel does not prioritize Bluetooth stability and likely only will if Linux makes significant headway into the desktop market. There need to be more kernel developers interested in or have use cases for Bluetooth to ensure it keeps working.

https://esphome.github.io/bluetooth-proxies/ is a much better choice if you want a just-works solution, as working Bluetooth is critical to the Espressif product line.

@bobmarley2021
Copy link

@bobmarley2021 BUT: It realllly doesn't help to comment on a issue, which is not related to your board (this is about RPi)

I didn't realise that.

This comment and this one and this and many others talk of virtualisation and Intel hardware so I wrongly assumed that whilst OP was on a Pi that it was an arch free for all.

I'm going to do as @bdraco suggests and give the proxy a go. Thanks for the explanation re upstream kernels.

Finally, I would like to apologise for getting on my soap box, but I'm 2 years in and I often feel like the HA journey is a grind not a glide.

@agners
Copy link
Member

agners commented Aug 16, 2023

@bdraco I do Arch Linux (which uses pretty recent Linux kernels) on my Desktop and listen to music with Bluetooth headphones daily and use a Bluetooth HID mouse on my Laptop with Linux. And I must say, both use cases work really reliable for hours, even with recent kernels.

I think the bugs we hit on Linux are really related to how we use the Bluetooth stack. It seems that constant scanning or something triggers bugs in the stack 😢

Another problem seems to be the HCI protocol: It assumes a reliable transport underneath (as in, no bytes should get lost, ever). That is typically true, but when connected through serial (like on RPi), or virtualization is at play, things might get messy, and it seems to me that the HCI protocol is not well prepared for that. Again, this are environments/situations where typical desktops OSs are not running in...

Also, at least a coule of years ago Bluetooth on Windows was really horrible as well: Every vendor shipped his own stack, and interoperability was quite bad. I remember I've had issues on Windows 10 with my Bluetooth mouse all the time. It might be better nowadays, but being a Desktop operating system seems not to guarantee high Bluetooth driver quality 😉

Using ESP32, capture just BLE and use our own TCP based "HCI" (which the API between ESPHome and HA is essentially) side steps the problem completely. It has much fewer features then a full featured Bluetooth stack, but It fits exactly our use case 👍 . FWIW, I think the changes introduced in the kernel were mainly driven by Bluetooth Mesh support. Not really used, but still caused changes throughout the stack.

@bdraco
Copy link
Member

bdraco commented Aug 16, 2023

@bdraco I do Arch Linux (which uses pretty recent Linux kernels) on my Desktop and listen to music with Bluetooth headphones daily and use a Bluetooth HID mouse on my Laptop with Linux. And I must say, both use cases work really reliable for hours, even with recent kernels.

I also have zero trouble with my non-virtualized Feasycom FSC-BP119s. Its pretty clear experience varies across the board here and adding virtualization into the mix is a big wild card. The proxies are a great choice for anyone having trouble since trying to get it working if its already not reliable is usually an exercise in frustration that can be avoided with the proxies. I've given up trying to troubleshooting most bluetooth issues (sometimes the issue is obvious) and usually go strait to recommending the proxies as it almost always ends the same way, and it saves everyone involved hours/days of frustration

@teranex
Copy link

teranex commented Sep 10, 2023

After upgrading to Home Assistant 2023.9.1 this problem seems to be back. Upgraded yesterday, have had to fully reboot my RPi3 twice since then after bluetooth devices (temperature sensors) became unavailable.

@Jc2k
Copy link
Member

Jc2k commented Sep 10, 2023

If upgrading to 2023.9.1 did cause it then it's a different bug. This bug was closed after fixing a bug in Linux's Bluetooth kernel drivers. Those are part of the operating system and shipped separately to the 2023.9.1 application update. Does downgrading/reverting fix it? (This is an important step to validate the root cause).

@bdraco
Copy link
Member

bdraco commented Sep 10, 2023

It means the adapter is locking up/crashing, but there is a regression in the reset code that tries to recovery/power cycle the adapter in 2023.9.1 that is fixed in 2023.9.2 via home-assistant/core#99979

You can manually unplug/power cycle the adapter in the mean time or replace it with an adapter that doesn't lock up.

@randomizeusr
Copy link

H have exactly this issue since updating to HA OS 10.0. I use HP T530 PC with internal WIFI/bluetooth card and generic HA installation.
I tried all OS version up ti 10.5 but the problem persist. Downgrading to HA OS 9.5 solves the issue.
I have 8 Xiaomi temperature and humidity sensor communicating with bluetooth.

I hope HA team can solve bluetooth issue soon.

@Sorien
Copy link

Sorien commented Sep 18, 2023

@randomizeusr proper fix from one of Bluetooth Linux stack maintainers fcf6156 was added to HAOS at 30. August... last version 10.5 is from 16. August so I would just wait for 10.6 and try it again

@Grey-Lancaster
Copy link

problem still exists

@bobmarley2021
Copy link

Yeah, I'm still on 9.5 as well. Every time a new release comes out and I move to it, BT fails and I move back to 9.5

@gene-ressler
Copy link

gene-ressler commented Aug 19, 2024

Brand new GMKtec NucBox5 / KB5 (Intel N5105) running most recent HAOS 12.4. Same bad behavior. Hope this will be fixed soon.

@GSzabados
Copy link

This issue has been solved more than a year ago. If any of you see any similar behaviour, then you need to open a new issue and provide all the possible details that you can. HAOS is at version 13 already!

@bdraco, could you please close this issue for further comments?

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Aug 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bluetooth board/raspberrypi Raspberry Pi Boards board/yellow Home Assistant Yellow bug stable-kernel-regression Issue which appears to be an upstream stable kernel regression
Projects
None yet
Development

No branches or pull requests