operating-system: Bluetooth failing after upgrade to HAOS 10 on Intel Bluetooth hardware

Can you check the kernel log, to see if the problem starts similarly, e.g. using:

ha host logs -t kernel -n 1000000 -b 0 | grep Bluetooth | head -n 100

@agners This is the result of the command Captura de pantalla 2023-05-03 220333

I don’t know if this is related but In Home Assistant System>Logs> Host is full of messages like this:

May 03 20:09:04 homeassistant systemd[1]: run-docker-runtime\x2drunc-moby-799946efbb48db91e285d1e93f36945c7175e095d2a5a9fe838fde71f8e6ffdf-runc.jJmMvJ.mount: Deactivated successfully. May 03 20:09:20 homeassistant systemd[1]: run-docker-runtime\x2drunc-moby-7aee883888a9e7d1b71b97ddbc2b231c2763cc47b14b2c728d6d0de7ab1c2e00-runc.RpO30d.mount: Deactivated successfully. May 03 20:09:34 homeassistant systemd[1]: run-docker-runtime\x2drunc-moby-799946efbb48db91e285d1e93f36945c7175e095d2a5a9fe838fde71f8e6ffdf-runc.sMXYc7.mount: Deactivated successfully. May 03 20:09:50 homeassistant systemd[1]: run-docker-runtime\x2drunc-moby-7aee883888a9e7d1b71b97ddbc2b231c2763cc47b14b2c728d6d0de7ab1c2e00-runc.QivMYX.mount: Deactivated successfully. May 03 20:10:04 homeassistant systemd[1]: run-docker-runtime\x2drunc-moby-799946efbb48db91e285d1e93f36945c7175e095d2a5a9fe838fde71f8e6ffdf-runc.ypP5rP.mount: Deactivated successfully. May 03 20:10:20 homeassistant systemd[1]: run-docker-runtime\x2drunc-moby-7aee883888a9e7d1b71b97ddbc2b231c2763cc47b14b2c728d6d0de7ab1c2e00-runc.r9dWM5.mount: Deactivated successfully.

_Originally posted by @SrBurner in https://github.com/home-assistant/operating-system/issues/2485#issuecomment-1533660497_

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 4
  • Comments: 60 (15 by maintainers)

Most upvoted comments

HAOS 10.3 is on the stable channel, with that this issue should be resolved.

I encountered this issue immediately when I upgraded to HAOS 10.0 on NUC11ATKPE and eventually downgraded to 9.5 for the time being. Today I finally had some time to spare so I looked into the issue. The problem is that the only way how the issue manifests is that HA stops receiving advertisement packets after few seconds of scanning - or according to my observations - it seems it receives only a few from a single device, then it only receives “new” advertisements, even if the device lies virtually next to the NUC. I don’t even see the advertisements in the bluetoothctl scan either (with duplicate entries enabled, ofc), so core is probably not to blame. It helps to mitigate the issue a bit though - if no advertisement arrives in watchdog interval (in my case it’s quite busy neighborhood so it takes couple of minutes until the watchdog does its job), the scan is restarted and I can again see the packets from the “ignored” devices. The dmesg entries mentioned above appeared only when I had two VMs with the same USB device attached from the host, but don’t appear even after prolonged time with a single VM, yet the bug with lost advertisements persists.

To better identify what component causes it, I checked out the HAOS repo and tried these combinations:

  • manually built 10.2, enabled Bluetooth integration and paired some BLE sensors - fails
  • the previous, but with latest bluez5_tools commits reverted to 5.53 - fails
  • the previous, with Linux downgraded to 5.15.90 (with Kernel config from 9.5) - OK

I can do some more tests and eventually bisect Linux versions manually to find where it was introduced, but my current testing method is a bit tedious, because I always have to create a qcow2 image, create a new Proxmox VM using a script and restore a backup once it starts. @agners, don’t you have a tip how to do it better, please? Isn’t there a way to simulate OTA to a manually built unsigned version, maybe?

FTR, my NUC is using this Bluetooth adapter: Bus 001 Device 020: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)

Sensors used in testing are LYWSD03MMC with pvvx firmware (mostly version v3.8 or v3.9, IIRC) and one RAPT Pill.

I tried 10.2 today and it still does not work. Specifically my Inkbird IBS-TH2 sensors are unavailable. Rolling back to 9.5 and everything is working again.

PR https://github.com/home-assistant/operating-system/pull/2598 seems to resolve the issue for me and @sairon. I hope this resolves Bluetooth problems for most of you.

The problem is that the only way how the issue manifests is that HA stops receiving advertisement packets after few seconds of scanning

The same here, but for me it takes quite a while to stop receiving packets, I’d say hours.

the previous, with Linux downgraded to 5.15.90 (with Kernel config from 9.5) - OK

I’ve made the same tests and same observation. 5.15 seems fine. I also tested older/newer versions of linux-firmware, with no success either. So it really seems to be the kernel.

I can do some more tests and eventually bisect Linux versions manually to find where it was introduced,

That was actually my next plan, but I hesitated since it takes me quite a while to definitely proof good/bad.

but my current testing method is a bit tedious, because I always have to create a qcow2 image, create a new Proxmox VM using a script and restore a backup once it starts. @agners, don’t you have a tip how to do it better, please? Isn’t there a way to simulate OTA to a manually built unsigned version, maybe?

Going via raucb is what I would do here: Build the raucb file, copy it to the target and manually install it using rauc install <updatefile>. I am not sure about completely unsigned, I haven’t tried that. We do have a developer CA, I’ll contact you directly.

Thanks a lot for your effort on this issue 🙏

Rolling back to 9.5 seems to have resolved my issues as well (Yale locks and RadonEye detectors using the BT integration)

As suggested in the other thread I’m downgrading to OS 9.5 via command Terminal (ha os update --version 9.5) I Will report If all is working as intended again! Thanks for the work @agners

Downgrade done with success and all devices are detected and working as intended. At the moment no issues detected on OS 9.5

Same on my side.

As suggested in the other thread I’m downgrading to OS 9.5 via command Terminal (ha os update --version 9.5) I Will report If all is working as intended again! Thanks for the work @agners

Downgrade done with success and all devices are detected and working as intended. At the moment no issues detected on OS 9.5

@dkebler

note kernel 6.1 is way behind current LTS of 6.6

6.1 was the last LTS, and 6.6 was announced a couple weeks ago, not sure if I would label that as “way behind”.

But, yes, upgrading to 6.6 LTS is on our todo list. A PR with patches rebased and validated on all supported platforms is of course very welcome 😉

Hi all,

I am also running HAOS 11.0 on Intel NUC (NUC10i3FNH2) using Proxmox and so far (16 hour) so good !

I must admit that it was running ok-ish on 10.x with only 2 or 3 short bluetooth gaps per day. It was far worse some weeks ago (see my earlier post) but I found a procedure somewhere online that I tried. Not sure anymore if that was the solution but @bjornarfjelldal you can give this a try: Shut down the physical machine (NUC) and unplug power for 10 min. After that restore power and boot. Although I dont like solutions in this direction I tried it anyway and I think this is what made it run more stable for some weeks now…

Let us know how that worked!

Edit: some days later it turns out I still experience a ± daily disconnect for some hours so for me HAOS 11.0 (and later 11.1) did not fix the issue…

@yannpub @Sorien I’ve noticed that the Bluetooth fix Bluetooth: hci_sync: Fix handling of HCI_QUIRK_STRICT_DUPLICATE_FILTER is listed in the Linux 6.1.57 changelog. So the fix should trickle into distribution Linux kernel updates soon.

Several days without any issue, so fixed for me!, thanks a lot @agners

I can confirm some issues remain on (at least) NUC it seems. I have a NUC 10, have 2 different bluetooth devices both with simultaneous connection issues at random moments and random duration… See below screenshot for example.

HAOS 9.5 -> 10.1 (issues began) HOAS 10.1 -> 9.5 (issues gone, all works fine) HAOS 9.5 -> 10.3 (issues are back)

