You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello @rytilahti
I managed to run this code on Debian 11, Phyton 3.9 and I even can do scan and find my lamp, however when I try to connect and ON / OFF it I get errors:
freya@Dalek:~$ yeelightbt --mac f8:24:41:c3:d9:79 on
WARNING:yeelightbt.connection:Unable to connect to the device f8:24:41:c3:d9:79, retrying: Failed to connect to peripheral f8:24:41:c3:d9:79, addr type: public
ERROR:yeelightbt.connection:Second connection try to f8:24:41:c3:d9:79 failed: Failed to connect to peripheral f8:24:41:c3:d9:79, addr type: public
Traceback (most recent call last):
File "/home/freya/.local/lib/python3.9/site-packages/yeelightbt/connection.py", line 55, in connect
self._conn.connect(self._mac)
File "/home/freya/.local/lib/python3.9/site-packages/bluepy/btle.py", line 445, in connect
self._connect(addr, addrType, iface)
File "/home/freya/.local/lib/python3.9/site-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral f8:24:41:c3:d9:79, addr type: public
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/yeelightbt", line 33, in
sys.exit(load_entry_point('python-yeelightbt==0.0.4', 'console_scripts', 'yeelightbt')())
File "/home/freya/.local/lib/python3.9/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/home/freya/.local/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/freya/.local/lib/python3.9/site-packages/click/core.py", line 1654, in invoke
super().invoke(ctx)
File "/home/freya/.local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/freya/.local/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/freya/.local/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/freya/.local/lib/python3.9/site-packages/yeelightbt/cli.py", line 60, in cli
lamp.connect()
File "/home/freya/.local/lib/python3.9/site-packages/yeelightbt/lamp.py", line 89, in connect
self._conn.connect()
File "/home/freya/.local/lib/python3.9/site-packages/yeelightbt/connection.py", line 59, in connect
self._conn.connect(self._mac)
File "/home/freya/.local/lib/python3.9/site-packages/bluepy/btle.py", line 445, in connect
self._connect(addr, addrType, iface)
File "/home/freya/.local/lib/python3.9/site-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral f8:24:41:c3:d9:79, addr type: public
freya@Dalek:~$
Any advice how to fix this?
The text was updated successfully, but these errors were encountered:
Sorry, no idea. Looks like a problem in your bluetooth stack, for some reason it cannot form a connection with the device. You could try to use bluetoothctl to connect to the device to see if that works:
Note, that this library has not been maintained for years, so even if you get the connection working you will likely need to use a very old version of construct to make the commands work.
Hello @rytilahti
I managed to run this code on Debian 11, Phyton 3.9 and I even can do scan and find my lamp, however when I try to connect and ON / OFF it I get errors:
freya@Dalek:~$ yeelightbt --mac f8:24:41:c3:d9:79 on
WARNING:yeelightbt.connection:Unable to connect to the device f8:24:41:c3:d9:79, retrying: Failed to connect to peripheral f8:24:41:c3:d9:79, addr type: public
ERROR:yeelightbt.connection:Second connection try to f8:24:41:c3:d9:79 failed: Failed to connect to peripheral f8:24:41:c3:d9:79, addr type: public
Traceback (most recent call last):
File "/home/freya/.local/lib/python3.9/site-packages/yeelightbt/connection.py", line 55, in connect
self._conn.connect(self._mac)
File "/home/freya/.local/lib/python3.9/site-packages/bluepy/btle.py", line 445, in connect
self._connect(addr, addrType, iface)
File "/home/freya/.local/lib/python3.9/site-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral f8:24:41:c3:d9:79, addr type: public
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/yeelightbt", line 33, in
sys.exit(load_entry_point('python-yeelightbt==0.0.4', 'console_scripts', 'yeelightbt')())
File "/home/freya/.local/lib/python3.9/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/home/freya/.local/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/freya/.local/lib/python3.9/site-packages/click/core.py", line 1654, in invoke
super().invoke(ctx)
File "/home/freya/.local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/freya/.local/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/freya/.local/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/freya/.local/lib/python3.9/site-packages/yeelightbt/cli.py", line 60, in cli
lamp.connect()
File "/home/freya/.local/lib/python3.9/site-packages/yeelightbt/lamp.py", line 89, in connect
self._conn.connect()
File "/home/freya/.local/lib/python3.9/site-packages/yeelightbt/connection.py", line 59, in connect
self._conn.connect(self._mac)
File "/home/freya/.local/lib/python3.9/site-packages/bluepy/btle.py", line 445, in connect
self._connect(addr, addrType, iface)
File "/home/freya/.local/lib/python3.9/site-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral f8:24:41:c3:d9:79, addr type: public
freya@Dalek:~$
Any advice how to fix this?
The text was updated successfully, but these errors were encountered: