-
Notifications
You must be signed in to change notification settings - Fork 0
How did you automate your Autonomous standing desk? #13
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
Comments
Hi @stvnwn! Sorry for not seeing this. I actually hadn't worked with Microcontrollers for at least a decade when I got back into them and automated the desk. Buying the cableThe desk has a keypad connected to the motor driver using a cable that looks like ethernet, but which is actually 10 wires instead of 8 - it's a 10P10C connector. I bought a cable+connector on Amazon for $5. Autonomous only uses 4 of the 10 wires (so it's kindof annoying they went with a 10P connector instead of something like a phone jack, which would have been like 5¢). The microcontrollerThen I bought an ESP8266 chip from Amazon (3 for $12), and flashed Espruino onto it. Espruino is awesome - you plug in your chip via USB, open the Espruino Web IDE, write some JavaScript, and hit "flash" or "send". Detour: bundling and minifying the JS before flashingI got a little into the weeds and built a whole Rollup-based bundler + command-line flashing tool instead of using the IDE because I wanted to squeeze a lot more code onto the device. It's called Making ESP8266 talk to the deskFrom there, I found Stefan's exceptional reverse-engineered protocol description. With that information in hand, I wrote up some JavaScript for the microcontroller that listens for data from the desk's motor controller and can send it commands like UP/DOWN/M1/M2/etc: Making the desk talk to the ESP8266 (for longer than 2 seconds)I had to do a bunch of performance testing to find the right way to handle the barrage of data from that motor controller in Espruino. Most of my naive attempts couldn't process the data fast enough, and when that happens Espruino starts buffering the received data. That immediately fills the device's memory and it crashes (or overheats!). Two tricks are required to make this work:
Exposing a REST API and Web GUIThen I wrote a bit more code that turns the ESP8266 into a web server (it's actually pretty good at this!). The web server hosts an API and a little controller/keypad web app that hits that API and allows me to operate the desk. Powering it upConveniently, when you plug the connector wire into the motor controller, it provides power over one of the wires. It provides 5v, but the ESP8266 chip is 3.3v. Normally that would fry the chip, but as it turns out the ESP8266 is 5v tolerant. This means it boots and runs as long as the wire is connected to the motor controller - no battery or wall adapter needed! Here's a video of it working (using the UI on my computer for so I could record from my phone): |
The files reference a utils.js that’s not present. Would you be able to share that? |
Could you also share the wiring diagram? Which pins on the ESP did you connect to? |
Hey @developit , amazing job creating the project. I would like to create an integration for HomeAssistant and your project would help a lot. |
Hiya @vipial1 - a Home Assistant integration would be awesome, I would 100% use that! Want to DM me on Twitter so I have your info? I might be able to help. Regarding the buttons, you're right that the microcontroller replaces the default desk buttons, but that is actually just laziness on my part! Because of the way the wire protocol works, you can actually just keep the controller module connected by soldering a female RJ50 connector - both the microcontroller and desk button controller can connect to the same 5 wires. I can make a diagram if that was unlcear haha. I'm actually about to set my desk back up in a new house, and my plan was to fix this issue! |
@developit a diagram would really help! I had the same idea as @vipial1 using an ESP32 (since it has three serial ports) - one to listen from the desk and one to transmit to the keypad. If it can be done as you described, that will be better. Best |
@developit I sent you my email via Twitter. Please, take a look |
Migrating to a GH repo: |
I have a aum world advanced standing desk that use the same controller and keypad. I will look to port it to esphome to have home assistant integration but it's very hard to find a female RJ50 10PC10 😭 (shipping to France 😅) |
Here the home assistant integration: https://github.com/vipial1/desky-ha |
Maybe check with Upsy Desky? That looks like the RJ50 from my desk, but I have no idea what pins the RJ45 controllers use. |
Thanks. I've already checked with the Upsy Desky developer. He wasn't able to help. Is there a way to determine what each pin in the picture is? I can then ask the Upsy Desky owner what pins on the RJ45 he uses. |
Did this port to esphome ever happened @developit ? |
I noticed that you did so from your comment on this GitHub issue. Honestly, I'd be satisfied if you only shared a photo of your custom keypad, just so I know that this project is viable for someone new to microcontrollers.
The text was updated successfully, but these errors were encountered: