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 integration failing to initialize #121961

Closed
rahulpdev opened this issue Jul 15, 2024 · 12 comments
Closed

Bluetooth integration failing to initialize #121961

rahulpdev opened this issue Jul 15, 2024 · 12 comments

Comments

@rahulpdev
Copy link

The problem

After working seamlessly for nearly two years a couple of days ago my bluetooth integration has stopped working and I can see that the integration is failing to load. The only event that has occurred during this time is that my area suffered a power cut that caused full power loss to my house. My Home Assistant Yellow and HAOS are otherwise working as normal since that event and I have a Avantree DG40S USB Adapter connected to the Yellow via a USB 2.0 cable.

What version of Home Assistant Core has the issue?

core-2024.5.3

What was the last working version of Home Assistant Core?

core-2024.5.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

bluetooth

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: bluetooth_auto_recovery.recover
Source: components/bluetooth/__init__.py:320
First occurred: July 14, 2024 at 6:27:17 PM (405 occurrences)
Last logged: 6:48:24 AM

Could not cycle the Bluetooth adapter hci0 [00:00:00:00:00:00]: [Errno 110] Operation timed out

Logger: bluetooth_auto_recovery.recover
Source: runner.py:190
First occurred: July 14, 2024 at 6:27:17 PM (405 occurrences)
Last logged: 6:48:24 AM

Bluetooth management socket connection lost: [Errno 22] Invalid argument

Logger: bluetooth_auto_recovery.recover
Source: config_entries.py:575
First occurred: July 14, 2024 at 6:26:56 PM (1215 occurrences)
Last logged: 6:48:29 AM

Could not determine the power state of the Bluetooth adapter hci0 [00:00:00:00:00:00] due to timeout after 5 seconds
Could not reset the power state of the Bluetooth adapter hci0 [00:00:00:00:00:00] due to timeout after 5 seconds
Closing Bluetooth adapter hci0 [00:00:00:00:00:00] failed: [Errno 9] Bad file descriptor

Additional information

No response

@home-assistant
Copy link

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!

Code owner commands

Code owners of bluetooth can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign bluetooth Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


bluetooth documentation
bluetooth source
(message by IssueLinks)

@mib1185
Copy link
Contributor

mib1185 commented Jul 15, 2024

maybe the USB adapter died 🤔 try connecting the adapter to any other PC and check it it will be detected as Bluetooth device

@Dwarfex
Copy link

Dwarfex commented Jul 17, 2024

Happens to me on the yellow

@mib1185
Copy link
Contributor

mib1185 commented Jul 17, 2024

@Dwarfex any further information? Same usb adapter? same circumstances with power outage?

@Dwarfex
Copy link

Dwarfex commented Jul 17, 2024

@mib1185 pretty identical painting -

thus no known power outage and no further devices added via the integration

2024-07-13 22:35:20.167 WARNING (MainThread) [bluetooth_auto_recovery.recover] Could not determine the power state of the Bluetooth adapter hci0 [00:00:00:00:00:00] due to timeout after 5 seconds
2024-07-13 22:35:41.185 WARNING (MainThread) [bluetooth_auto_recovery.recover] Could not cycle the Bluetooth adapter hci0 [00:00:00:00:00:00]: [Errno 110] Operation timed out
2024-07-13 22:35:41.187 WARNING (MainThread) [bluetooth_auto_recovery.recover] Bluetooth management socket connection lost: [Errno 22] Invalid argument
2024-07-13 22:35:46.187 WARNING (MainThread) [bluetooth_auto_recovery.recover] Could not reset the power state of the Bluetooth adapter hci0 [00:00:00:00:00:00] due to timeout after 5 seconds
2024-07-13 22:35:46.191 WARNING (MainThread) [bluetooth_auto_recovery.recover] Closing Bluetooth adapter hci0 [00:00:00:00:00:00] failed: [Errno 9] Bad file descriptor

with the builtin cm4 bluetooth module from the yellow

Versions:
Core - 2024.7.2
Supervisor - 2024.06.2
Operating System - 12.4
Frontend - 20240710.0

Edit: did a complete reboot, problem seems to be gone for now -> will double check

@bdraco
Copy link
Member

bdraco commented Jul 17, 2024

00:00:00:00:00:00 means the mac address can't be read which means is either a hardware problem, driver/kernel (operating system) problem. You'll have better luck getting help on discord in #bluetooth since this repo is for core issues so you likely won't get help with that here.

@Dwarfex
Copy link

Dwarfex commented Jul 17, 2024

@bdraco aye - thx ... so more a duplication of #92379?

@bdraco
Copy link
Member

bdraco commented Jul 17, 2024

@bdraco aye - thx ... so more a duplication of #92379?

Maybe. The original kernel bug that was for that one has been fixed (at least with HAOS), but there are obviously more.

@rahulpdev
Copy link
Author

@mib1185 I plugged the DG40S into my laptop and windows is picking up the bluetooth device. I also purchased a DG45 and switched it out with the original adapter on my Yellow, just to see what happens, and experienced the same outcome. I've tried deleting the bluetooth integration in HAOS and then reinstalling the integration and reconnecting the adapter but HAOS now returns the message "No unconfigured Bluetooth adapters found. There are 0 ignored adapters."

@mib1185
Copy link
Contributor

mib1185 commented Jul 18, 2024

@rahulpdev there were some kernel bugs in HAOS, which are solved (see #121961 (comment)). You may need to update your HAOS first and maybe also HA Core. But as @bdraco mentioned in #121961 (comment) you should look for support on our chat server or forum.

@rahulpdev
Copy link
Author

@mib1185 updating HAOS seems to have done the trick thanks! It looks as though if I want to avoid such problems in the future I would be better off using Bluetooth proxy? I'm totally new to the concept of Bluetooth proxy but since I have only four BLE devices it seems a feasible solution.

@mib1185
Copy link
Contributor

mib1185 commented Jul 18, 2024

As you got the issue solved by updating tha HAOS, I'm going to close this issue report. If you still need support in Bluetooth topics, feel free to join our chat server or forum, thx 👍

@mib1185 mib1185 closed this as completed Jul 18, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants