Image 1 — Open source firmware for a cheap USB C meter (KWS-X1) that shows way more PD info than stock
Image 2 — Open source firmware for a cheap USB C meter (KWS-X1) that shows way more PD info than stock
Image 3 — Open source firmware for a cheap USB C meter (KWS-X1) that shows way more PD info than stock
Image 4 — Open source firmware for a cheap USB C meter (KWS-X1) that shows way more PD info than stock
▲ 62 r/UsbCHardware+1 crossposts

Open source firmware for a cheap USB C meter (KWS-X1) that shows way more PD info than stock

Hi all,

I didn't really see much open-source PD firmware for cheap power meters, so I decided to take matters into my own hands and wrote my own. It's mainly for the KOWSI KWS-X1, but I purposely split it into 3 repos so other people can adapt it to their own devices:

It does the usual meter stuff: voltage, current and power, plus asking the charger for a fixed or PPS voltage. It also has a 5A cable test, and it remembers your settings after a power cycle. The part I'm happiest with is how much PD info it shows. Most cheap meters just say "PD 20V" and that's it. This one shows the charger's full offer (EPR included), its ratings and live status, and the cable's e-marker decoded field by field. It also shows every step of the negotiation, so when a charger acts weird, you can actually see where. You can also put it between a charger and your phone and watch what they say to each other. The full list is in the README.

Now the honest part, because it definitely has its minuses. It's PD only for now, so no QC, AFC or FCP. It can see EPR offers but can't actually go above 20V yet. There's no mAh/Wh counting, no graphs, no logging and no app, and there's no calibration setting either. It forgets your chosen voltage on reboot and always starts at 5V, and flashing only works from Linux right now. I've also only tested it with the chargers and cables I have, so there are surely bugs I haven't hit yet.

I'm planning to add EPR, QC and other protocols in the future, but I can't put all my time into this project, so it will go step by step. That's the good part of open source, though: anyone can jump in and contribute or change the code however they like, and PRs are very welcome.

Getting into the bootloader is easy: hold Back + OK while plugging it into your PC. The README has the full flashing steps and a checklist for testing it by hand.

Disclaimer: Flash at your own risk. I'm not responsible if you damage your device.

AI disclaimer: I used AI tools while working on this. Credit where credit's due. That said, this is far from a vibe-coded project. I followed the official documentation the whole way: the USB PD spec, the chip datasheets and the HC32F460 reference manual. The code isn't a 1:1 copy of those docs, but every protocol value and register setting comes from them, not from guessing. I also tested everything on the real device myself as much as I could.

Some questions I expect:

Why tho?

Why not. The KWS-X1 was cheap enough and capable enough to show a lot of data and talk PD properly, so it made sense.

Will it work on my meter?

If it's a KWS-X1, yes. If it's something else, not necessarily, but that's exactly why the repos are split. If your meter uses an HC32F460, the HAL repo is a good start. The PD protocol repo doesn't care about the chip at all.

Can I go back to stock firmware?

Yep, I tested it myself. To enter the bootloader, hold Back + OK while plugging it into your PC, and then flash the stock image back. Everything worked, triggering included. I found the stock firmware through this blog post: https://tomoca2.hatenablog.com/entry/2026/02/15/221952 (just to be clear, I'm not associated with the author in any way, I just found it useful).

Why Rust?

Idk I like the language and I wanted to. Embassy also makes embedded development really pleasant, and Rust's type system catches a lot of mistakes before they ever reach the device. PD has plenty of states you really don't want to get wrong.

Git history not that old?!

Yep. At first, I did everything in one monorepo, with all development in one place. It got messy, and the history ended up being hundreds of messy commits. Separate repos with a clean history just made more sense.

Repo: https://github.com/kralonur/kws-x1-standalone-rs

So this is what I've got so far. Happy to hear feedback.

Edit: Added cross compiled flasher

Edit 2: Ready-to-flash firmware is now available too, so you don’t have to build anything. Download the firmware and the flasher for your OS, verify the checksums, and follow the README. No installation needed.

Both under: https://github.com/kralonur/kws-x1-standalone-rs/releases/

u/kralonurdev — 5 days ago
▲ 22 r/esp32+2 crossposts

ESP32 Rust based standing desk firmware

Hey everyone! I built a standing desk firmware using an ESP32 and Rust Embassy. I know it's a bit of a niche project, but my controller broke and, well, I decided to just build my own. When I searched Reddit and GitHub, I noticed most people build integrations for their existing desks rather than writing the actual firmware, so this was a great learning opportunity for me.

Since my background is in non-embedded software, I might have made some mistakes or done things the "wrong" way. I'm totally open to criticism and contributions feel free to roast my code and hardware choices :D

The firmware was designed with a 2-motor standing desk in mind (complete with sync logic, safety features, and everything), but adapting it for a single motor should be pretty easy with a bit of refactoring.

Obviously, I wouldn't recommend replacing a perfectly working controller with this. But if you're in the same boat I was; unable to find a replacement controller, scoring a cheap desk frame second-hand, or just going crazy and building a DIY desk from scratch, this project might come in handy. It's also highly configurable using parameters via MQTT.

I used esp32 s3, IBT-2 / BTS7960 for each motor and 24V 120W dc motors with encoders. Ofc psu to run them all.

All the details, including the hardware used, wiring diagrams, design decisions, and running instructions, are up on GitHub!

github.com
u/kralonurdev — 16 days ago

Hello everyone, I made a simple tool to update Arch package versions. For now, the supported sources are GitHub releases, git branches/commits, and npm.

It basically checks the PKGBUILD file, compares its version with one of the sources I listed, and updates the version if there is a newer one. It can be useful for end users who do not want to wait for a package maintainer to update their preferred package. It can also be useful for package maintainers who want to update package versions automatically through GitHub Actions, or locally. I included an example in the repo.

I am open to any feedback, and if anybody wants to contribute, it is written in Rust. And yeah, I’ll say it before someone else does: using Rust was of course unnecessary, but I use it at my job and I like the language, so why not :d

Also, the project name sucks, so I may change it. I am not the greatest at naming things, so recommendations are appreciated.

GitHub: https://github.com/kralonur/aur-updater

u/kralonurdev — 5 months ago