r/oscilloscope • u/anarsoul • 1d ago
Tips and tricks New app and patched firmware for Hantek 2C42 / 2C72 / 2D42 / 2D72
Hey folks, I have something cool to share with you.
Following the steps of OpenOSC developer(s), I patched Hantek 2XX2 firmware and developed a better app for it.
It isn't exactly new firmware - it is original firmware patched to fix a few issues. But hey - it isn't slow anymore, it can do over 30 captures a second! It works on Linux, Mac and Windows. It has "retain" and "grade" features, spectrum (FFT), DMM and generator support. Generator is untested - my 2C72 doesn't have it.
With the app and patched firmware this small scope becomes a quite useful bench tool. See a few screenshots attached.
Obligatory disclaimer: yes, it was written with help from AI. Do I understand what it does? Yes, I do. I am an experienced software engineer.
The app will work with stock firmware just fine, but capture rate will be abysmal - around 4-5 captures a second at most. It is due to the way Hantek implemented the firmware - it isn't built for streaming, it is built for a single capture. With AI help I reverse engineered and patched it, now it does up to 30 captures a second at a single channel, slightly less with both channels enabled.
DMM is slow, but it's about this slow on oscilloscope screen. As a nice touch, the patched firmware also shows "Remote control" banner on the screen while it is controlled by app, while with old firmware you'll have the scope screen frozen.
The app can be downloaded from https://github.com/anarsoul/hanteker/actions/runs/47254437098#artifacts - you'll need to log in to download the artefacts. This particular build will be up for 90 days. I will publish a release when I decide it is ready. You can also check https://github.com/anarsoul/hanteker/actions click on the latest workflow, and click on artefacts
Windows (sigh) will need WinUSB drivers installed, use https://zadig.akeo.ie/ for that. Linux and Mac works fine without any drivers. Linux may need udev rule installed to get you permissions for the device. Otherwise you'll have to run it as root (please don't)
Now, the firmware. I cannot attach the patched firmware here, so you'll have to cook it yourself. The repository [1] has the patcher. It needs HantekHTX2021090901.dfu as an input and produces build/hanteker.dfu which can be flashed using standard tool from Hantek. On Linux or Mac you can use dfu-util or this script [2] to flash it. To enter DFU mode hold "F1" while powering on the scope. As usual, make a backup of your current firmware - the script allows you to do that, so does Windows tool from Hantek.
The firmware doesn't touch original bootloader, so you can always revert to the old firmware if you want to. However the patched firmware doesn't introduce any incompatibilities - it should work fine even with original Hantek software.
Shoot me a DM if you want a patched binary.
The project is based on original Hanteker [3], and I am working on merging my changes there.
Any feedback is welcome.
[1] https://github.com/anarsoul/hanteker/tree/develop/firmware
[2] https://github.com/anarsoul/hanteker/blob/develop/firmware/patch.py
[3] https://github.com/hkoosha/hanteker
