question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Linak Desk: BT Error "Attribute can't be written"

See original GitHub issue

Describe 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:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

0reactions
zewelorcommented, Feb 19, 2020

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 )

Read more comments on GitHub >

github_iconTop Results From Across the Web

LINAK DESKLINE® TROUBLESHOOTING GUIDE
The problem could be a faulty desk leg or a faulty motor cable. Channel-specific error (Ex: E41 –. Channel 1 overload) – Everything...
Read more >
Linak desk controller - #33 by maxime1992 - ESPHome
Hi all, heads up: noob question I want to use the HACS Linak Desk ... but i get the error “idasen_desk_controller is not...
Read more >
Desk Control - Apps on Google Play
The features available depend on your desk system. Pick your personal challenge for standing at your desk and improve your health and work ......
Read more >
linak-lift-installation-instructions-90103.pdf - Eaton
DB4/DL4 systems. To learn more about LINAK, please visit: WWW.LINAK.COM ... If only one desk is connected it is not possible to select...
Read more >
DL17 system with CBD6S - Tuohy Furniture
User Manual for Desk Panels DPG and Desk. Control™ App Starts on Page 20. Detailed Linak Troubleshooting Info Starts After.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found