Linak Desk: BT Error "Attribute can't be written"
See original GitHub issueDescribe the bug Appreciate this tool @zewelor - trying to get it working on the IKEA Desk running on a Raspberry Pi. Only deviation from the manual is that I’m not running it in a python venv, but it appears the bug below is unrelated.
If I remember correctly, it works correctly for you with an IKEA Desk? Any pointers would be greatly appreciated!
Debug gateway logs
2020-01-26 17:46:56,666 INFO bt-mqtt-gw gateway.py:61:<module> - Starting 2020-01-26 17:46:56,669 DEBUG bt-mqtt-gw.mqtt mqtt.py:30:init - Setting LWT to: lwt_topic WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. To avoid this problem you can invoke Python with ‘-m pip’ instead of running pip directly. 2020-01-26 17:47:00,069 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:106:register_workers - Added linakdesk worker with 1800 seconds interval and a 35 seconds timeout 2020-01-26 17:47:00,348 DEBUG bt-mqtt-gw.mqtt mqtt.py:116:callbacks_subscription - Subscribing to: linak_desk/update_interval 2020-01-26 17:47:00,349 DEBUG bt-mqtt-gw.mqtt mqtt.py:116:callbacks_subscription - Subscribing to: homeassistant/status 2020-01-26 17:47:00,355 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:174:update_all - Updating all workers 2020-01-26 17:47:01,915 ERROR linak_dpg_bt.connection connection.py:91:make_request - Got exception from bluepy while making a request: Bluetooth command failed (code: 3, error: Attribute can’t be written) 2020-01-26 17:47:01,919 ERROR bt-mqtt-gw.workers.linakdesk logger.py:50:log_exception - Error during update of linak desk ‘linakdesk’ (VALID_MAC): BTLEGattError Traceback (most recent call last): File “/home/pi/bt-mqtt-gateway/workers/linakdesk.py”, line 43, in _get_height self.desk.read_dpg_data() File “/usr/local/lib/python3.7/dist-packages/linak_dpg_bt/linak_device.py”, line 83, in read_dpg_data conn.dpg_command(PROP_DESK_OFFSET) File “/usr/local/lib/python3.7/dist-packages/linak_dpg_bt/connection.py”, line 109, in dpg_command self.make_request(DPG_COMMAND_HANDLE, value) File “/usr/local/lib/python3.7/dist-packages/linak_dpg_bt/connection.py”, line 92, in make_request raise ex File “/usr/local/lib/python3.7/dist-packages/linak_dpg_bt/connection.py”, line 86, in make_request self._conn.writeCharacteristic(handle, value, withResponse=with_response) File “/usr/local/lib/python3.7/dist-packages/bluepy/btle.py”, line 543, in writeCharacteristic return self._getResp(‘wr’) File “/usr/local/lib/python3.7/dist-packages/bluepy/btle.py”, line 407, in _getResp resp = self._waitResp(wantType + [‘ntfy’, ‘ind’], timeout) File “/usr/local/lib/python3.7/dist-packages/bluepy/btle.py”, line 368, in _waitResp raise BTLEGattError(“Bluetooth command failed”, resp) bluepy.btle.BTLEGattError: Bluetooth command failed (code: 3, error: Attribute can’t be written) 2020-01-26 17:47:01,924 ERROR bt-mqtt-gw logger.py:50:log_exception - Timeout while executing worker command Traceback (most recent call last): File “/home/pi/bt-mqtt-gateway/workers/linakdesk.py”, line 43, in _get_height self.desk.read_dpg_data() File “/usr/local/lib/python3.7/dist-packages/linak_dpg_bt/linak_device.py”, line 83, in read_dpg_data conn.dpg_command(PROP_DESK_OFFSET) File “/usr/local/lib/python3.7/dist-packages/linak_dpg_bt/connection.py”, line 109, in dpg_command self.make_request(DPG_COMMAND_HANDLE, value) File “/usr/local/lib/python3.7/dist-packages/linak_dpg_bt/connection.py”, line 92, in make_request raise ex File “/usr/local/lib/python3.7/dist-packages/linak_dpg_bt/connection.py”, line 86, in make_request self._conn.writeCharacteristic(handle, value, withResponse=with_response) File “/usr/local/lib/python3.7/dist-packages/bluepy/btle.py”, line 543, in writeCharacteristic return self._getResp(‘wr’) File “/usr/local/lib/python3.7/dist-packages/bluepy/btle.py”, line 407, in _getResp resp = self._waitResp(wantType + [‘ntfy’, ‘ind’], timeout) File “/usr/local/lib/python3.7/dist-packages/bluepy/btle.py”, line 368, in _waitResp raise BTLEGattError(“Bluetooth command failed”, resp) bluepy.btle.BTLEGattError: Bluetooth command failed (code: 3, error: Attribute can’t be written)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “./gateway.py”, line 73, in <module> mqtt.publish(_WORKERS_QUEUE.get(timeout=10).execute()) File “/home/pi/bt-mqtt-gateway/workers_manager.py”, line 58, in execute messages = self._callback(*self._args) File “/home/pi/bt-mqtt-gateway/workers/linakdesk.py”, line 27, in status_update topic=self.format_topic(“height/cm”), payload=self._get_height() File “/home/pi/bt-mqtt-gateway/workers/linakdesk.py”, line 54, in _get_height raise DeviceTimeoutError exceptions.DeviceTimeoutError ^C2020-01-26 17:47:26,298 INFO bt-mqtt-gw gateway.py:85:<module> - Finish current jobs and shut down. If you need force exit use kill `
Server (please complete the following information):
- OS: Linux
- Distro: Raspbian
- Version: Fully up-to-date
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
if auto move is disabled, how are all of. the following able to do it: https://github.com/j5lien/esphome-idasen-desk-controller https://apps.apple.com/us/app/desk-remote-control/id1509037746 https://github.com/DWilliames/idasen-controller-mac
It might be that auto move is disabled is this controller. In mine I had to turn it on explicit via app ( and there was info not every controller will allow it ). Maybe you can find other controller and swap it ( not sure if there is any authorization between desk / controller )