Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WN17CM2 Support #8

Open
AnalogAyub opened this issue Sep 5, 2022 · 23 comments
Open

WN17CM2 Support #8

AnalogAyub opened this issue Sep 5, 2022 · 23 comments
Labels

Comments

@AnalogAyub
Copy link

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
Copy link
Owner

tjhorner commented Sep 6, 2022

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
Copy link

seanford commented Sep 6, 2022

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

@seanford
Copy link

seanford commented Sep 6, 2022

@AnalogAyub
Copy link
Author

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
Copy link

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

@tjhorner tjhorner changed the title Support for wn17cm2 controller WN17CM2 Support Oct 2, 2022
@tjhorner tjhorner moved this to Todo in New Desk Support Oct 2, 2022
@seanford
Copy link

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

@tjhorner
Copy link
Owner

@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
Copy link

Jaharmi commented Nov 18, 2022

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
Copy link

Jaharmi commented Jan 31, 2023

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
Copy link

Jaharmi commented Jan 31, 2023

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

@swoga
Copy link

swoga commented Aug 28, 2023

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

@Jaharmi
Copy link

Jaharmi commented Feb 2, 2024

@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
Copy link

swoga commented Feb 2, 2024

@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
Copy link

Jaharmi commented Feb 2, 2024

@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
Copy link

Jaharmi commented Feb 3, 2024

@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.

Loading
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
Copy link

seanford commented Feb 5, 2024

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
Copy link

KiloHotl commented Apr 5, 2024

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

@iambucketdotcom
Copy link

Hi! I, too have this controller and have only been able ot get the UART messages to work with upsy desky. am I understanding correctly that more is still needed to make this unit work?

Thanks - Bucket

@seanford
Copy link

Unfortunately, I don't think it is going to happen.

@seanford
Copy link

Is it safe to say that this control box will no be supported by Upsy Desky? Just wanted to know if I should continue to monitor this project for an update or just move on.

@Jaharmi
Copy link

Jaharmi commented Dec 15, 2024

Unless someone like @swoga can figure out a component that handles the communication, I don’t see it happening. Although I’m very interested in making it work, it’s beyond my current understanding.

I’m still not sure why the Upsy-Desky doesn’t seem to get power from the WN17CM3 controller. It seems like that, at least, should be working, given the pinouts we’ve all found.

I am not sure whether or not my Upsy-Desky’s RJ45 ports even work.

I also don’t know if there’s a way to capture and decode the serial/UART communication. Maybe something could be done with the UART Bus component in ESPHome. 🤷 (It looks like this is what the Reverse Engineering Guide does.)

@Jaharmi
Copy link

Jaharmi commented Jan 4, 2025

Update: I set up the reverse engineering firmware with the UART settings from @swoga. Since I could not set a stop_bit of 0, I set it to 1.

With this firmware, I was able to capture sequences that appear to correspond to the investigation by @swoga. I can confirm that the display on the connected keypad — which initially started out at 8.8.8 — did update with the expected desk height values that I normally see when the Upsy-Desky is not in the loop.

I am attaching the following files:

Rough sequence of events from that test:

  1. Flashed firmware to Upsy-Desky via USB and let it start up until I could see logs
  2. Connected WN17CM3 controller (standard Ethernet cable with 2x RJ45) to Upsy-Desky
  3. Connected keypad with its cable (RJ45) to Upsy-Desky
  4. Keypad displayed "8.8.8" (I don't think the display changed during the testing)
  5. Pressed Up button
  6. Pressed Down button
  7. Pressed preset button "1" and pressed it again to stop
  8. Pressed preset button "2" and pressed it again to stop
  9. Pressed preset button "3" and pressed it again to stop
  10. Pressed preset button "4" and pressed it again to stop
  11. Pressed button "M"
  12. Disconnected controller and keypad from Upsy Desky

@Jaharmi
Copy link

Jaharmi commented Jan 4, 2025

I refreshed the Upsy-Desky with similar firmware to what I used above, but changed back to the reverse engineering firmware’s log_hex lambda, rather than log_string. I didn’t make any other changes.

Here is the log capturing in hex: upsy-desky-WN17CM3-uart-hex-logs-all-buttons.txt

I followed the same rough sequence, trying to press each button at least twice. The display correctly showed the desk height when I connected the keypad and controller to the Upsy-Desky. It also updated as I raised and lowered the desk with the up/down buttons and presets. It also flashed when pressing the “M” button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

7 participants