OpenHantek / openhantek

OpenHantek is a DSO software for Hantek (Voltcraft/Darkwire/Protek/Acetech) USB digital signal oscilloscopes
http://openhantek.org/
GNU General Public License v3.0
763 stars 199 forks source link

Hantek 6022BE: extract firmware fails #253

Open waljoh opened 6 years ago

waljoh commented 6 years ago

Have spent four (and counting) or more days attempting to get 6022BE up on Linux/Ubuntu, trying it seems nearly every branch and variant of the OpenHantek project. There is unfortunately a lot of assumed knowledge that an entrant into the game needs to magically acquire!

As everyone but me knows, it seems:

The common point of failure with every version of 'extractfw' is that it fails returning zero offset, e.g

Section .data found (starting at 0x1180, 10144 bytes) Symbol _firmware found (offset 0xffffffffffffee80, 0 bytes) Symbol _loader found (offset 0xffffffffffffee80, 10144 bytes) Can't get firmware contents: Bad value

0xff...ffee80 is negative 0x1180. The software does not work with the Hantek windows drivers. This just from what appears to be a recent (openhantek-master) branch.

Tried about 5 different branches of openhantek, drivers from Hantek, the CD, different h/w, and upgraded from Ubuntu 16.04 to 18.04 - all with same or similar results. This is not new, many reports, but no solutions.

The driver works on Windows 10, but it looks as if the symbols that extractfw are looking for have been removed (to prevent extraction?).

openhantek-2017-12 is the nearest I have got. The program is finding the device, then attempting an upload, before reporting a failure and then terminating with a core dump. This is the state of play on the screen dump below.

On a subsequent run it is detecting that the scope has been initiallised, does not attempt an upload, but terminates without any report.

Another version (don't ask which branch) loads and runs (without the firmware?), but does not see the scope.

Stuck and frustrated, but surely someone knows the answer?

screenshot from 2018-08-10 21-59-00

crabdancing commented 6 years ago

Wait, why was this closed!? I want to know more about this extractfw nonsense! I have a scope I'd like to try to add support for. What happened?

waljoh commented 6 years ago

Hello Alexandria,

I closed it as I finally found something that worked.. for me at any rate.

I suppose that the symbols that extractfw looks for have been removed from the Hantek Windows drivers, as every version of extractfw, its predecessors or derivatives, that I found failed in exactly the same way, resulting in no file being created.

However the branch of OpenHantek that you get from downloading the .zip (and no doubt the .tar) from the header page (http://www.openhantek.org) will work, (while the download from GitHub linked on the same page did not help me. ) This is https://codeload.github.com/OpenHantek/openhantek/legacy.zip/master resulting in a file OpenHantek-openhantek-7862387(2).tar.gz.

If you extract the files from this, you will find the rules file under the firmware subdirectory, and under openhantek/res/firmware are the necessary firmware and loader files for the supported DSO's. However if you follow the build instructions and "sudo make install" the software manages to put these files in the correct places. You do not need extractfw and its frustrations. The usb connects, and when the software is loaded and starts, it checks for the firmware on the device, and if not present it will install the firmware. A red light flashes, and turns green when operational on the 6022BE. This remains in situ until the device is switched off or disconnected.

I now have had the system built and running on a recent Dell Vostro running under Ubuntu 18.04 and also on an old Dell 32 bit laptop running Mint 19.04, but with the latter it took a while to get the necessary software downloaded, (I was fumbling about with Graphics software that I did not understand) and it needs to be configured to run with GLES ( command: OpenHantek --useGLES) in order to work.

In order to assemble the necessary software to build, the most helpful source is not in the documentation supplied, but its equivalent in a different version (I am not sure of the provenance, I downloaded 10 or more different versions in the process) where the specific installation instructions are given for linux (and Mac and Windows) - attached.

I had a nightmare and must delete the 20 or so downloads that I explored.. some being duplicates. I rejected this option early on as I had problems finding the right software and moved on. It may be OK for the initiated, but someone needs to have a good purge of the stables.

Now all that remains is to work out how to use the software effectively!. I don't know if anyone has written down how it is supposed to be used? In my limited testing it appears to set its own window, presumably by analysing the waveform, and the zoom allows you to expand this by control of the cursors. But I have limited signal sources from which to judge it. I thought you should be able to scroll backwards and forwards through the sample?

ATB

John readme_md.txt

bikermikem commented 6 years ago

I have it running on a pi 3.

crabdancing commented 6 years ago

I do need extractfw because I wanted to try to extract firmware for my DSO5202P. :(

But I am glad you got a solution that works for you, at least! Best wishes.

kschoelpple commented 6 years ago

Hi, I also experienced same problem with red LED flashing, also message: "DSO-6022BE:Firmware upload failed" after clicking on that I get also: "A device was found, but the firmware upload seem to have failed or the connection could not be established:" I am running KUbuntu 18.04.1 Kernel 4.15.0-32 Hantek 6022BE

Also tried different download files and noticed difference in firmware folders. On those downloads I get " Policy "CMP0072" is not known to this version of CMake." After executing command cmake ../

waljoh commented 6 years ago

Kschoelpie

Without understanding the nuts and bolts, the red light flashing signifies that something has been downloaded to the device to initialise it.. a good sign, but if the process does not complete not much use.

If you follow the instructions I posted above and use the download version, you should get something to work.

I had the Policy CMP0072 problem as well, but don't remember how I overcame it . At one point I commented out the line to get around it.

kschoelpple commented 6 years ago

Hi, after spending a few hours on it I got finally a result similar to waljoh: -Connect Hantek device

suisseWalter commented 5 years ago

thank alot for this post, it worked well for me. the policy CMP0072 problem exsisted aswell. I simply solved it by commenting the 4th line in the cmakeLists.list (cmake_policy(SET CMP0072 NEW)) and then it compiled flawless and works great now. thanks alot

btbars commented 5 years ago

i restart from scratch, the soft is launching, i think it can be usefull so i share exactly what i done ( tested on ubuntu 18.04, hantek 6022BE )

sudo apt update && sudo apt install g++ cmake qttools5-dev qttools5-dev-tools libfftw3-dev binutils-dev libusb-1.0-0-dev libqt5opengl5-dev mesa-common-dev libgl1-mesa-dev libgles2-mesa-dev
cd /tmp ; wget https://codeload.github.com/OpenHantek/openhantek/legacy.zip/master -O openhantek.zip
unzip openhantek.zip && cd OpenHantek-openhantek-*
sed -i '/CMP0072/d' CMakeLists.txt
mkdir -p build && cd build
cmake ../
make -j
sudo make install
#may be necessary ?
sudo rsync -av firmware/60-hantek.rules /lib/udev/rules.d/

/usr/local/bin/OpenHantek -v
OpenHantek 16.11.2018_na

i needed to reboot in order everythings works

suisseWalter commented 5 years ago

so you get the same window as waljoh in the first post here? and it then crashes on the second launch(....cpu core dumped....)?

btbars commented 5 years ago

i've got the core dumped you are talking about but i retried from scratch (see full procedure just above ) and after a reboot now EVERYTHING IS WORKING  \o/

mwette commented 5 years ago

Hi All,

I have a DSO5072 on Ubuntu 18.04 and tried to run the FirmwareExtractor. I got

mwette$ ./FirmwareExtractor dso5kp_func_dso5072p20190125.up 
bfd_check_format: File format not recognized

Then tried

mwette$ file dso5kp_func_dso5072p20190125.up 
dso5kp_func_dso5072p20190125.up: GPG symmetrically encrypted data (CAST5 cipher)

to deduce that it's not working because the firmware file is encrypted. Maybe a change in firmware files. I have installed the software but I just get OpenHantek did not find any compatible devices. I'll dig a little more.