Has another ticket been opened somewhere for this? (Edit: Sorry, misread your previous comment. There has, i`ll join you there) Happy to provide more input if needed.

image

I tried 10.2 today and it still does not work. Specifically my Inkbird IBS-TH2 sensors are unavailable. Rolling back to 9.5 and everything is working again.

Same for me on my NUC11 (RNUC11PAHi50000).

Just instal HAOS bare metal on a mini pc using Intel Wireless-AC 3165 - Can’t even get the OS to recognise there is a bluetooth device connected

May 16 22:41:40 homeassistant kernel: Bluetooth: Core ver 2.22                                                                                                                                                                                                                                                                       
May 16 22:41:40 homeassistant kernel: Bluetooth: HCI device and connection manager initialized                                                                                                                                                                                                                                       
May 16 22:41:40 homeassistant kernel: Bluetooth: HCI socket layer initialized                                                                                                                                                                                                                                                        
May 16 22:41:40 homeassistant kernel: Bluetooth: L2CAP socket layer initialized                                                                                                                                                                                                                                                      
May 16 22:41:40 homeassistant kernel: Bluetooth: SCO socket layer initialized                                                                                                                                                                                                                                                        
May 16 22:41:40 homeassistant kernel: Bluetooth: hci0: Bootloader revision 0.3 build 0 week 30 2018                                                                                                                                                                                                                                  
May 16 22:41:40 homeassistant kernel: Bluetooth: hci0: Device revision is 2                                                                                                                                                                                                                                                          
May 16 22:41:40 homeassistant kernel: Bluetooth: hci0: Secure boot is enabled                                                                                                                                                                                                                                                        
May 16 22:41:40 homeassistant kernel: Bluetooth: hci0: OTP lock is enabled                                                                                                                                                                                                                                                           
May 16 22:41:40 homeassistant kernel: Bluetooth: hci0: API lock is enabled                                                                                                                                                                                                                                                           
May 16 22:41:40 homeassistant kernel: Bluetooth: hci0: Debug lock is disabled                                                                                                                                                                                                                                                        
May 16 22:41:40 homeassistant kernel: Bluetooth: hci0: Minimum firmware build 1 week 10 2014                                                                                                                                                                                                                                         
May 16 22:41:40 homeassistant kernel: Bluetooth: hci0: Failed to load Intel firmware file intel/ibt-19-0-3.sfi (-2)                                                                                                                                                                                                                  
May 16 22:41:54 homeassistant kernel: Bluetooth: BNEP (Ethernet Emulation) ver 1.3                                                                                                                                                                                                                                                   
May 16 22:41:54 homeassistant kernel: Bluetooth: BNEP filters: protocol multicast                                                                                                                                                                                                                                                    
May 16 22:41:54 homeassistant kernel: Bluetooth: BNEP socket layer initialized

I also experience Bluetooth issues on two Intel NUC installations with internal Bluetooth. Both NUC 10.

As a workaround I created an automation which reloads the Bluetooth integration when a couple of sensors (to prevent empty batteries reloading Bluetooth constantly) report unavailable. I also have made an automation for my SwitchBot bot which reloads the Bluetooth integration before toggling the actual bot.

I also have same problem with HAOS v10.1 on Intel® Atom™ x5-Z8500 system. I’ve downgraded to 9.5 and everything is working fine in BT side.

I have INTEL NUC, and I have problem with bluetooth too with HAOS 10.

image

Just seen this appear in my logs, I’ve not seen it before, don’t know if it’s a red-herring:

...
May 04 14:14:17 homeassistant kernel: Bluetooth: hci0: Opcode 0x200e failed: -16
May 04 14:14:21 homeassistant kernel: Bluetooth: hci0: ACL packet for unknown connection handle 3587

and

...
May 04 14:23:53 homeassistant kernel: Bluetooth: hci0: Opcode 0x200e failed: -16
May 04 14:24:32 homeassistant kernel: Bluetooth: hci0: Opcode 0x200e failed: -16

As suggested in the other thread I’m downgrading to OS 9.5 via command Terminal (ha os update --version 9.5) I Will report If all is working as intended again! Thanks for the work @agners