Closed bsjouke closed 2 weeks ago
Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (bluetooth
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
bluetooth documentation bluetooth source (message by IssueLinks)
Having this happen quite often on RPI4, with both the internal BT and a BCOM dongle.
Hello, I am experiencing the exact same issue. I have a switchbot integration and it keeps losing connectivity with the bluetooth adapter. I have tried using the Raspberry PI 4 internal and a usb dongle. I am running core-2024-1.2.
Reporting the same issue with a Dell/Wyse 3040 Thin Client and internal BT. Core 2024.1.2 Supervisor 2023.12.0 Operating System 11.4 Frontend 20240104.0
2024-01-10 11:04:39.901 ERROR (MainThread) [habluetooth.scanner] hci0 (A8:1D:16:09:05:30): Error stopping scanner: [org.freedesktop.DBus.Error.UnknownObject] Method "StopDiscovery" with signature "" on interface "org.bluez.Adapter1" doesn't exist
2024-01-10 11:04:41.417 ERROR (MainThread) [habluetooth.scanner] hci0 (A8:1D:16:09:05:30): Failed to restart Bluetooth scanner: hci0 (A8:1D:16:09:05:30): Failed to start Bluetooth: [org.freedesktop.DBus.Error.UnknownObject] Method "SetDiscoveryFilter" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn't exist
File "src/habluetooth/scanner.py", line 232, in habluetooth.scanner.HaScanner._async_start
File "src/habluetooth/scanner.py", line 233, in habluetooth.scanner.HaScanner._async_start
File "src/habluetooth/scanner.py", line 362, in habluetooth.scanner.HaScanner._async_restart_scanner
File "src/habluetooth/scanner.py", line 315, in _async_start
habluetooth.scanner.ScannerStartError: hci0 (A8:1D:16:09:05:30): Failed to start Bluetooth: [org.freedesktop.DBus.Error.UnknownObject] Method "SetDiscoveryFilter" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn't exist
2024-01-10 11:05:14.912 WARNING (MainThread) [bluetooth_auto_recovery.recover] Could not determine the power state of the Bluetooth adapter hci0 [A8:1D:16:09:05:30] due to timeout after 5 seconds
2024-01-10 11:05:20.586 WARNING (MainThread) [bluetooth_auto_recovery.recover] Could not cycle the Bluetooth adapter hci0 [A8:1D:16:09:05:30]: [Errno 110] Operation timed out
2024-01-10 11:05:20.591 WARNING (MainThread) [bluetooth_auto_recovery.recover] Bluetooth management socket connection lost: [Errno 22] Invalid argument
2024-01-10 11:05:25.591 WARNING (MainThread) [bluetooth_auto_recovery.recover] Bluetooth adapter hci0 [A8:1D:16:09:05:30] could not be reset:
2024-01-10 11:05:25.597 WARNING (MainThread) [bluetooth_auto_recovery.recover] Closing Bluetooth adapter hci0 [A8:1D:16:09:05:30] failed: [Errno 9] Bad file descriptor
2024-01-10 11:05:27.112 ERROR (MainThread) [habluetooth.scanner] hci0 (A8:1D:16:09:05:30): Failed to restart Bluetooth scanner: hci0 (A8:1D:16:09:05:30): Failed to start Bluetooth: [org.freedesktop.DBus.Error.UnknownObject] Method "SetDiscoveryFilter" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn't exist
This happens to me when I start the computer. I just can solve it by extracting the BT DG45 dongle and introducing it again It seems that the Bluetooth adapter affects also the zigbee one
I did two actions which make it confusing to determine which of the two helped.
I won't close this issue as I think my solution may not be suitable for all, and the root cause is still unknown.
Also having this issue with RPI4 internal adaptor. @bsjouke can you explain how you change the order?
FYI, this is what keeps cycling in the logs:
2024-01-13 22:21:29.198 DEBUG (MainThread) [homeassistant.components.bluetooth] Rediscovered adapters: {'hci0': {'address': 'D8:3A:DD:10:0E:72', 'sw_version': 'homeassistant', 'hw_version': 'usb:v1D6Bp0246d0546', 'passive_scan': True, 'manufacturer': None, 'product': None, 'vendor_id': None, 'product_id': None}}
2024-01-13 22:21:29.331 DEBUG (MainThread) [bluetooth_auto_recovery.recover] Attempting to recover bluetooth adapter hci0 with mac address D8:3A:DD:10:0E:72
2024-01-13 22:21:29.332 DEBUG (MainThread) [bluetooth_auto_recovery.recover] Attempting to power cycle bluetooth adapter hci0 [D8:3A:DD:10:0E:72]
2024-01-13 22:21:29.334 DEBUG (MainThread) [bluetooth_auto_recovery.recover] Found adapters from hci: {0: {'dev_id': 0, 'name': 'hci0', 'bdaddr': 'D8:3A:DD:10:0E:72', 'flags': 5, 'type': 3, 'features': <ifaddr._shared.c_ubyte_Array_8 object at 0x7f7b53af00>, 'pkt_type': 52472, 'link_policy': 5, 'link_mode': 32768, 'acl_mtu': 1021, 'acl_pkts': 8, 'sco_mtu': 64, 'sco_pkts': 1, 'stat': <bluetooth_adapters.systems.linux_hci.hci_dev_stats object at 0x7f7b53b530>}}
2024-01-13 22:21:29.335 DEBUG (MainThread) [bluetooth_auto_recovery.recover] Found adapter D8:3A:DD:10:0E:72 in hci device as 0
2024-01-13 22:21:29.335 DEBUG (MainThread) [bluetooth_auto_recovery.recover] hci0 (D8:3A:DD:10:0E:72) idx is 0
2024-01-13 22:21:29.338 DEBUG (MainThread) [bluetooth_auto_recovery.recover] Attempting to power cycle bluetooth adapter hci0 [D8:3A:DD:10:0E:72]
2024-01-13 22:21:29.349 DEBUG (MainThread) [btsocket.btmgmt_protocol] Decoding bluetooth_version as type IntUL
2024-01-13 22:21:29.357 DEBUG (MainThread) [btsocket.btmgmt_protocol] Socket Read:
Also having this issue with RPI4 internal adaptor. @bsjouke can you explain how you change the order?
I'm running HA in OVA mode as VM on a Synology box. In the settings I can add attached devces like this:
Months ago I also experienced problems, and at that moment this setting helped:
Recently it did not work anymore, @andrezstar2's remark about the adapters affecting each other gave me the idea to switch the two as in the screenprint.
All in all this doesn't seem a stable situation as to my best knowledge the order of USB devices should have no impact.
I can fix it by disabling the bluetoith, rebooting the device then once it's started, enabling the device
On Sun, 14 Jan 2024, 08:02 bsjouke, @.***> wrote:
Also having this issue with RPI4 internal adaptor. @bsjouke https://github.com/bsjouke can you explain how you change the order?
I'm running HA in OVA mode as VM on a Synology box. In the settings I can add attached devces like this: image.png (view on web) https://github.com/home-assistant/core/assets/11473110/1b130cde-edad-43eb-9686-088a93a09756
Months ago I also experienced problems, and at that moment this setting helped:
- ZB adapter
- blank
- BT adapter
Recently it did not work anymore, @andrezstar2 https://github.com/andrezstar2's remark about the adapters affecting each other gave me the idea to switch the two as in the screenprint.
All in all this doesn't seem a stable situation as to my best knowledge the order of USB devices should have no impact.
— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/107554#issuecomment-1890877354, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANS4VDQ3KAZY5QIDQA4GBVLYOOGIJAVCNFSM6AAAAABBRVM6I2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJQHA3TOMZVGQ . You are receiving this because you commented.Message ID: @.***>
I can fix it by disabling the bluetoith, rebooting the device then once it's started, enabling the device
I tried that but it didn't work for me. Both built-in and dongle Bluetooth adapters are still failing.
Yeah, still seeing this issue here. No combination of reboots seems to fix it.
Reporting the same issue with a Dell/Wyse 3040 Thin Client and internal BT. Core 2024.1.2 Supervisor 2023.12.0 Operating System 11.4 Frontend 20240104.0
2024-01-10 11:04:39.901 ERROR (MainThread) [habluetooth.scanner] hci0 (A8:1D:16:09:05:30): Error stopping scanner: [org.freedesktop.DBus.Error.UnknownObject] Method "StopDiscovery" with signature "" on interface "org.bluez.Adapter1" doesn't exist 2024-01-10 11:04:41.417 ERROR (MainThread) [habluetooth.scanner] hci0 (A8:1D:16:09:05:30): Failed to restart Bluetooth scanner: hci0 (A8:1D:16:09:05:30): Failed to start Bluetooth: [org.freedesktop.DBus.Error.UnknownObject] Method "SetDiscoveryFilter" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn't exist File "src/habluetooth/scanner.py", line 232, in habluetooth.scanner.HaScanner._async_start File "src/habluetooth/scanner.py", line 233, in habluetooth.scanner.HaScanner._async_start File "src/habluetooth/scanner.py", line 362, in habluetooth.scanner.HaScanner._async_restart_scanner File "src/habluetooth/scanner.py", line 315, in _async_start habluetooth.scanner.ScannerStartError: hci0 (A8:1D:16:09:05:30): Failed to start Bluetooth: [org.freedesktop.DBus.Error.UnknownObject] Method "SetDiscoveryFilter" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn't exist 2024-01-10 11:05:14.912 WARNING (MainThread) [bluetooth_auto_recovery.recover] Could not determine the power state of the Bluetooth adapter hci0 [A8:1D:16:09:05:30] due to timeout after 5 seconds 2024-01-10 11:05:20.586 WARNING (MainThread) [bluetooth_auto_recovery.recover] Could not cycle the Bluetooth adapter hci0 [A8:1D:16:09:05:30]: [Errno 110] Operation timed out 2024-01-10 11:05:20.591 WARNING (MainThread) [bluetooth_auto_recovery.recover] Bluetooth management socket connection lost: [Errno 22] Invalid argument 2024-01-10 11:05:25.591 WARNING (MainThread) [bluetooth_auto_recovery.recover] Bluetooth adapter hci0 [A8:1D:16:09:05:30] could not be reset: 2024-01-10 11:05:25.597 WARNING (MainThread) [bluetooth_auto_recovery.recover] Closing Bluetooth adapter hci0 [A8:1D:16:09:05:30] failed: [Errno 9] Bad file descriptor 2024-01-10 11:05:27.112 ERROR (MainThread) [habluetooth.scanner] hci0 (A8:1D:16:09:05:30): Failed to restart Bluetooth scanner: hci0 (A8:1D:16:09:05:30): Failed to start Bluetooth: [org.freedesktop.DBus.Error.UnknownObject] Method "SetDiscoveryFilter" with signature "a{sv}" on interface "org.bluez.Adapter1" doesn't exist
I added an Asus BT400 to my setup and now have 2 adapters (internal/external) which ran for 36 hours with out any issues. I am monitoring 2 InkBird sensors and for some reason the IBS-TH2 will only pair with the internal but the IBS-TH2 will pair with either. The Asus bt400 has never had an issue going offline but the internal one, AzureWave, which is a combo wifi+bt has all the issues. I lose wifi access when the adapter goes offline. HAOS 11.3 was the first to support the wifi chip.
I have created a time based automation to reboot the host every 8 hours but have it disabled since mine appears to be less of an issue for now
Any more ideas? This is becoming too frequent
Same issue here with generic x86 and built-in BT. Had BT disabled for along time but added two SwtichBot BLE sensors yesterday and enabled BT then. Issues as above in less than 24 hours. Warm restart of the host is not enough to fix it. Have not tested cold restart yet.
(Edit: ZHA went down at the same time but got back after the warm restart of the host.)
An issue for me also, I have worked around it with an automation that reboots home assistant if a bluetooth sensor goes unavailable which is a band-aid at best.
I have an issue where my Bluetooth sensor becomes unavailable. I thought it was a proxy issue or the inkbird integration. A reboot of HA always fixes the issue. How do you tell if it is the Bluetooth itself causing the issue versus the other variant? First started seeing this several months ago.
I have an issue where my Bluetooth sensor becomes unavailable. I thought it was a proxy issue or the inkbird integration. A reboot of HA always fixes the issue. How do you tell if it is the Bluetooth itself causing the issue versus the other variant? First started seeing this several months ago.
I would say, does it resolve after a warm restart or do you need to do a hardware reboot? If it works with a restart then it might be the inkbird sensor connectivity, etc, but if if requires a reboot then it is the Bluetooth adapter.
Mine would only resolve with a reboot. I also can connect to my Inkbird sensors with the Engbird mobile app when HA shows it unavailable.
My new BLE adapter has been running fine for maybe eight hours now. https://github.com/home-assistant/core/issues/92379#issuecomment-1927180028
I had two updates to HA, one was the OS and the other was the supervisor, bluetooth seems to be configured:
I was told in a different issue to disable the adapter 's Bluetooth as I use the Bluetooth proxy. So far this has worked successfully for me.
I got same problem:
after x hours..I can not control Switchbot I have to go to devices -> bluetooth -> RELEAD then switchbox controls in HA is working again. (or reboot HA)
(Passive scanning ON/OFF does not make difference, problems comes back after x hours)
Core 2024.2.2 Supervisor 2024.01.1 Operating System 11.5 Frontend 20240207.1
Bluetooth info (hci0 (MAC-address)) Device info: Unknown by Raspberry Pi Trading Ltd Firmware: homeassistant
I checked the LOG VIEWER and I see a lot of times: INFO (MainThread) [habluetooth.scanner] hci0 (MAC-address): Bluetooth scanner has gone quiet for 90s, restarting
after this, it's working again...a couple of minutes
Bluetooth proxy.
How do you use this? on a raspberry pi 3?
I have Raspberry Pi 4 (rpi4-64) I do not use 'Bluetooth proxy'
(going to disable passive scan option again, just to see if there is any difference)
Workaround:
- physically disconnect and reconnect the bluetooth device from/to USB
It looks like you are using a Realtek adapter
"manufacturer": "Realtek",
"product": "Bluetooth Radio",
"vendor_id": "2550",
"product_id": "8761"
Sadly these adapters are known to lock up and require a physical unplug and replug to restore their functionality.
https://www.home-assistant.io/integrations/bluetooth/#realtek-rtl8761bu-adapters
These adapters do not have a reset pin. If they stop responding, there is currently no way for the kernel to reset them automatically.
The only solution other than to unplug and replug is to replace it with an adapter that does have a reset pin https://www.home-assistant.io/integrations/bluetooth/#cambridge-silicon-radio-csr--based-adapters
or use an ESPHome Bluetooth proxy https://esphome.io/components/bluetooth_proxy.html https://esphome.io/projects/?type=bluetooth
I switched a couple of months ago to ESPHome Bluetooth proxy (and disabled local bluetooth) and so far no problem anymore! Cheap sollution and even better because it's now located in center of building.
The problem
The issue is that the Bluetooth adapter seems to become unreachable thus the connection with the BLE devices is lost.
The issue occurs:
Logging: See below in the details
Workaround:
What version of Home Assistant Core has the issue?
core-2023.12.4
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
config_entry-bluetooth-80939c045beed540f2ed6f89b57a0e32.json.txt
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response