Skip to content

Reverse engineering the controller that comes with the autonomous smart desks

Notifications You must be signed in to change notification settings

Stefichen5/AutonomousControl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Autonomous Standup Desk Controller

This writeup is still WIP

The Idea

I bought a standing desk from Autonomous (Smart Desk 2 Home Office). After setting it up, I was wondering how the controller and the table/motor controller communicate with each other.

ToDo

  • More detailed writeup
  • Finish implementing protocol on ESP32 (possibly with wifi control in the future?)

First impressions

Opening up the controller reveals nicely labeled PINs.

IMG_20200304_195541

Thus we now only know that UART is used to transfer data, but also which wire carries which signal:

color function
red sleep(?)
orange GND
green TX
yellow RX
blue 5V

After some trying out, I found the baudrate: 9600

Height-Profiles are not saved on this controller - they are stored in the desk.

The controller board uses a STC12C5612AD controller. It features:

  • 3,5-5,5V
  • 8 Bit
  • 23 I/O pins
  • 1x UART
  • 768 Bytes RAM
  • 4K-30 KB program memory size (according to datasheet)

Datasheet

My Setup

I used a DSView Logic Analyzer which I bought here from Banggood.

I did not dismantle the controller that shipped with my desk. Instead, I asked the customer support for a spare one / replacement. They shipped it to me for 27€.

I opened up the casing (standard screws) and found a nicely labeled PCB where I could attach the probes to.

You can find my captured data from the logic analyzer in the folder "logic_analyzer".

Received Data

When no button is pressed, we keep receiving (repeating):

Base Message:

Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5
0x98 0x98 0x00 0x00 (height) (height)
0x98 0x98 0x03 0x03 (height) (height)

Height can be a value between 0x4B and 0x7B

I am not really sure about the meaning of 0x03 as byte 2+3. I have mostly seen 0x00, but sometimes also 0x03.

Height indication:

Height: 29.05

Last 2 Bytes of Message: 0x4B, 0x4B

Height: 29.09

Last 2 Bytes of Message: 0x4C, 0x4C

Height: 30.03

Last 2 Bytes of Message: 0x4D, 0x4D

Height keeps increasing in steps of 0.4 Message keeps increasing by 1 ...

Height: 48.00

Last 2 Bytes of Message: 0x7A, 0x7A

Height: 48.40

Last 2 Bytes of Message: 0x7B, 0x7B

Transmitted Data

Base message:

Byte 0 Byte 1 Byte 2 Byte 3 Byte 4
0xD8 0xD8 0x66 (button) (button)

Button values:

⬇️ 0x01 (0b0000_0001)

⬆️ 0x02 (0b0000_0010)

1️⃣ 0x04 (0b0000_0100)

2️⃣ 0x08 (0b0000_1000)

3️⃣ 0x10 (0b0001_0000)

4️⃣ 0x20 (0b0010_0000)

Ⓜ️ 0x40 (0b0100_0000)

Pressing up

0xD8, 0xD8, 0x66, 0x00, 0x00

0xD8, 0xD8, 0x66, 0x02, 0x02

(keep going with end 0x02 as long as the button is pressed)

Pressing Down

0xD8, 0xD8, 0x66, 0x00, 0x00

0xD8, 0xD8, 0x66, 0x02, 0x01

(keep going with end 0x01 as long as the button is pressed)

Pressing 1

0xD8, 0xD8, 0x66, 0x00, 0x00

0xD8, 0xD8, 0x66, 0x04, 0x04

(keep going with end 0x04 as long as the button is pressed)

Pressing 2

0xD8, 0xD8, 0x66, 0x00, 0x00

0xD8, 0xD8, 0x66, 0x08, 0x08

(keep going with end 0x08 as long as the button is pressed)

Pressing 3

0xD8, 0xD8, 0x66, 0x00, 0x00

0xD8, 0xD8, 0x66, 0x10, 0x10

(keep going with end 0x10 as long as the button is pressed)

Pressing 4

0xD8, 0xD8, 0x66, 0x00, 0x00

0xD8, 0xD8, 0x66, 0x00, 0x20

(keep going with end 0x20 as long as the button is pressed)

Pressing M

0xD8, 0xD8, 0x66, 0x00, 0x00

0xD8, 0xD8, 0x66, 0x40, 0x40

(keep going with end 0x40 as long as the button is pressed)

Analyzing the protocol

  • Controller->Desk: Every message contains 5 bytes

  • Controller->Desk: Message always starts with 0xD8, 0xD8, 0x66

  • Controller->Desk: Last 2 Bytes always repeat

  • Desk->Controller: Every message contains 6 bytes

  • Desk->Controller always starts with 0x98, 0x98, 0x00, 0x00

  • Every button corresponds to 1 bit in the message

    • 7 buttons, 8 bit -> highest bit unused (?)
  • The controller sends the current state of the buttons after receiving a message from the desk

  • The controller seems to only move as long as it is receiving data (0x00 as button-data seems to be enough)

  • Messages are sent every ~50ms

About

Reverse engineering the controller that comes with the autonomous smart desks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published