ble_monitor icon indicating copy to clipboard operation
ble_monitor copied to clipboard

[Bug]: OS Release 8 on RaspberryPi 4: No sensor data is displayed anymore

Open kusmi opened this issue 2 years ago • 15 comments

What happened?

I upgraded my Raspi 4 to the new "Home Assistant OS 8.0" version. Now ble_monitor does not seem to get any updates from my devices.

It looks like OS 8 internally did some changes on how linux devices are named - perhaps this is related to ble_monitor, as it also needs access to the bluetooth device. I have similar problems to other integrations (ZHA: Zigbee dongle), there also OS 8 does not find the linux device anymore.

Sensor type

No response

Relevant log output

This error originated from a custom integration.

Logger: custom_components.ble_monitor
Source: custom_components/ble_monitor/__init__.py:730 
Integration: Passive BLE monitor (documentation, issues) 
First occurred: 10:53:37 (2 occurrences) 
Last logged: 10:54:37

HCIdump thread: Something wrong - interface hci0 not ready, and will be skipped for current scan period.



and:

This error originated from a custom integration.

Logger: custom_components.ble_monitor
Source: custom_components/ble_monitor/__init__.py:768 
Integration: Passive BLE monitor (documentation, issues) 
First occurred: 10:54:37 (1 occurrences) 
Last logged: 10:54:37

HCIdump thread: Trying to power cycle Bluetooth adapter hci0 DC:A6:32:CC:B4:91, will try to use it next scan period.


and:


This error originated from a custom integration.

Logger: custom_components.ble_monitor.bt_helpers
Source: custom_components/ble_monitor/bt_helpers.py:20 
Integration: Passive BLE monitor (documentation, issues) 
First occurred: 10:54:37 (1 occurrences) 
Last logged: 10:54:37

RF kill switch check failed - no data for hci0. Available data: {'phy0': {'idx': 0, 'type': 'wlan', 'soft': False, 'hard': False}}

kusmi avatar May 18 '22 09:05 kusmi

After an OS update, I always try to do a full system reboot (power off/ power on). Can you try that first?

Ernst79 avatar May 18 '22 09:05 Ernst79

Yes I did that, I shutdown, disconnected any power to my raspberry and started again

I also tried: disabled interface in ble_monitor setting, setting "Don't use Bluetooth adapter" - restarted Raspi and enabled the interface again. But did not work so far.

kusmi avatar May 18 '22 09:05 kusmi

When reading the messages here, I see a lot of issues with USB devices, that do not connect anymore after this update. I will try this weekend.

Ernst79 avatar May 19 '22 06:05 Ernst79

Hey @kusmi - I had the same issue, but on different hardware. After much messing around, I found that the solution was to go:

  • Settings > Devices & Services
  • Click CONFIGURE under Bluetooth Low Energy Monitor

From this screen, mine had changed selection to Don't use Bluetooth adaptor. After selecting my actual adaptor, everything started working again.

image

jantoney avatar May 19 '22 11:05 jantoney

Can you try again with OS release 8.1?

Ernst79 avatar May 20 '22 16:05 Ernst79

Same problem here, and @jantoney solution did the trick for me! Thanks!

donparlor avatar May 23 '22 12:05 donparlor

Ok, The issue is that at some point, BLE monitor can't find your Bluetooth adapter after a HA restart. It then sets is to "don't use Bluetooth adapter", The next time you restart HA, it will keep this setting. I will think about a way to improve this/not automatically change the setting. As far as I can see, this can only happen is the Bluetooth adapter isn't found during the startup of HA/BLE monitor.

config is changed here:

https://github.com/custom-components/ble_monitor/blob/03bb891e05da5867401eb9bf8bcd55bfa3adef57/custom_components/ble_monitor/init.py#L396

But, at the same time, the big question is why doesn't HA find the Bluetooth adapter in some cases/at certain restarts. This looks more like a hardware issue? Not sure I can help with the last problem.

Ernst79 avatar May 23 '22 13:05 Ernst79

I upgraded to 8.1 - but still the same issue - also the trick by @jantoney did not work for me, as it was not deselected in the first place. I also tried setting the "Don't use the Bluetooth adapter", saved, rebooted RaspberryPi and selected the device again - no dice. Also another reboot did not help.

I have a "vanilla" home assistant install on a RaspberryPi - using the haos (Home Assistant Operating System).

So no people having issues with RaspberryPi 4 and haos out there?

let's see if the new Home Assistant release today will resolve anything :-) → Upgraded to Home Assistant Core 2022.6.0 - but it did not resolve anything yet

kusmi avatar Jun 01 '22 14:06 kusmi

@kusmi When looking at your first post, it looks like Home Assistant can't find hci0 anymore. For some reason, it seems to fail. It is hard to tell what the exact cause is, could be a hardware issue. Or using two integrations that use Bluetooth at the same time.

  • What kind of Bluetooth adapter do you use? internal or USB dongle?
  • Are you using Bluetooth for other integrations, try to use only one
  • You could try an external Bluetooth dongle to see if this solves your issue (make sure you use the correct MAC address in that case.

Ernst79 avatar Jun 02 '22 08:06 Ernst79

I got the same problem after upgrade to 8.1 os. I got virtual machine on Synology. Got an external bluetooth. Thats how error looks in OS: usb 3-1: new full-speed USB device number 5 using uhci_hcd [91668.485509] usb 3-1: New USB device found, idVendor=0a12, idProduct=0001, bcdDevice=25.20 [91668.485521] usb 3-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [91668.485524] usb 3-1: Product: CSR8510 A10 [91668.515083] Bluetooth: hci0: CSR: Unbranded CSR clone detected; adding workarounds and force-suspending once... [91673.709930] Bluetooth: hci0: CSR: Failed to suspend the device for our Barrot 8041a02 receive-issue workaround [91678.821979] Bluetooth: hci0: setting interface failed (110)

MikeYar avatar Jun 02 '22 11:06 MikeYar

I have noticed same thing. I have always had SSD but each upgrade it gets worse and worse. I swear the updates are killing signal or power to bluetooth. I also have a Pi4 and have 6 inkbird devices and they used to work amazing but now on restart most take days to show up if i bring them close to the pi they are better. My SSD is about 3 feet away from pi same as always so nothing changed except updates. strange stuff for sure

randrcomputers avatar Jul 14 '22 01:07 randrcomputers

Did you ever replaced the batteries of the sensors? Ifreception decreases over time, I suspect battery getting low.

Ernst79 avatar Jul 14 '22 05:07 Ernst79

Yes tried new batteries. My sensors are currently all working just hate rebooting as it will take a long time for them to show up again. I only commented because I’m seeing similar issue with signal strength it just seems signal is less then before for some reason.

randrcomputers avatar Jul 14 '22 11:07 randrcomputers

hmm. strange. I have no idea, updates should not affect the reception, I wouldn't know how it could....

Ernst79 avatar Jul 19 '22 13:07 Ernst79

I have exactly the same problem : the Bluetooth integrated in my Pi 4 didn't work anymore after update.

NicolasQuenon avatar Apr 18 '23 23:04 NicolasQuenon