|
I've hooked up my Megadesk (delivered Q4 2025) to an ESP32-C3 and get strange serial responses from Megadesk. As seen below, activating stored positions, resetting Megadesk and requesting current position responds with errors not in compliance with the serial protocol and no desk movement. Responses received when adjusting the desk with the physical buttons are OK. Might anyone have an idea on what's going on here? Thanks! |
Replies: 2 comments 37 replies
|
The Megadesk and ESP32-32 is wired as per this comment, using LM2596S with common ground: #87 (comment) |
|
So, I've now tried with both a resistor voltage divider to bring the Megadesk 5V TX down to 3.3V for the ESP32-C3, followed by a 5V-3.3V bi-directional logic level converter, with no difference. Voltage levels confirmed with a scope and serial data confirmed with a logic analyzer (matches serial data above). Could this be a firmware issue, i.e. firmware flashed with "incorrect" build flags? |
@gcormier This took me down the rabbit hole 🙂 After reflashing the Megadesk and still having the same issue, I connected an FTDI USB to serial adapter to rule out the ESP32-C3. Manually typed commands were interpreted correctly by Megadesk, while pasted commands were not - timing issue! While looking into the docs for the Arduino core used, I found a section on serial timing issues when using internal oscillator and supply voltage above 3.3V as is the case with the Megadesk. A long story short, 115200 baud rate is too inaccurate with at least my Megadesk due to chip variance and ambient temperature. The internal oscillator can be calibrated, but opted for a slower 19200 baud rate and now …