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 #95

Open
fishenebelny opened this issue Jul 11, 2022 · 6 comments
Open

Какие-то ошибки bluetooth #95

fishenebelny opened this issue Jul 11, 2022 · 6 comments
Labels
Bluetooth BT related

Comments

@fishenebelny
Copy link

Общая информация

  • версия Home Assistant:2022.7.2
  • способ установки Home Assistant:
    [ ] venv
    [*] Docker
    [ ] Home Assistant OS
  • версия компонента: 3.0.0
  • модель бризера: S3
  • версия python-модуля:

[] в момент проявления проблемы к бризеру никто не подключен
[
] bluetooth в системе работает корректно, действий из WiKi не требуется
[*] проблема не похожа ни на одну из FAQ

Краткое описание

После перехода на 2022.7 и версию компонента 3.0.0 появились проблемы с bluetooth. Ранее подобного не наблюлаось.
Примеры ошибок:
Logger: tion_btle.tion
Source: /usr/local/lib/python3.10/site-packages/tion_btle/tion.py:32
First occurred: 9 июля 2022 г., 20:58:00 (7 occurrences)
Last logged: 10 июля 2022 г., 21:09:00

Got exception: [org.bluez.Error.Failed] Software caused connection abort. Will try again

Logger: bleak.backends.bluezdbus.client
Source: /usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py:299
First occurred: 9 июля 2022 г., 20:58:00 (7 occurrences)
Last logged: 10 июля 2022 г., 21:09:00

Failed to cancel connection (/org/bluez/hci0/dev_C4_64_95_C3_5E_79): 'NoneType' object has no attribute 'call'
Failed to cancel connection (/org/bluez/hci0/dev_D5_91_DD_FC_1A_60): 'NoneType' object has no attribute 'call'

Debug-log

2022-07-10 21:09:00 INFO (MainThread) [custom_components.tion.climate] Need to set mode to heat, current mode is off
2022-07-10 21:09:00 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-07-10 21:09:00 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s3.TionS3 object at 0xa57503d0>,),kwargs={})
2022-07-10 21:09:00 WARNING (MainThread) [bleak.backends.bluezdbus.client] Failed to cancel connection (/org/bluez/hci0/dev_C4_64_95_C3_5E_79): 'NoneType' object has no attribute 'call'
2022-07-10 21:09:00 WARNING (MainThread) [tion_btle.tion] Got exception: [org.bluez.Error.Failed] Software caused connection abort. Will try again
2022-07-10 21:09:02 DEBUG (MainThread) [tion_btle.tion] Trying 1/1: _try_connect(args=(<tion_btle.s3.TionS3 object at 0xa57503d0>,),kwargs={})
2022-07-10 21:09:04 DEBUG (MainThread) [tion_btle.tion] Enabling notification. self.connection_status='connected'
2022-07-10 21:09:04 DEBUG (MainThread) [tion_btle.tion] _enable_notifications done
2022-07-10 21:09:04 DEBUG (MainThread) [tion_btle.tion] _connect done. self.connection_status='connected'.
2022-07-10 21:09:04 INFO (MainThread) [custom_components.tion] Need to set: heater='on', state='on'
2022-07-10 21:09:04 DEBUG (MainThread) [tion_btle.tion] Trying 0/3: _try_write(args=(<tion_btle.s3.TionS3 object at 0xa57503d0>,),kwargs={'request': bytearray(b'=\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Z')})
2022-07-10 21:09:04 DEBUG (MainThread) [tion_btle.tion] Writing 3d0100000000000000000000000000000000005a to 6e400002-b5a3-f393-e0a9-e50e24dcca9e, self.connection_status='connected'
2022-07-10 21:09:04 DEBUG (MainThread) [tion_btle.tion] Got data in 10 response b31021080100161616ba00132d0000510033005a
2022-07-10 21:09:04 DEBUG (MainThread) [tion_btle.tion] self._data=[bytearray(b'\xb3\x10!\x08\x01\x00\x16\x16\x16\xba\x00\x13-\x00\x00Q\x003\x00Z')]
2022-07-10 21:09:04 DEBUG (MainThread) [tion_btle.tion] Collecting data
2022-07-10 21:09:04 DEBUG (MainThread) [tion_btle.s3] Data is b31021080100161616ba00132d0000510033005a
2022-07-10 21:09:04 DEBUG (MainThread) [tion_btle.tion] Will write bytearray(b'=\x02\x01\x08\x02\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Z')
2022-07-10 21:09:04 DEBUG (MainThread) [tion_btle.tion] Trying 0/3: _try_write(args=(<tion_btle.s3.TionS3 object at 0xa57503d0>, bytearray(b'=\x02\x01\x08\x02\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Z')),kwargs={})
2022-07-10 21:09:04 DEBUG (MainThread) [tion_btle.tion] Writing 3d0201080203000000000000000000000000005a to 6e400002-b5a3-f393-e0a9-e50e24dcca9e, self.connection_status='connected'
2022-07-10 21:09:04 DEBUG (MainThread) [tion_btle.tion] Got data in 10 response b32021080300161616ba00132d001e510033005a
2022-07-10 21:09:04 DEBUG (MainThread) [tion_btle.tion] self._data=[bytearray(b'\xb3 !\x08\x03\x00\x16\x16\x16\xba\x00\x13-\x00\x1eQ\x003\x00Z')]
2022-07-10 21:09:04 DEBUG (MainThread) [tion_btle.tion] Collecting data
2022-07-10 21:09:04 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='connected'.
2022-07-10 21:09:06 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'

