Linak desk controller

Hi guys,
Is it possible to use 1 esp device to manage 2 desks?

i donā€™t think soā€¦ maybe some issues will arise with connections

Hi, I own an IKEA IDASEN / IDƅSEN Desk which I believe is powered by an Linak DL11.

I tried to figure out the pinout on the RJ45 connector but I canā€™t find a 5V pin or make any conclusions regarding the pinout. Some of them show 6,8-7v though.

IKEA Idasen Desk

Linak DL11 lifting column

image

Apart from the Bluetooth approach has anyone tried a more direct approach by connection the ESP directly to control the table?

The latest esphome updates broke it and it falls to compile. Has anyone figured it out?


HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- AsyncTCP-esphome @ 1.2.2
|-- WiFi @ 1.0
|-- FS @ 1.0
|-- Update @ 1.0
|-- ESPAsyncWebServer-esphome @ 2.1.0
|   |-- AsyncTCP-esphome @ 1.2.2
|-- DNSServer @ 1.1.0
|-- ESPmDNS @ 1.0
Compiling /data/smart-desk/.pioenvs/smart-desk/src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp.o
Compiling /data/smart-desk/.pioenvs/smart-desk/src/esphome/components/mdns/mdns_component.cpp.o
Compiling /data/smart-desk/.pioenvs/smart-desk/src/esphome/components/mdns/mdns_esp32_arduino.cpp.o
Compiling /data/smart-desk/.pioenvs/smart-desk/src/esphome/components/mdns/mdns_esp8266.cpp.o
Compiling /data/smart-desk/.pioenvs/smart-desk/src/esphome/components/mdns/mdns_esp_idf.cpp.o
Compiling /data/smart-desk/.pioenvs/smart-desk/src/esphome/components/network/util.cpp.o
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp: In member function 'virtual void esphome::idasen_desk_controller::IdasenDeskControllerComponent::gattc_event_handler(esp_gattc_cb_event_t, esp_gatt_if_t, esp_ble_gattc_cb_param_t*)':
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp:68:61: error: 'class esphome::ble_client::BLEClient' has no member named 'gattc_if'
           esp_ble_gattc_register_for_notify(this->parent()->gattc_if, this->parent()->remote_bda, this->output_handle_);
                                                             ^
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp:68:87: error: 'class esphome::ble_client::BLEClient' has no member named 'remote_bda'
           esp_ble_gattc_register_for_notify(this->parent()->gattc_if, this->parent()->remote_bda, this->output_handle_);
                                                                                       ^
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp:101:50: error: 'class esphome::ble_client::BLEClient' has no member named 'conn_id'
       if (param->read.conn_id != this->parent()->conn_id)
                                                  ^
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp:115:52: error: 'class esphome::ble_client::BLEClient' has no member named 'conn_id'
       if (param->notify.conn_id != this->parent()->conn_id || param->notify.handle != this->output_handle_)
                                                    ^
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp: In member function 'void esphome::idasen_desk_controller::IdasenDeskControllerComponent::write_value_(uint16_t, short unsigned int)':
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp:141:65: error: 'class esphome::ble_client::BLEClient' has no member named 'gattc_if'
   esp_err_t status = ::esp_ble_gattc_write_char(this->parent()->gattc_if, this->parent()->conn_id, handle, 2, data,
                                                                 ^
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp:141:91: error: 'class esphome::ble_client::BLEClient' has no member named 'conn_id'
   esp_err_t status = ::esp_ble_gattc_write_char(this->parent()->gattc_if, this->parent()->conn_id, handle, 2, data,
                                                                                           ^
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp: In member function 'void esphome::idasen_desk_controller::IdasenDeskControllerComponent::read_value_(uint16_t)':
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp:152:47: error: 'class esphome::ble_client::BLEClient' has no member named 'gattc_if'
       esp_ble_gattc_read_char(this->parent()->gattc_if, this->parent()->conn_id, handle, ESP_GATT_AUTH_REQ_NONE);
                                               ^
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp:152:73: error: 'class esphome::ble_client::BLEClient' has no member named 'conn_id'
       esp_ble_gattc_read_char(this->parent()->gattc_if, this->parent()->conn_id, handle, ESP_GATT_AUTH_REQ_NONE);
                                                                         ^
Compiling /data/smart-desk/.pioenvs/smart-desk/src/esphome/components/ota/ota_backend_arduino_esp32.cpp.o
*** [/data/smart-desk/.pioenvs/smart-desk/src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp.o] Error 1
========================= [FAILED] Took 21.84 seconds =========================```

A temporary solution:

external_components:
  - source: github://j5lien/esphome-idasen-desk-controller@pull/51/head
1 Like

of course itā€™s not reccomended to directly connects to the controlsā€¦ you will invalidate the warranty of this 1kā‚¬ desk for no actual reasonā€¦ BT is saferā€¦ and easier.
Mine has been working over bluetooth for over two years now

It seems the latest update broke it again. This time the mcu gets stuck in reboot loop.I tried flashing it again a few times by cable.

[I][esp32_ble_client:154]: [0] [e9:03:11:d1:72:f8] Service UUID: 0x1800
[I][esp32_ble_client:156]: [0] [e9:03:11:d1:72:f8]  start_handle: 0x1  end_handle: 0x9
[I][esp32_ble_client:059]: [0] [e9:03:11:d1:72:f8]  characteristic 0x2A00, handle 0x3, properties 0xa
[I][esp32_ble_client:059]: [0] [e9:03:11:d1:72:f8]  characteristic 0x2A01, handle 0x5, properties 0x2
[I][esp32_ble_client:059]: [0] [e9:03:11:d1:72:f8]  characteristic 0x2A04, handle 0x7, properties 0x2
[I][esp32_ble_client:059]: [0] [e9:03:11:d1:72:f8]  characteristic 0x2AA6, handle 0x9, properties 0x2
[I][esp32_ble_client:154]: [0] [e9:03:11:d1:72:f8] Service UUID: 0x1801
[I][esp32_ble_client:156]: [0] [e9:03:11:d1:72:f8]  start_handle: 0xa  end_handle: 0xd
[I][esp32_ble_client:059]: [0] [e9:03:11:d1:72:f8]  characteristic 0x2A05, handle 0xc, properties 0x20
[I][esp32_ble_client:154]: [0] [e9:03:11:d1:72:f8] Service UUID: 99FA0001-338A-1024-8A49-009C0215F78A
[I][esp32_ble_client:156]: [0] [e9:03:11:d1:72:f8]  start_handle: 0xe  end_handle: 0x13
[I][esp32_ble_client:059]: [0] [e9:03:11:d1:72:f8]  characteristic 99FA0002-338A-1024-8A49-009C0215F78A, handle 0x10, properties 0xc
[I][esp32_ble_client:059]: [0] [e9:03:11:d1:72:f8]  characteristic 99FA0003-338A-1024-8A49-009C0215F78A, handle 0x12, properties 0x12
[I][esp32_ble_client:154]: [0] [e9:03:11:d1:72:f8] Service UUID: 99FA0010-338A-1024-8A49-009C0215F78A
[I][esp32_ble_client:156]: [0] [e9:03:11:d1:72:f8]  start_handle: 0x14  end_handle: 0x17
[I][esp32_ble_client:059]: [0] [e9:03:11:d1:72:f8]  characteristic 99FA0011-338A-1024-8A49-009C0215F78A, handle 0x16, properties 0x1e
[I][esp32_ble_client:154]: [0] [e9:03:11:d1:72:f8] Service UUID: 99FA0020-338A-1024-8A49-009C0215F78A
[I][esp32_ble_client:156]: [0] [e9:03:11:d1:72:f8]  start_handle: 0x18  end_handle: 0x1f
[I][esp32_ble_client:059]: [0] [e9:03:11:d1:72:f8]  characteristic 99FA0021-338A-1024-8A49-009C0215F78A, handle 0x1a, properties 0x12
[I][esp32_ble_client:059]: [0] [e9:03:11:d1:72:f8]  characteristic 99FA0029-338A-1024-8A49-009C0215F78A, handle 0x1d, properties 0x2
[I][esp32_ble_client:059]: [0] [e9:03:11:d1:72:f8]  characteristic 99FA002A-338A-1024-8A49-009C0215F78A, handle 0x1f, properties 0x2
[I][esp32_ble_client:154]: [0] [e9:03:11:d1:72:f8] Service UUID: 99FA0030-338A-1024-8A49-009C0215F78A
[I][esp32_ble_client:156]: [0] [e9:03:11:d1:72:f8]  start_handle: 0x20  end_handle: 0xffff
[I][esp32_ble_client:059]: [0] [e9:03:11:d1:72:f8]  characteristic 99FA0031-338A-1024-8A49-009C0215F78A, handle 0x22, properties 0xc
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x4000c2e0  PS      : 0x00060430  A0      : 0x800da5ac  A1      : 0x3ffccc10  
A2      : 0x3ffccca4  A3      : 0x00000000  A4      : 0x00000012  A5      : 0x3ffccca4  
A6      : 0x00060423  A7      : 0x00000001  A8      : 0x00000000  A9      : 0x0000abab  
A10     : 0x3fff50f0  A11     : 0x3fff5b64  A12     : 0x3fff5a30  A13     : 0x3fff5b18  
A14     : 0x3fff5a89  A15     : 0x3fff5b19  SAR     : 0x00000010  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000000  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0x00000000  

ELF file SHA256: 0000000000000000

Backtrace: 0x4000c2e0:0x3ffccc10 0x400da5a9:0x3ffccc20 0x400d999e:0x3ffccc40 0x400d6ec5:0x3ffccce0 0x401eb919:0x3ffccd10 0x400db2d5:0x3ffccd30 0x401ebd39:0x3ffcce30 0x401ebe15:0x3ffcce50 0x400e2e1a:0x3ffcce70 0x400e59ae:0x3ffccea0 0x400f11fc:0x3ffccec0 0x400909d6:0x3ffccee0

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8
[I][logger:258]: Log initialized
[C][ota:469]: There have been 7 suspected unsuccessful boot attempts.

For anyone searching, here is a step-by-step tutorial how to connect the desk BLE controller to Home Assistant via ESP32.

You may want to update the code. The last time I check the resource link was referring to @v4

Corrected link:

Very late to the party, but I have been working on exactly this since I got myself a LINAK desk. I am still working on it, but I have managed to control the LINAK desk directly with an ESP32 and a custom circuit: GitHub - Ordspilleren/esp32-linak-desk-control.

Because of the custom circuit it is a bit involved, but it works fairly reliably once set up.

1 Like

Great work!

I look forward to implementing this :slight_smile:

RX_PIN 0 is that GPIO0?

Iā€™m trying to make a compleate circut board for this and thinking of trying to make this ESPHome compatible.

It is. I use an ESP32-C3, so the default UART pins are used for USB communication, at least on my board. In my code I use uart_set_pin to re-map them to GPIO0 and GPIO1.

I donā€™t have any experience designing circuit boards, but I am happy to help if you need any assistance. Porting my code to ESPHome should be possible, I believe it supports esp-idf for custom components.

Got the prototype in hand now - but I cannot see how you compile/upload the code - Iā€™m used to PlatformIO for ESP/Arduino boards.

Can you give a hint?

Looking to build one myself, how far have you got with esphome code?

Havenā€™t even succeeded in getting the current code compiled and flashed.
So the progress in making it ESPHome ready havenā€™t started yet.

I have come as close as getting it compiled, but I have one of those Wemos d1 mini esp32 ones that isnā€™t easy to get into download modeā€¦

I just installed esp idf and then followed the onscreen instructions

@Ordspilleren does your controlbox also click every few seconds? Could that come down to not having the nPWRreq connected?

Also, I see in your code a WAKE_UP_PIN?! What should that be connected to?

Also the movement is a bit jerky - doesnā€™t move smooth up and down