Giter VIP home page Giter VIP logo

loctekmotion_iot's Introduction

Flexispot Desk with automation logos (image source: Windows Central)

Turn your LoctekMotion/FlexiSpot desk into a smart desk

Recently I acquired a new standing desk from FlexiSpot. During assembly I noticed that the control panel had a RJ45 cable and a second RJ45 port, which sparked my interest. Can we connect my desk to the internet?

Most of the models Flexispot sells are using components from LoctekMotion. LoctekMotion is a manufacturer of lifting columns for height adjustable standing desks. On their website they mention a bluetooth receiver that can be inserted to the control box, but I haven't been able to find this.

This repository will help you to connect your desk to the internet via the serial communication ports (RJ45), for example for use with Home Assistant. Think of scenarios like controlling your desk via voice or creating notifications when you sit for too long. (or just because it is cool ๐Ÿค“)

Packages

Use the information in this repository at your own risk and with caution. Tinkering with electronics always has risks.

Name Description
Arduino Custom code to control your desk via an ESP32/ESP8266 module via MQTT.
ESPHome Control your desk via an ESP32/ESP8266 module connected to Home Assistant.
Raspberry Pi Custom code to control your desk via a Raspberry Pi via Python.

For more packaged solutions, see similar projects. Pull requests are welcome.

Research

If you are interested in the internals of the LoctecMotion desk system, have a look at the research below which is composed of my own findings combined with findings of similar projects.

Control Panels

At the time of writing, LoctekMotion sells 11 different control panels. The features can differ per model, but it looks like the serial interface is pretty similar for the more advanced models.

The tables below will show a mapping of the RJ45 pinout to the pinout used by the control panel. Please note that all RJ45 pins are described in the following way;

RJ-45 connector layout

In order to connect the control box to a Raspberry Pi and ESP32/ESP8266 chip I used a RJ45 to RS232 adapter with DuPont cables (jump wires), but you simply can cut and split an ethernet cable as well.

Supported Control Panels


HS13A-1


HS01B-1

If your control panel is missing, feel free to create an issue to discuss the possibilities or create a PR to add your research to this overview.

  • Desk model: Flexispot EK5
  • Tested with control box: CB38M2B(IB)-1
  • Source: Printed on the PCB of the control box.
RJ45 pin Name Original Cable Color Ethernet cable color (T568B)
8 RESET SWIM Brown White-Orange
7 PIN 20 White Orange
6 RX Purple White-Green
5 TX Red Blue
4 GND1 Green White-Blue
3 +5V (VDD) Black Green
2 29V+ Blue White-Brown
1 29V- Yellow Brown

Note that RX and TX is defined like this on receiver (control panel) side. So RX can be used to receive data, TX to send data.

RJ45 pin Name Original Cable Color Ethernet cable color (T568B)
8 +5V (VDD) Yellow Brown
7 GND Blue White-Brown
6 TX Black Green
5 RX Green White-Blue
4 PIN 20 Red Blue
3 (unknown) Purple White-Green
2 SWIM White Orange
1 RES Brown White-Orange

Note that RX and TX is defined like this on receiver (control panel) side. So RX can be used to receive data, TX to send data.

Other control panels / control boxes could be supported in the same way, but you would need to figure the RJ45 pinout mapping. Most control boxes have an extra RJ45 port for serial communication, but otherwise you would need to place your device in between the control panel and the control box.

Retrieve current height

Based upon the great work of minifloat, it became clear that the control panel utilises a 7-segment display. Fortunately, this is very common in such devices and thus there is a lot of documentation on this topic.

The control box sends the height as 4-bit hexadecimal, which is decoded in the control panel to drive the 7-segment display. The second number on the display also supports an optional decimal point ("8 segment").

Make sure you set the baud rate to 9600. For most LoctekMotion desks, the control box only broadcasts the current height for x seconds after you sent the Wake Up command. Otherwise you will receive 0x00 0x00 0x00 as payload.

source: alselectro

Execute a command

The control box only accepts commands when the 'screen is active'. To activate the screen, PIN 20 needs to be set to HIGH for about 1 second. The screen gets disabled automatically again after some amount of time receiving no commands.

Command list

Command name Start Length Type Payload Checksum End
Wake Up 9b 06 02 00 00 6c a1 9d
Up 9b 06 02 01 00 fc a0 9d
Down 9b 06 02 02 00 0c a0 9d
M 9b 06 02 20 00 ac b8 9d
Preset 1 9b 06 02 04 00 ac a3 9d
Preset 2 9b 06 02 08 00 ac a6 9d
Preset 3 (stand) 9b 06 02 10 00 ac ac 9d
Preset 4 (sit) 9b 06 02 00 01 ac 60 9d

All bytes combined will become the command to send to the control box. See the packages for sample code.

Similar projects / research

While working on this project, I found out that I am not the only one with this idea. There are a few repositories on GitHub with great research which helped me kickstart this project. โค๏ธ

and a huge thanks to the Tweakers.net community (Dutch), whom helped me to kickstart this project.

Support

Join our Discord channel

loctekmotion_iot's People

Contributors

andybalze avatar bitsofthr avatar foxytocin avatar fruchtzwerg94 avatar glanch avatar imicknl avatar jodevsa avatar mad2xlc avatar pepsinio avatar staxdb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.