Open wojtulab opened 2 years ago
Hi, you can try switching the backend --backend [bleak|bluepy|gattlib]
(remember to also install the other backends via pip). If you are running your script in a container, remember to mount dbus.
Actually dbus is mounted .
bash-5.1# ls /var/run/dbus
system_bus_socket
With bleak --backend bleak I have another error:
bash-5.1# eq3cli --mac='5C:E5:0C:B0:EF:88' --backend bleak
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/eq3bt/bleakconnection.py", line 106, in make_request
with self:
File "/usr/local/lib/python3.10/site-packages/eq3bt/bleakconnection.py", line 65, in __enter__
self._loop.run_until_complete(
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 835, in start_notify
raise BleakError(
bleak.exc.BleakError: Characteristic with UUID 1056 could not be found!
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/eq3cli", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1635, in invoke
rv = super().invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/eq3bt/eq3cli.py", line 47, in cli
thermostat.update()
File "/usr/local/lib/python3.10/site-packages/eq3bt/eq3btsmart.py", line 217, in update
self._conn.make_request(PROP_WRITE_HANDLE, value)
File "/usr/local/lib/python3.10/site-packages/eq3bt/bleakconnection.py", line 123, in make_request
raise BackendException("Exception on write using bleak") from ex
eq3bt.BackendException: Exception on write using bleak
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-4' coro=<BleakClientBlueZDBus._disconnect_monitor() running at /usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py:247> wait_for=<Future pending cb=[Task.task_wakeup()]>>
bash-5.1#
in bluetoothctl I can pair the device, current status:
[bluetooth]# info 5C:E5:0C:B0:EF:88
Device 5C:E5:0C:B0:EF:88(public)
Name: CC-RT-BLE
Alias: CC-RT-BLE
Paired: yes
Trusted: yes
Blocked: no
Connected: no
LegacyPairing: no
This behaviour is odd. Bleak is used by default, so the error messages shouldn't be different - not sure why this happens.
Ok what do i do? What do you suggest?
?
Sorry, not sure what to do here!
Hello, I can't resolve following issue:
bash-5.1# pip install --upgrade python-eq3bt Requirement already satisfied: python-eq3bt in /usr/local/lib/python3.10/site-packages (0.2) Requirement already satisfied: bleak in /usr/local/lib/python3.10/site-packages (from python-eq3bt) (0.15.1) Requirement already satisfied: click in /usr/local/lib/python3.10/site-packages (from python-eq3bt) (8.1.3) Requirement already satisfied: construct in /usr/local/lib/python3.10/site-packages (from python-eq3bt) (2.10.56) Requirement already satisfied: typing-extensions>=4.2.0 in /usr/local/lib/python3.10/site-packages (from bleak->python-eq3bt) (4.3.0) Requirement already satisfied: dbus-next in /usr/local/lib/python3.10/site-packages (from bleak->python-eq3bt) (0.2.3)