LLM-assisted hardware hacking - for fun and profit
I bet other people are already experimenting with the same thing, but I want to share my experience with my project, and how local / open-source LLMs saved the day.
I have a bunch of Tuya Zigbee devices around my apartment, and while they work fine out of the box, I still want to tweak certain things. For example, the TS0046 button has an annoying 500 ms delay after each press, and I want to remove it.
The task requires:
1. Dumping the FW
2. Reverse engineering (RE)
3. Writing a new FW
4. Compiling and flashing
The first step was already a roadblock, since most Tuya devices use Telink's SWS protocol, which requires a costly flasher. A UART bit-banging project (from pvvx) exists, but it never worked in my case.
I initially asked Claude to handle the task, as I was curious whether it would trip the safeguards. It turns out it did, at the very key steps. So I ended up running pi with GLM-5.3 (via an HF inference provider; I could host it myself, but I don't have a big server rack in my apartment). To my surprise, it worked well.
About 20 minutes later, the app was running, the FW was dumped, and it was already doing RE.
And as I'm writing this, it has already finished writing the new FW and flashing it.
Without open-source LLMs, I would never have been able to achieve this.