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_tracker stops working after some time (HA 0.96.x) #25323

Closed
bieniu opened this issue Jul 19, 2019 · 6 comments
Closed

bluetooth_tracker stops working after some time (HA 0.96.x) #25323

bieniu opened this issue Jul 19, 2019 · 6 comments

Comments

@bieniu
Copy link
Member

bieniu commented Jul 19, 2019

Home Assistant release with the issue:
0.96.1 and 0.96.2

Last working Home Assistant release (if known):
0.95.4

Operating environment (Hass.io/Docker/Windows/etc.):
RPi3, Raspbain Stretch, Python 3.7.2, venv

Component/platform:
device_tracker/bluetooth_tracker

Description of problem:
After update HA to 0.96.x bluetooth_tracker works only some time after restart. Sometimes few minutes, sometimes few hours. Debug log shows that the component scans for the devices every minute and stops suddenly without any error.

2019-07-19 23:37:45 DEBUG (SyncWorker_16) [homeassistant.components.bluetooth_tracker.device_tracker] Bluetooth devices discovered = 2
2019-07-19 23:37:45 DEBUG (SyncWorker_16) [homeassistant.components.bluetooth_tracker.device_tracker] Scanning xx:xx:xx:xx:83:E0
2019-07-19 23:37:50 DEBUG (SyncWorker_16) [homeassistant.components.bluetooth_tracker.device_tracker] Scanning xx:xx:xx:xx:D8:0E
2019-07-19 23:37:55 DEBUG (SyncWorker_16) [homeassistant.components.bluetooth_tracker.device_tracker] Scanning xx:xx:xx:xx:F6:3B
2019-07-19 23:38:00 DEBUG (SyncWorker_16) [homeassistant.components.bluetooth_tracker.device_tracker] Scanning xx:xx:xx:xx:AC:4C
2019-07-19 23:38:05 DEBUG (SyncWorker_16) [homeassistant.components.bluetooth_tracker.device_tracker] Scanning xx:xx:xx:xx:4A:4C
2019-07-19 23:38:11 DEBUG (SyncWorker_16) [homeassistant.components.bluetooth_tracker.device_tracker] Scanning xx:xx:xx:xx:AB:2D
2019-07-19 23:38:59 DEBUG (SyncWorker_7) [homeassistant.components.bluetooth_tracker.device_tracker] Bluetooth devices discovered = 0
2019-07-19 23:38:59 DEBUG (SyncWorker_7) [homeassistant.components.bluetooth_tracker.device_tracker] Scanning xx:xx:xx:xx:83:E0
2019-07-19 23:39:04 DEBUG (SyncWorker_7) [homeassistant.components.bluetooth_tracker.device_tracker] Scanning xx:xx:xx:xx:D8:0E
2019-07-19 23:39:07 DEBUG (SyncWorker_7) [homeassistant.components.bluetooth_tracker.device_tracker] Scanning xx:xx:xx:xx:F6:3B
2019-07-19 23:39:12 DEBUG (SyncWorker_7) [homeassistant.components.bluetooth_tracker.device_tracker] Scanning xx:xx:xx:xx:AC:4C
2019-07-19 23:39:17 DEBUG (SyncWorker_7) [homeassistant.components.bluetooth_tracker.device_tracker] Scanning xx:xx:xx:xx:4A:4C
2019-07-19 23:39:22 DEBUG (SyncWorker_7) [homeassistant.components.bluetooth_tracker.device_tracker] Scanning xx:xx:xx:xx:AB:2D

Sometimes an error is displayed during the scan:

2019-07-19 16:19:04 ERROR (SyncWorker_14) [homeassistant.components.bluetooth_tracker.device_tracker] Error looking up Bluetooth device
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/bluetooth/bluez.py", line 31, in discover_devices
    lookup_class=lookup_class, device_id=device_id)
_bluetooth.error: (110, 'Connection timed out')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/bluetooth_tracker/device_tracker.py", line 102, in update_bluetooth_once
    for dev in discover_devices():
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/bluetooth_tracker/device_tracker.py", line 57, in discover_devices
    lookup_class=False, device_id=device_id)
  File "/srv/homeassistant/lib/python3.7/site-packages/bluetooth/bluez.py", line 34, in discover_devices
    raise BluetoothError ("error communicating with local "
bluetooth.btcommon.BluetoothError: error communicating with local bluetooth adapter

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

device_tracker:
  - platform: bluetooth_tracker
@bieniu
Copy link
Member Author

bieniu commented Jul 20, 2019

When the bluetooth_tracker stops working, starting the pairing of the BT device from the Raspbian desktop causes the scans in HA work again for some time.

@serapol
Copy link

serapol commented Jul 20, 2019

Yes, I confirm that. I have the same problem, but in my case, Bluetooth doesn't work at all. I always get this error.
My configuration:
RPI3, Raspbian, Docker, HA 0.96.2

@Wampukas
Copy link

I can confirm the issue. I have rolled back to 0.95.4 till this will be fixed.

@Wampukas
Copy link

Wampukas commented Jul 24, 2019

Will anyone take a look at this issue ?

@bieniu
Copy link
Member Author

bieniu commented Jul 26, 2019

Do you have this error in dmesg | grep -i blue:

Bluetooth: hci0: Frame reassembly failed (-84)

If yes this is a kernel related issue raspberrypi/firmware#1150

My dmesg is full of this.

@bieniu
Copy link
Member Author

bieniu commented Jul 27, 2019

Issue is kernel related. After downgrade kernel to version 4.14.98, the bluetooth_tracker works without any problems. All kernels 4.19.x have this issue. Fix will be in version 4.19.58 but for now this is not stable kernel.

@bieniu bieniu closed this as completed Jul 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants