Using Sigrok on Hantek 4032L - Page 1
Forum section: electronics / testgear

author: dexters_lab
author_rank: Unknown
timestamp: April 09, 2018, 03:03:49 pm
content: Does anyone have any experience getting Sigrok to work with the Hantek 4032L logic analyser on Windows 7no matter how much fiddling i do with zdiag, pulseview etc i can't get it to show up in the device listthe Hantek software works okany ideas?

author: Daruosha
author_rank: Regular Contributor
timestamp: April 09, 2018, 07:37:03 pm
content: Just out of curiosity: Does it work with Saleae Loginc software?

author: dexters_lab
author_rank: Unknown
timestamp: April 10, 2018, 08:03:23 am
content: Their website says the hantek is supported

author: Daruosha
author_rank: Regular Contributor
timestamp: April 10, 2018, 10:49:46 am
content: Quote from: dexters_lab on April 10, 2018, 08:03:23 amI doubt the 32 channel version works with Saleae Login, Does Saleae even support 32 channels?

author: abyrvalg
author_rank: Frequent Contributor
timestamp: April 10, 2018, 11:12:52 am
content: Not sure is this relevant to your Win7 case or not (I have Win8.1 x64), but I've tried today's PulseView version and it works:Install PulseViewRun bundled ZadigCheck Options->List all devicesSelect 4032L in device listDriver -> WinUSB (v6.1.7600.16385)Install driverRun PulseView - it shows Hantek 4032L selected immediatelyCheck the driver type/version of 4032L in Device Manager before and after Zadig - it should change from ODM/hieroglyphs to libwdi.Anyway, the support level from Sigrok is very basic at this moment, I would say it is a "Work in progress" rather than "Supported", but they work on 4032L (I'm taking part in some testing), hope to see more features soon.Btw, Hantek doesn't advertise that, but they are releasing firmware updates for 4032L (you need to mail to their support to get one). I've got an FPGA update that enabled external clocking on my old unit.

author: dexters_lab
author_rank: Unknown
timestamp: April 10, 2018, 12:01:29 pm
content: Quote from: abyrvalg on April 10, 2018, 11:12:52 amthanks, i have been through the zadig steps but nothing shows in the pulseview app, pictures attached...i don't know what 'ODM/hieroglyphs' are, sorry!is there a specific forum or place to go and get some help?

author: abraxa
author_rank: Frequent Contributor
timestamp: April 10, 2018, 01:51:10 pm
content: It's unfortunate that you're running into these issues and I wish I could provide assistance but I neither possess a Hantek device nor do I use PV on Windows, so I can only guess at this point. The best way to tell what PV is doing is to run pulseview.exe from the command line with the "-l 5" parameter and showing us the logs (Settings->Logging) after you attempted to scan for your device. (We'll create a shortcut in the start menu for this in the future.)As for support, we have several ways to reach us: mailing list (https://lists.sourceforge.net/lists/listinfo/sigrok-devel), google+ (https://plus.google.com/communities/109843678338531936878) and IRC (http://webchat.freenode.net/?channels=%23sigrok&uio=MT1mYWxzZQ9a).The mailing list is easiest but slowest while IRC is less convenient for those not used to IRC but certainly the quickest way to get a response.

author: Andy99
author_rank: Contributor
timestamp: April 24, 2018, 06:24:39 pm
content: I am one of the 4032l@sigrok developers. You can use changes from last commits of libsigrok. I don't know, if they added those changes into last libsigrok release. Of course, You can build it by yourself. If you are not able to do it, I can support you as well.Andy

author: dexters_lab
author_rank: Unknown
timestamp: April 24, 2018, 07:13:23 pm
content: thanks Andy99 and to abraxai have actually stopped using the hantek at the moment and instead i am using some USB/RS232 converters which is actually a better solution for me anywayi don't have a clue about building software i am afraid, it might be better if i just download the latest version when i next come to use the hantekthank you for the efforts in getting sigrok working on the hantek BTW, the original hantek software is bloody awful! I have long been hoping for some alternative.

author: Uwe Hermann
author_rank: Contributor
timestamp: April 24, 2018, 08:04:59 pm
content: Hi, the fixes by Andy99 (affected all Windows and some Linux systems) are merged indeed, and already available in the latest Windows installers we provide. I just downloaded the PulseView installer 5 minutes ago and did a few quick tests on Windows 10, 64bit, everything seems to work fine.https://sigrok.org/wiki/DownloadsCheers!

author: dexters_lab
author_rank: Unknown
timestamp: April 24, 2018, 08:17:24 pm
content: Quote from: Uwe Hermann on April 24, 2018, 08:04:59 pmthanks, i'll give it another try when i get a chance

author: dexters_lab
author_rank: Unknown
timestamp: April 25, 2018, 07:30:46 am
content: i just took a few moments to re-install and still no lucklike before i have run Zadig and installed the driver but still no device shows in Pulseviewi've attached some screens and a log from pulseview, hopefully you can spot something?Code:sr: backend: libsigrok 0.6.0-git-2bd5d17/4:0:0 (rt: 0.6.0-git-2bd5d17/4:0:0).sr: backend: Libs: glib 2.50.2 (rt: 2.50.2/5002:2), libzip 1.1.3, libserialport 0.1.1/1:0:1 (rt: 0.1.1/1:0:1), libusb-1.0 1.0.20.11003-rc3, libftdi 1.2.sr: backend: Host: i686-w64-mingw32.static.posix, little-endian.sr: backend: SCPI backends: TCP, serial, USBTMC.sr: backend: Firmware search paths:sr: resource: SIGROK_FIRMWARE_DIR environment variable not set, ignoring.sr: backend: - C:\Users\DELETED\AppData\Local\sigrok-firmwaresr: backend: - C:\ProgramData\sigrok-firmwaresr: backend: - C:\Users\Public\Documents\sigrok-firmwaresr: backend: - C:\Program Files (x86)\sigrok\PulseView\share\sigrok-firmwaresr: backend: - C:\Program Files (x86)\sigrok\PulseView\share\sigrok-firmwaresr: backend: Sanity-checking all drivers.sr: backend: Sanity-checking all input modules.sr: backend: Sanity-checking all output modules.sr: backend: Sanity-checking all transform modules.srd: libsigrokdecode 0.6.0-git-cb67584/4:0:0 (rt: 0.6.0-git-cb67584/4:0:0).srd: Libs: glib 2.50.2 (rt: 2.50.2/5002:2), Python 3.4.4 / 0x30404f0 (API 1013, ABI 3).srd: Host: i686-w64-mingw32.static.posix, little-endian.srd: Initializing libsigrokdecode.srd: Adding 'C:\Program Files (x86)\sigrok\PulseView\share\libsigrokdecode\decoders' to module path.srd: Adding 'C:\Program Files (x86)\sigrok\PulseView\share\libsigrokdecode\decoders' to module path.srd: Protocol decoder search paths: - C:\Program Files (x86)\sigrok\PulseView\share\libsigrokdecode\decoders - C:\Program Files (x86)\sigrok\PulseView\share\libsigrokdecode\decoderssrd: Python system search paths: - C:\Program Files (x86)\sigrok\PulseView\share\libsigrokdecode\decoders - C:\Program Files (x86)\sigrok\PulseView\share\libsigrokdecode\decoders - C:\Program Files (x86)\sigrok\PulseView\python34.zip - C:\Program Files (x86)\sigrok\PulseView\DLLs - C:\Program Files (x86)\sigrok\PulseView\lib - C:\Program Files (x86)\sigrok\PulseViewsr: hwdriver: Scan found 0 devices (asix-sigma).sr: hwdriver: Scan found 0 devices (chronovu-la).sr: hwdriver: Scan found 1 devices (demo).sr: hwdriver: Scan found 0 devices (dreamsourcelab-dslogic).sr: hwdriver: Scan found 0 devices (ftdi-la).sr: hwdriver: Scan found 0 devices (fx2lafw).sr: hwdriver: Scan found 0 devices (gwinstek-gds-800).sr: hwdriver: Scan found 0 devices (hameg-hmo).sr: hwdriver: Scan found 0 devices (hantek-4032l).sr: hwdriver: Scan found 0 devices (hantek-6xxx).sr: hwdriver: Scan found 0 devices (hantek-dso).sr: hwdriver: Scan found 0 devices (ikalogic-scanalogic2).sr: hwdriver: Scan found 0 devices (ikalogic-scanaplus).sr: hwdriver: Scan found 0 devices (lecroy-logicstudio).sr: hwdriver: Scan found 0 devices (lecroy-xstream).sr: hwdriver: Scan found 0 devices (ols).sr: hwdriver: Scan found 0 devices (p-ols).sr: hwdriver: Scan found 0 devices (rigol-ds).sr: hwdriver: Scan found 0 devices (saleae-logic-pro).sr: hwdriver: Scan found 0 devices (saleae-logic16).sr: hwdriver: Scan found 0 devices (siglent-sds).sr: hwdriver: Scan found 0 devices (sysclk-lwla).sr: hwdriver: Scan found 0 devices (yokogawa-dlm).sr: hwdriver: Scan found 0 devices (zeroplus-logic-cube).sr: device: demo: Opening device instance.sr: hwdriver: sr_config_list(): key 30002 (pattern) sdi 01942E60 cg A0 -> ['square', 'sine', 'triangle', 'sawtooth']sr: hwdriver: sr_config_get(): key 30002 (pattern) sdi 01942E60 cg A0 -> 'square'sr: hwdriver: sr_config_list(): key 30002 (pattern) sdi 01942E60 cg A1 -> ['square', 'sine', 'triangle', 'sawtooth']sr: hwdriver: sr_config_get(): key 30002 (pattern) sdi 01942E60 cg A1 -> 'sine'sr: hwdriver: sr_config_list(): key 30002 (pattern) sdi 01942E60 cg A2 -> ['square', 'sine', 'triangle', 'sawtooth']sr: hwdriver: sr_config_get(): key 30002 (pattern) sdi 01942E60 cg A2 -> 'triangle'sr: hwdriver: sr_config_list(): key 30002 (pattern) sdi 01942E60 cg A3 -> ['square', 'sine', 'triangle', 'sawtooth']sr: hwdriver: sr_config_get(): key 30002 (pattern) sdi 01942E60 cg A3 -> 'sawtooth'sr: hwdriver: sr_config_list(): key 30002 (pattern) sdi 01942E60 cg Logic -> ['sigrok', 'random', 'incremental', 'walking-one', 'walking-zero', 'all-low', 'all-high', 'squid']sr: hwdriver: sr_config_get(): key 30002 (pattern) sdi 01942E60 cg Logic -> 'sigrok'sr: hwdriver: sr_config_get(): key 50001 (limit_samples) sdi 01942E60 cg NULL -> uint64 0sr: hwdriver: sr_config_set(): key 50001 (limit_samples) sdi 01942E60 cg NULL -> uint64 1000000sr: hwdriver: sr_config_get(): key 50001 (limit_samples) sdi 01942E60 cg NULL -> uint64 1000000sr: hwdriver: sr_config_list(): key 30000 (samplerate) sdi 01942E60 cg NULL -> {'samplerate-steps': }sr: hwdriver: sr_config_get(): key 30000 (samplerate) sdi 01942E60 cg NULL -> uint64 200000sr: hwdriver: sr_config_list(): key 30000 (samplerate) sdi 01942E60 cg NULL -> {'samplerate-steps': }sr: hwdriver: sr_config_get(): key 30000 (samplerate) sdi 01942E60 cg NULL -> uint64 200000sr: hwdriver: sr_config_list(): key 30002 (pattern) sdi 01942E60 cg A0 -> ['square', 'sine', 'triangle', 'sawtooth']sr: hwdriver: sr_config_get(): key 30002 (pattern) sdi 01942E60 cg A0 -> 'square'sr: hwdriver: sr_config_list(): key 30002 (pattern) sdi 01942E60 cg A1 -> ['square', 'sine', 'triangle', 'sawtooth']sr: hwdriver: sr_config_get(): key 30002 (pattern) sdi 01942E60 cg A1 -> 'sine'sr: hwdriver: sr_config_list(): key 30002 (pattern) sdi 01942E60 cg A2 -> ['square', 'sine', 'triangle', 'sawtooth']sr: hwdriver: sr_config_get(): key 30002 (pattern) sdi 01942E60 cg A2 -> 'triangle'sr: hwdriver: sr_config_list(): key 30002 (pattern) sdi 01942E60 cg A3 -> ['square', 'sine', 'triangle', 'sawtooth']sr: hwdriver: sr_config_get(): key 30002 (pattern) sdi 01942E60 cg A3 -> 'sawtooth'sr: hwdriver: sr_config_list(): key 30002 (pattern) sdi 01942E60 cg Logic -> ['sigrok', 'random', 'incremental', 'walking-one', 'walking-zero', 'all-low', 'all-high', 'squid']sr: hwdriver: sr_config_get(): key 30002 (pattern) sdi 01942E60 cg Logic -> 'sigrok'sr: hwdriver: sr_config_get(): key 50001 (limit_samples) sdi 01942E60 cg NULL -> uint64 1000000sr: hwdriver: sr_config_list(): key 30000 (samplerate) sdi 01942E60 cg NULL -> {'samplerate-steps': }sr: hwdriver: sr_config_get(): key 30000 (samplerate) sdi 01942E60 cg NULL -> uint64 200000sr: hwdriver: Scan found 0 devices (hantek-4032l).sr: hwdriver: Scan found 0 devices (hantek-4032l).sr: hwdriver: Scan found 0 devices (hantek-4032l).sr: hwdriver: sr_config_list(): key 30002 (pattern) sdi 01942E60 cg A0 -> ['square', 'sine', 'triangle', 'sawtooth']sr: hwdriver: sr_config_get(): key 30002 (pattern) sdi 01942E60 cg A0 -> 'square'sr: hwdriver: sr_config_list(): key 30002 (pattern) sdi 01942E60 cg A1 -> ['square', 'sine', 'triangle', 'sawtooth']sr: hwdriver: sr_config_get(): key 30002 (pattern) sdi 01942E60 cg A1 -> 'sine'sr: hwdriver: sr_config_list(): key 30002 (pattern) sdi 01942E60 cg A2 -> ['square', 'sine', 'triangle', 'sawtooth']sr: hwdriver: sr_config_get(): key 30002 (pattern) sdi 01942E60 cg A2 -> 'triangle'sr: hwdriver: sr_config_list(): key 30002 (pattern) sdi 01942E60 cg A3 -> ['square', 'sine', 'triangle', 'sawtooth']sr: hwdriver: sr_config_get(): key 30002 (pattern) sdi 01942E60 cg A3 -> 'sawtooth'sr: hwdriver: sr_config_list(): key 30002 (pattern) sdi 01942E60 cg Logic -> ['sigrok', 'random', 'incremental', 'walking-one', 'walking-zero', 'all-low', 'all-high', 'squid']sr: hwdriver: sr_config_get(): key 30002 (pattern) sdi 01942E60 cg Logic -> 'sigrok'sr: hwdriver: sr_config_get(): key 50001 (limit_samples) sdi 01942E60 cg NULL -> uint64 1000000sr: hwdriver: sr_config_list(): key 30000 (samplerate) sdi 01942E60 cg NULL -> {'samplerate-steps': }sr: hwdriver: sr_config_get(): key 30000 (samplerate) sdi 01942E60 cg NULL -> uint64 200000sr: resource: SIGROK_FIRMWARE_DIR environment variable not set, ignoring.

author: abyrvalg
author_rank: Frequent Contributor
timestamp: April 25, 2018, 12:34:59 pm
content: Strange. Check that your host controller is not NEC/Renesas (see the very beginning of this:https://github.com/libusb/libusb/wiki/Windows). Or try the other compatible driver from Zadig: libusbK.

author: Daruosha
author_rank: Regular Contributor
timestamp: May 21, 2018, 05:59:40 am
content: I can confirm that the Hantek 4032L works beautifully with sigrok (on both Windows and Mac OSX) and i tossed the official (crap) software.

author: dexters_lab
author_rank: Unknown
timestamp: May 21, 2018, 07:51:17 am
content: i never managed to get mine to work

author: maginnovision
author_rank: Super Contributor
timestamp: May 21, 2018, 06:44:11 pm
content: I got mine to work as well, but windows 10. If only sigrok didn't crash on high memory sampling, and decoding it'd be ok. Still lose advanced trigger setup compared to the original software. If I weren't using 4k screens EVERYWHERE I would just use the hsntek software. It's not perfect but does what I'd need if I could see the data.

author: dexters_lab
author_rank: Unknown
timestamp: May 22, 2018, 06:25:53 am
content: in frustration i tried it on my old Win7 laptop yesterday and it does work so i do have a working option, there must be something on my main system it doesn't like

author: Alexel
author_rank: Newbie
timestamp: August 31, 2018, 07:18:23 pm
content: Hi Guys.I need to use a trigger in the Hantek 4032L to start the capture, but the current version of PV does not allow this.I thought to solve this problem using sigrok-cli, but I can not start the capture.Tried different options, for example such -Code:sigrok-cli --loglevel 3 --driver hantek-4032l --config 'samplerate = 10MHz: limit_samples = 2048: continuous = off: triggermatch = e: captureratio = 5' --output-file test1.srI understand that there are not enough parameters, for example the channel number for the trigger, but I do not understand how to describe it.Could you give an example of running sigrok-cli using a trigger.Thank you!

author: abraxa
author_rank: Frequent Contributor
timestamp: September 01, 2018, 05:25:15 am
content: Quote from: Alexel on August 31, 2018, 07:18:23 pmPV does not allow... what exactly? What does "current version" mean to you?Quote from: Alexel on August 31, 2018, 07:18:23 pmFrom the sigrok-cli manpage:Code:-t, --triggers <triggerlist>A comma-separated list of triggers to use, of the form <channel>=<trigger>. You can use the name or number of the channel, and the trigger itself is a series of characters:0 or 1: A low or high value on the pin.r or f: A rising or falling value on the pin. An r effectively corresponds to 01.e: Any kind of change on a pin (either a rising or a falling edge).Not every device supports all of these trigger types. Use the --show command to see which triggers your device supports.btw, I'm not really sure whether using spaces to separate the settings for --config is supported. In case your settings aren't honored, I'd try removing the spaces.

author: Alexel
author_rank: Newbie
timestamp: September 01, 2018, 11:46:14 am
content: Thanks for the answer!QuoteI meant the version that is available now for download athttps://www.sigrok.org/wiki/DownloadsCode:Windows:Nightly installer binaries:pulseview-NIGHTLY-32bit-static-release-installer.exe (debug build)sigrok-cli-NIGHTLY-32bit-static-release-installer.exe (debug build)Settings:After many experiments, I managed to get the working keys:sigrok-cli --loglevel 2 --driver hantek-4032l --config samplerate=50MHz --samples=1000000 --channels A0=D0,A1=CLK,A2=CMD --triggers CLK=e --output-file test1.srBut failed to set voltage_threshold, to the keyssigrok-cli --loglevel 2 --driver hantek-4032l --config "samplerate = 50MHz:voltage_threshold=2.5-2.5" -samples=1000000 --channels A0=D0,A1=CLK,A2=CMD --triggers CLK=e --output-file test1.crA message is displayed:Failed to set device option 'voltage_threshold': not applicable.From wiki page Hantek 4032L:Hardware features support status+ Buffered mode acquisition+ Sample depth selection+ Pretrigger depth selection+ Internal clocking (timing mode)+ External clocking (state mode) with edge (rising/falling/both) and clock channel (ACLK/BCLK) selection+ Logic voltage threshold selection (independent for Axx and Bxx channel groups, possible to analyze dual standrard circuits)+ Unconditional trigger+ Trigger on signal edge (rising/falling/any)+ Trigger on bus pattern match- Trigger on bus value within/out of range- Trigger on bus pattern condition (match/within/out of range) repeating for N consecutive sampleswhere N is equal/within range/out of range- Trigger on bus pattern condition at specific signal edge- Trigger on any of the above conditions combined with pattern match on the previous/current/next sample- Use two trigger units in AND/OR combination- External trigger input/output signalsBut thebiggestHUGE problem is the speed of saving data from the device's memory to a file when using sigrok-cli (PV downloads data from the device much faster). 1M samples are stored for approximately 1 minute. Thus, the whole memory of the device will be downloaded more than ONE HOUR!Can this be somehow corrected?

author: Carrington
author_rank: Super Contributor
timestamp: September 01, 2018, 12:50:43 pm
content: Hi Alexel, and welcome to the eevblog forum.QuoteI don't have a 4032L to try, but:Have you tried to do the same under Linux? If so, it also take so long?Could be an option import a csv file from the original hantek SW?Cheers.

author: Alexel
author_rank: Newbie
timestamp: September 01, 2018, 01:59:06 pm
content: Cheers, I do not have Linux installed to test your ideaThe format of the CVS file kept by Hantek software does not coincide with the format of the PV (manual change is required), but the file size of the CVS for 65M samples is approximately 1 GB

author: abyrvalg
author_rank: Frequent Contributor
timestamp: September 01, 2018, 03:46:56 pm
content: The trigger type you want (any edge) is selected by an icon near the signal name (left side) in PV.Updating FPGA firmware from V0 to anything higher speeds the things up (seehttps://www.eevblog.com/forum/testgear/hantek-4032l-firmware-update/).Cli is slower than PV on Linux too (single-threaded vs multi-threaded processing).

author: Andy99
author_rank: Contributor
timestamp: September 01, 2018, 05:12:10 pm
content: Hi Alexel,Could you please provide the FPGA version which are you using?Code:$ sigrok-cli -l 5 -d hantek-4032l --showsr: [00:00.014059] device: hantek-4032l: Opening device instance.sr: [00:00.082527] hantek-4032l: FPGA version: 0x4303. <-----Newer features are supported for version >0x0000.I have checked the voltage_threshold handling, there is no way to set this over sigrok-cli. Missing case in run_session@session.c. So setting this option is not bounded to FPGA version which you are using it.

author: Alexel
author_rank: Newbie
timestamp: September 01, 2018, 08:00:30 pm
content: QuoteExcuse me, I'm a loser!Did not pay attention to it.Before asking questions to the respected community, I read everything I could find on the issue that interests me. The firmware FPGA in the device was 0x4303, after the update (with utility) became 0x4304.Code:sr: [00:00.047000] device: hantek-4032l: Opening device instance.sr: [00:00.061000] hantek-4032l: FPGA version: 0x4304.I found a way out of the situation, which more or less works - save from sigrok-cli in vcd format, and then import into PV. In this case, you need to describe twice the channels in '--channels' (this is probably solved by the settings for importing vcd to PV, but I have not figured it out yet).And in case, if the samples are stored more than 50M, then the PV will crash.My keys to sigrok-cli:sigrok-cli --loglevel 2 --driver hantek-4032l --config samplerate=50MHz --samples=50000000 --channels A1=CLK,A2=CMD,A3=TMP0,A4=TMP1,A5=TMP2 --triggers CLK=e --output-format=vcd --output-file test2.vcd

author: abyrvalg
author_rank: Frequent Contributor
timestamp: September 03, 2018, 08:02:25 am
content: Why are you doing that cli-vcd-PV instead of capturing from PV directly?The maximum capture size for this LA is 64M (shown as 67108864 in PV’s list). The other bigger numbers in PV are bug, ignore them.

author: Alexel
author_rank: Newbie
timestamp: September 04, 2018, 06:49:37 pm
content: QuoteI need to use triggers, and in PV I did not find such a function until you told me.Now I'm using PV!10x