Как можно воспроизвети вашу проблему

Шаги не знаю. Увидел ошибки, которых, вроде бы, раньше не было. Решил уточнить, вдруг это серьезная ошибка.

Дополнительное описание

@IATkachenko
Copy link
Contributor

Мак-адреса, котоыре проскакивают -- это адреса ваших бризеров?
Ошибки -- действительно что-то новое и связано с переходом на bleak. Возможно они были и в bluepy версии, но выглядели как-то подругому.

Спасибо, попробую понять откуда ноги растут.

@IATkachenko IATkachenko added the Bluetooth BT related label Jul 11, 2022
@fishenebelny
Copy link
Author

Да, это мак адреса бризеров.
Вот что делал:

  1. Обновил компонент до 3.0.0
  2. Обновил НА до 2022.7, так как в 3.0.0 не стал работать в 2022.6

@IATkachenko
Copy link
Contributor

У меня, кстати, в 2022.6 все работает, я пока не обновлял HA.

Но ошибки вроде ваших пару раз у себя видел -- они точно не от HA идут и от версии зависеть не должны. А что там с bleak я еще не смотрел.

@fishenebelny
Copy link
Author

Обновился до 3.0.1. Вентилятор работает. Скорости показывает корректно. Ошибка "dictionary changed size during iteration" не появлялась. При изменение статуса с пульта, статус обновляется и в ХА.

Остаются ошибки от блютуза какие-то. Возможно что-то подобное и с bluepy было, но выглядело в логах по другому. Сейчас вот есть такое:

Logger: tion_btle.tion
Source: /usr/local/lib/python3.10/site-packages/tion_btle/tion.py:32
First occurred: 11 июля 2022 г., 21:23:46 (37 occurrences)
Last logged: 08:57:09

Got exception: [org.bluez.Error.Failed] Software caused connection abort. Will try again
Got exception: [org.bluez.Error.Failed] Software caused connection abort. Will not try again

Logger: bleak.backends.bluezdbus.client
Source: /usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py:299
First occurred: 11 июля 2022 г., 21:23:46 (44 occurrences)
Last logged: 08:57:09

Failed to cancel connection (/org/bluez/hci0/dev_D5_91_DD_FC_1A_60): 'NoneType' object has no attribute 'call'
Failed to cancel connection (/org/bluez/hci0/dev_C4_64_95_C3_5E_79): 'NoneType' object has no attribute 'call'

Эта ошибка возникла в кастомной интеграции.

Logger: custom_components.tion
Source: custom_components/tion/init.py:93
Integration: Tion breezer (documentation)
First occurred: 11 июля 2022 г., 21:34:35 (7 occurrences)
Last logged: 08:51:56

Unexpected error fetching Tion Bedroom data:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh
self.data = await self._async_update_data()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data
return await self.update_method()
File "/config/custom_components/tion/init.py", line 103, in async_update_state
raise e
File "/config/custom_components/tion/init.py", line 93, in async_update_state
response = await self.__tion.get()
File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 205, in get
await self.get_state_from_breezer()
File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 185, in get_state_from_breezer
await self.connect()
File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 502, in connect
await self._connect()
File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 299, in _connect
await self._try_connect()
File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 28, in wrapper
return await f(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 292, in _try_connect
return await self._btle.connect()
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 267, in connect
reply = await asyncio.wait_for(
File "/usr/local/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
return fut.result()
File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 305, in call
await future
File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 365, in _message_reader
if self._unmarshaller.unmarshall():
File "/usr/local/lib/python3.10/site-packages/dbus_next/_private/unmarshaller.py", line 304, in unmarshall
self._unmarshall()
File "/usr/local/lib/python3.10/site-packages/dbus_next/_private/unmarshaller.py", line 243, in _unmarshall
self.read(16, prefetch=True)
File "/usr/local/lib/python3.10/site-packages/dbus_next/_private/unmarshaller.py", line 91, in read
raise EOFError()
EOFError

@fishenebelny
Copy link
Author

И да, большое спасибо интеграцию и скорость )
Эти ошибки, на мой взгляд, были и раньше. Но я бы на всякий случай посмотрел как у других.

@IATkachenko
Copy link
Contributor

Ошибки явно из BT стека лезут.
Я чуть позжепосмотрю что там происходит. Но, думаю, ничего нового: все тоже что было с bluepy, только в новой обертке.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bluetooth BT related
Projects
None yet
Development

No branches or pull requests

2 participants