Open ijohnston1911 opened 2 months ago
Just to be clear. Looks like the E5-A has an all-in-one controller rather than a separate keypad, so connecting it to ESPHome or similar will involve internal modifications. Good luck tracing the signals, but it might be significantly different from before. For example, the STM32 might do both the keypad buttons and the motor control, without a serial connection in between.
After some poking around it looks like there's no serial interface to inject commands into.
For control, I ended up soldering to the test pads for the buttons and connecting to a Raspberry Pi GPIO. By pulling the GPIO pins to ground I can simulate a button press.
To get the current height of the desk, ultimately the best option was reading the pins from the 7 segment display. With the casing open and looking at the pcb with the STM32 from behind (as in the first picture) , Pin 1 is the top left most pin and the number increases in a clockwise configuration:
1 | 2 | 3 | 4 | 5 | |
12 | 11 | 10 | 9 | 8 | 7 |
Pin 6 is not exposed. Pins 12, 9, and 8 are the common pins for each digit (tens, ones, tenths respectively). By using these three pins as interrupts and reading the state of the rest I was able to parse out the reported height in a way that consistently matched the display. Very occasionally I run into a timing issue and its not able to decode the signals correctly using this method, but it is infrequent and workable for my purposes. The segment lettering that corresponds to the graphic in the readme is as follows:
E | D | DP | C | G | |
12 | A | F | 9 | 8 | B |
Investigating the ribbon connector I've found pins for
but I opted not to pursue the ribbon cable further because it looks like everything I can tap into there is going to be relative positioning and the STM32 is storing the current position in some form of persistent memory. There's a possibility it could be accessed using the SWD interface (rear usb) but I lack the experience to access the memory registers through that interface.
I hope this is helpful for anyone that ends up with an E5-A and is hoping to control it externally.
I ordered a E5-A thinking I would get an E5 controller. There is no RJ45 port, only a USB-A and a USB-C on the side . These are both mentioned in the manual as being there for charging phones. There is an unmentioned USB-A port that had a cover on the back of the controller that seemed to be a likely contender, but after tearing it down down and tracing continuity across the pcb this seems to be for SWD.
The keypad is connected to board with all the connectors via an 22 pin ribbon cable. I tried probing it and annotating an image but it turned out that the ribbon cable has more conductors on the other side and I wasn't mapping them properly. I plan to try again tomorrow to more effectively map the pinout and see if I can find a UART TX / RX pin.
Here's some pictures of the board I'm working with if anyone has any recommendations
Its an STM32G030 C8T6 microcontroller
and the datasheet im going off of is here https://www.st.com/resource/en/datasheet/stm32g030c6.pdf