tjhorner / upsy-desky

Make your standing desk smarter
https://upsy-desky.tjhorner.dev
Other
478 stars 24 forks source link

WN17CM2 Support #8

Open AnalogAyub opened 1 year ago

AnalogAyub commented 1 year ago

I was able to set up the UpsyDesky easily, but the unit would not power on with just the RJ45 from the desk controller box. Once connecting a USB-C, the unit was detected by Home Assistant but would not control the desk or detect a height. Additionally, the desk keypad daisy-chained through the UpsyDesky would not control the desk.

Here's what the box looks like:

Screenshot 2022-09-05 at 15 59
tjhorner commented 1 year ago

Interesting, could you verify that the +5V and GND lines are on the correct positions? You can find the RJ45 pinout here. If they aren't in the correct place, you may need a special cable.

seanford commented 1 year ago

Same for the WN17CM3, which I assume will have the same pinout. This is the controller for the Monoprice desks.

seanford commented 1 year ago

https://www.kontive.com/products/lifting_table_part/17.html

Maybe they can help.

AnalogAyub commented 1 year ago

Interesting, could you verify that the +5V and GND lines are on the correct positions? You can find the RJ45 pinout here. If they aren't in the correct place, you may need a special cable.

Honestly, I'm out of my depth here 😬

Providing power through USB-C was no problem, though.

seanford commented 1 year ago

If anyone figures out the pin out for the controller, I can make a cable and test it out.

seanford commented 1 year ago

Any instructions on how to test the pinouts so I can help move this along?

tjhorner commented 1 year ago

@seanford I recommend getting an RJ45 breakout board like this one so you have somewhere to attach multimeter leads. Then follow this guide: https://github.com/tjhorner/wifi-desk-controller/wiki/Desk-Compatibility

Basically, just use a multimeter to find the position of the +5V and GND pins. After that we can start figuring out which pins transfer which data, if it uses serial, etc.

Jaharmi commented 1 year ago

I have a desk with a WN17CM3 controller. The control pad is wired with an RJ45. I have found the following pinouts and color coding.

Control panel wires

Wire color Pin label
Red Vin
Blue Rx
Yellow Tx
Black Gnd

RJ45 pinout

RJ45 pin Wire color Note
1 Orange
2 Blue Rx from control panel
3 Black Gnd from control panel
4 Yellow Tx from control panel
5 Red Vin from control panel
6 Orange
7 Orange
8 Orange

Below are pictures of my evidence:

  1. the disassembled control pad, where the circuit board labels the wires Image

  2. the RJ45 cable coming from the control pad (bottom and top, since it was difficult to see the colors on all the wires from the bottom) Image Image

Jaharmi commented 1 year ago

With my just-arrived Upsy Desky, I see the same thing as @AnalogAyub.

  1. I was able to set up the UpsyDesky easily.
  2. Connected USB-C, the unit was adopted by ESPHome and detected by Home Assistant.
  3. The unit would not control the desk or detect a height. I tried both decoders.
  4. The desk keypad daisy-chained through the Upsy Desky would not control the desk.
  5. The unit stopped responding with just the RJ45 from the desk controller box. I tried connecting to the Upsy Desky Web interface and it timed out.

I will double-check for the +5V and GND pins from the controller box.

Once I've found that, will the device need a debug firmware installed? Or is there something I can change in the (very minimal) ESPHome config?

Jaharmi commented 1 year ago

I think RJ45 pin 2 is +5v and 3 is GND. I've also posted in the reverse engineering discussions area.

swoga commented 10 months ago

i reverse enginieered the pinout and protocol some time ago, maybe this will help you: https://github.com/swoga/standingdesk

Jaharmi commented 5 months ago

@swoga Awesome. I’ve been wondering about this for years! Do you have any thoughts on how this could integrate into Upsy-Desky / ESPHome?

swoga commented 5 months ago

@Jaharmi My plan is to write a custom component for ESPHome, but I haven't gotten around to it yet. It's definitely still on my to-do list.

Jaharmi commented 5 months ago

@swoga If this fit in with Upsy-Desky, I’d be a fan. :) That would give it things like the Upsy-Desky local Web interface. I already have an Upsy-Desky and just never figured out how to get from beyond the pinouts to do anything else.

Looking at the related component, the C++ part is currently beyond me.

Jaharmi commented 5 months ago

@swoga Does this state diagram seem to handle what you found in the serial protocol for the WN17CM3? I am trying to understand the protocol and maybe do something with it. This is probably my first state diagram ever so I may have mixed it with a flow chart.

stateDiagram
    [*] --> CMDBEGIN
    CMDBEGIN --> CMD: colon
    CMD --> DISPLAY: D
    CMD --> KEY: K
    CMD --> REQUEST: R
    CMD --> ACKNOWLEDGE: A
    DISPLAY --> HEIGHT
    HEIGHT --> HEIGHTCKSUM: decimal number as string
    HEIGHTCKSUM --> CMDEND: semicolon
    HEIGHT --> COMMAOPT: comma
    COMMAOPT --> HEIGHTCKSUM
    KEY --> DONTCARE
    REQUEST --> DONTCARE
    ACKNOWLEDGE --> DONTCARE
    DONTCARE --> CMDEND: semicolon
    CMDEND --> CHKSUM
seanford commented 5 months ago

Vin from control panel

@tjhorner it seems that the pinouts for this controller are the same as other controllers, but the protocol is different. With the information provided by @swoga, is it possible to write a new decoder for this controller? I'd do it myself if I thought I could...lol

KiloHotl commented 3 months ago

hi @swoga could yo develop the custom component? I been trying for several weeks and nothing worked.