This groups the source cleanups and tooling/docs fixes that were applied after the original cleanup. The two changes in CMakeLists.txt were committed as a separate topic. Source cleanup: - Drop unused VERBOSE macros and duplicate/dead includes across dsosettings, glscope, hantekdso models, triggering, mainwindow. - Replace the global verboseLevel with per-object verbosity (mainwindow, selectdevice, and usb code: ezusb, finddevices, scopedevice, uploadFirmware). - Remove duplicate QCoreApplication include in scopedevice.cpp. - Drop unused images and orphaned UI actions (mainwindow.ui). - Regenerate translation location line numbers after the above changes (9 .ts files). The content strings are mostly unchanged. Build and docs: - Re-enable the MinGW (MSYS2, UCRT64) Windows build. Use the shared Qt6 runtime and copy it next to the exe with windeployqt (portable zip). This replaces the commented-out MinGW job that used the vanished mingw-w64-x86_64-qt6-static and produced the misnamed _mingw_amd64 artifacts (fixes #437). - Keep the CMake CMAKE_CONFIGURE_DEPENDS for git state separate. - Document both Windows packages (MSVC and MinGW) and correct the dead build_check.yml links to build.yml in README.md and docs/build.md. Signed-off-by: Martin Homuth-Rosemann <Ho-Ro@users.noreply.github.com>
13 KiB
Linux
For Debian (stretch and newer), Ubuntu 17.04+ and Mint 17+ and other deb based distributions install named requirements like this:
apt install g++ make cmake fakeroot rpm qt6-tools-dev libfftw3-dev binutils-dev libusb-1.0-0-dev libqt6opengl6 mesa-common-dev libgl1-mesa-dev libgles2-mesa-dev qt6-base-dev
For distributions using dnf package manager (Fedora 21+) use this command:
dnf install make cmake fakeroot gcc-c++ qt6-qtbase-gui qt6-qttools-devel qt6-qttranslations fftw-devel binutils-devel libusb-devel mesa-libGL-devel mesa-libGLES-devel
For OpenSUSE and related distributions use this command
zypper install make cmake fakeroot gcc-c++ libqt6-qtbase libqt6-qttools libqt6-qttranslations libusb-1_0 Mesa-libGL1 Mesa-libGLESv2 fftw3
The script LinuxSetup_AsRoot installs all build requirements automatically.
After you've installed the requirements run the following commands inside the directory of this package:
mkdir build
cd build
cmake ..
make -j4
or execute the script LinuxBuild that configures the build, builds the binary and finally creates the packages (deb, rpm and tgz) that can be installed as described in the next paragraphs.
If you make small changes to the local source code, it is sufficient to call make -j4 or make -j4 package in the build directory.
After success you can test the newly built program openhantek/OpenHantek.
Due to the included debug information this file is quite big (~20 MB), but the size can be reduced with strip openhantek/OpenHantek if you want to put it into a user directory.
If you do not install the program, you need to copy the file utils/udev_rules/60-openhantek.rules to /etc/udev/rules.d/ yourself,
and replug your device, otherwise you will not have the correct USB permissions to access the device.
You can install the program with sudo make install, but it is highly recommended to create a debian package,
which allows a clear installation and removal of the package:
rm -f packages/*
fakeroot make -j4 package
sudo apt install ./$(ls packages/openhantek_*.deb | tail -1)
If you detect that icons are not displayed correctly, please check if the Qt SVG library is installed on your system.
The Linux systems mentioned above include this lib when you install according to the provided lists.
However, an alpine linux user reported that he had to install qt5-qtsvg separately.
CI Build on GitHub Actions
The local build and test is done on an up-to-date Debian stable; on every push a building process is run externally by GitHub Actions who provides these Ubuntu 2004 environments. Please check also the file build.yml for info about the building process.
RaspberryPi
The general Linux requirements from above also apply to the RPi; precompiled packages are available as release assets.
Please note, it is important that the correct graphics driver is selected,
the OpenGL implementation of Qt requires the Original non-GL desktop driver, e.g. on my RPi3B+:
sudo raspi-config
Only the 1st setting G1 Legacy Original non-GL desktop driver worked for OpenHantek6022, the other two resulted in an error as below:
QEGLPlatformContext: eglMakeCurrent failed: 3009
QOpenGLFunctions created with non-current context
Setting Original non-GL desktop driver was reported to work also on RPi4B+.
FreeBSD
Install the build requirements
pkg install cmake qt6 fftw3 linux_libusb
After you've installed the requirements run the following commands inside the directory of this package:
mkdir build
cd build
cmake ..
make -j4
After success you can test the newly built program openhantek/OpenHantek.
Due to the included debug information this file is quite big (~20 MB), but the size can be reduced with strip openhantek/OpenHantek if you want to put it into a user directory.
In order for OpenHantek to work, make sure that your USB device has permissions for your user.
You can achieve this by copying utils/devd_rules_freebsd/openhantek.conf
to /usr/local/etc/devd/, or create a file with similar content for your device:
...
# Hantek DSO-6022BE
notify 100 {
match "system" "USB";
match "subsystem" "DEVICE";
match "type" "ATTACH";
match "vendor" "0x04b4";
match "product" "0x6022";
action "chgrp openhantek /dev/$ugen; chmod g+rw /dev/$ugen; chgrp -h openhantek /dev/$ugen; chmod -h g+rw /dev/$ugen";
};
notify 100 {
match "system" "USB";
match "subsystem" "DEVICE";
match "type" "ATTACH";
match "vendor" "0x04b5";
match "product" "0x6022";
action "chgrp openhantek /dev/$ugen; chmod g+rw /dev/$ugen; chgrp -h openhantek /dev/$ugen; chmod -h g+rw /dev/$ugen";
};
...
- The "action" above doesn't use $device-name due to: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242111
Also please note that devices like this have two vendor/product id combinations, before and after loading the firmware, hence two commands above. The action changes the device permissions for supported scope devices:
rw------- root operator becomes rw-rw---- root openhantek
Make sure to be member of the group openhantek, e.g.:
pw groupadd openhantek -g 6022
pw groupmod openhantek -M <YOUR_USER>
macOS
Building should work on macOS 11 and newer, including Apple Silicon Macs.
We recommend homebrew to install the required libraries.
brew update
brew install libusb fftw qt6 cmake binutils create-dmg
If you want to build an OSX bundle make sure the option in openhantek/CMakeLists.txt is set accordingly:
option(BUILD_MACOSX_BUNDLE "Build MacOS app bundle" ON)
After you've installed the requirements run the following commands inside the top directory of this package:
mkdir -p build
rm -rf build/*
cd build
cmake ..
#
make -j4
#
# now the target was created in subdir openhantek
# .. either as single binary OpenHantek, then you're done
# .. or as a bundle if enabled in ../../openhantek/CMakeLists.txt
# .. but this bundle is still a template as the dynlibs are not yet bundled
# .. this magic will happen now
#
cd openhantek
#
# deploy all necessary Qt dynlibs into the bundle
macdeployqt OpenHantek.app -always-overwrite -verbose=2
#
# Re-sign the app after macdeployqt modifies the bundle
# Required on Apple Silicon, recommended on Intel Macs with macOS 11+
xattr -cr OpenHantek.app
codesign --force --deep --sign - OpenHantek.app
#
# Verify the signature (optional but recommended)
codesign --verify --deep --strict OpenHantek.app
#
# finally create OpenHantek.dmg from OpenHantek.app
create-dmg --volname OpenHantek --volicon ../../openhantek/res/images/OpenHantek.icns --window-pos 200 120 \
--window-size 800 400 --icon-size 100 --icon "OpenHantek.app" 200 190 --skip-jenkins \
--hide-extension "OpenHantek.app" --app-drop-link 600 185 --eula ../../LICENSE OpenHantek.dmg OpenHantek.app
#
This code proposal is based on the info from @warpme about building on macOS 11.6.8 + Xcode 12.4 (12D4e). Code signing steps added for Apple Silicon compatibility (hint from alwaysEpic).
CI Build on GitHub Actions
As I do not use macOS for development the building is done externally by GitHub Actions who provides these macOS 11 environments. Please check also the file build.yml for info about the building process.
Windows
We highly recommend to use QtCreator to build this software. All reported issues regarding other IDEs will be closed as invalid!
- Open the project in QtCreator
- Compile the software
Hints for Visual Studio 2015/2017/2019 users:
- Install the right Qt package that matches your Visual Studio installation.
- Build for 64bit. 32bit builds theoretically work, but you are on your own then.
- Use the CMake GUI to setup all required Qt include and library paths.
CI Build on GitHub Actions
As I do not use Windows for development the building is done externally by GitHub Actions who provides these Windows environments. Please check also the file build.yml for info about the building process with either MINGW or MSVC. Starting with the update to Visual Studio 2019 only 64bit builds are provided.
Two different Windows builds are produced, both packaged as a self-contained zip:
*_msvc_x64.zip- built with Visual Studio against a shared Qt6, the shipped*.dllfiles have to stay next toOpenHantek.exe.*_mingw_x64.zip- built with GCC/MSYS2 on the UCRT64 environment and packaged with a portable Qt6 runtime next to the exe. Unpack and startOpenHantek.exe.
Signed WinUSB driver for Hantek 6022BE/BL
-
The signed
.inffileOpenHantek.inffor all devices - provided by VictorEEV and updated by gitguest0 - is available in theopenhantek_xxx_win_x64.zipbinary distribution in directorydriver. -
Right-click on
OpenHantek.infand select "install" from the pull-down menu. -
The Device Manager will show (under "Universal Serial Bus devices") the name and state according to the firmware loaded (e.g.
Hantek 6022BE - Loader,Hantek 6022BE - OpenHantek). The PulseView/sigrok-cli firmware is also recognized (e.g.Hantek 6022BE - Sigrok).
Microsoft Windows USB driver install (with Zadig)
It is highly recommended to use the .inf file, but it is also possible to alternatively use the Zadig tool
and follow the good step-by-step tutorial provided by DaPa.
For installing the WinUSB driver you can use the Zadig executable. There are two versions, one for Windows XP (zadig_xp.exe), and another one for all other (Vista or higher) supported Windows versions (zadig.exe). Both 32 and 64 bit Windows versions are supported.
If you already installed the vendor driver previously, you need to run Zadig and switch to the WinUSB driver (see above). There's no need to uninstall or deactivate the vendor driver manually, Zadig will handle all of this.
Note: For Hantek 6022BE and 60222BL you have to assign the WinUSB driver via Zadig twice: the first time for the initial USB VID/PID the device has when attaching it via USB, and a second time after the firmware has been uploaded to the device and the device has "renumerated" with a different VID/PID pair.
See also the Zadig wiki page for more information.
- 1st install for the newly plugged scope without firmware (VID/PID 04B4/6022 for 6022BE or VID/PID 04B4/602A for 6022BL).
- 2nd time for the scope with firmware uploaded (VID/PID 04B5/6022 for 6022BE or VID/PID 04B5/602A for 6022BL).
Some win user reports:
- black2279's wiki entry USB Drivers Installation with Zadig for Hantek 6022 (Windows)
- raxis13's success report


