Author Topic: Sigrok and devices like the Hantek 6022BE: Continuous operation?  (Read 6011 times)

0 Members and 1 Guest are viewing this topic.

Offline WhalesTopic starter

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
Whilst reading about USB o-scopes and the sigrok project I had assumed that you could use such a setup to continuously stream data from the scope.  Eg record samples from an experiment continuously with sigrok-cli over the span of a few hours or more.

Yesterday I found out this was not the case -- I tried with a Rigol DS1000E series scope and found it only does single shots.  No info on the sigrok wiki seems to elude to this.

I have been trying to read the 6022BE mega-topic here on the forums.  I've found some discussions and arguments about continuous capabilities, but I'm finding it difficult to find concrete answers.

(1) Am I approaching this problem incorrectly?  Is a "USB oscilloscope" always limited to short captures and I'm actually after a different name/type of equipment?  [NB: student budget, not commercial] 

(2) Where do I find information about eg the Hantek 6022 BE's continuous capture capabilities?  Eg a list of sampling rates that it can sustain continuously over USB?



« Last Edit: April 20, 2018, 09:28:10 am by Whales »
 

Offline abraxa

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: de
  • Sigrok associate
Re: Sigrok and devices like the Hantek 6022BE: Continuous operation?
« Reply #1 on: April 20, 2018, 10:53:07 pm »
Whilst reading about USB o-scopes and the sigrok project I had assumed that you could use such a setup to continuously stream data from the scope.  Eg record samples from an experiment continuously with sigrok-cli over the span of a few hours or more.

You can, it just depends on the hardware and whether it supports streaming or not.

Yesterday I found out this was not the case -- I tried with a Rigol DS1000E series scope and found it only does single shots.  No info on the sigrok wiki seems to elude to this.

Which fact surprised you here? The fact that the Rigol isn't able to stream or the fact it's not mentioned on the wiki?

(1) Am I approaching this problem incorrectly?  Is a "USB oscilloscope" always limited to short captures and I'm actually after a different name/type of equipment?  [NB: student budget, not commercial] 

Depends. USB2 is rather slow and analog data doesn't compress well, so USB scopes that stream are rather bandwidth-limited. The situation is different for USB3 but I don't know of any streaming scopes there. The closest thing I do know would be the range of devices offered by Saleae.

(2) Where do I find information about eg the Hantek 6022 BE's continuous capture capabilities?  Eg a list of sampling rates that it can sustain continuously over USB?

I don't know whether the device supports this feature. Would definitely be nice to add to the libsigrok driver if it does.
 

Offline WhalesTopic starter

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
Re: Sigrok and devices like the Hantek 6022BE: Continuous operation?
« Reply #2 on: April 21, 2018, 01:19:41 am »
Quote
Which fact surprised you here? The fact that the Rigol isn't able to stream or the fact it's not mentioned on the wiki?

Both.

I see "continuous capture streaming" as the No. 1 defining feature of a USB scope.  Without this they would provide no advantage over a standalone scope that I can see, other than cost + size.

Am I wrong?  I've never bought one of these (eg a Hantek) before.  The fact I can't find any solid information on this is making me wary.

The ability to capture and stream data only for short intervals, as the Rigol USB support appears to do, is little different in my mind to saving a screenshot or data capture from the scope onto a memory stick.  The USB link to a PC is a live connection, there's zero point having it when you don't support any tasks more live than equivalent to saving onto a memory stick. 


Quote
Depends. USB2 is rather slow and analog data doesn't compress well, so USB scopes that stream are rather bandwidth-limited.

All good.  The theoretical limit of 480Mbit/s (60MB/s) is still a magnitude or more than what I actually need  (eg 100K samples/s * 8 bits = 100KB/s + overheads).

On the note of compressibility: it would be possible to make some cheap lossless reductions to be able to stream more than the link would be otherwise capable of.  Eg 4 bit deltas most of the time and then 8 bit raw samples when the value jumps by more than 4 bits.  Alas it would have nasty practical implications: if your data changed to a less compressible form during a live capture then you would get buffer overruns (holes).  So yeah, no to that   :)

Quote
The closest thing I do know would be the range of devices offered by Saleae.

Thanks, I'll have a look.

Quote
I don't know whether the device supports this feature. Would definitely be nice to add to the libsigrok driver if it does.

Apologies: are you saying that the libsigrock driver doesn't have continuous capture support for the Hantek 6022BE?

Given that sigrok-cli straight out told me the Rigol didn't support continuous capture (only when I tried to run it), I'll have a poke at the source and see what it says about what devices support it.
« Last Edit: April 21, 2018, 01:31:31 am by Whales »
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 8973
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Sigrok and devices like the Hantek 6022BE: Continuous operation?
« Reply #3 on: April 21, 2018, 01:48:20 am »
All good.  The theoretical limit of 480Mbit/s (60MB/s) is still a magnitude or more than what I actually need  (eg 100K samples/s * 8 bits = 100KB/s + overheads).
Use a sound card with a hacked front end?
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline WhalesTopic starter

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
Re: Sigrok and devices like the Hantek 6022BE: Continuous operation?
« Reply #4 on: April 21, 2018, 02:26:23 am »
All good.  The theoretical limit of 480Mbit/s (60MB/s) is still a magnitude or more than what I actually need  (eg 100K samples/s * 8 bits = 100KB/s + overheads).
Use a sound card with a hacked front end?

I was thinking of using a soundcard, but I need DC measurement.

Thanks for the idea.  I might try shorting some input caps out on some USB sound cards now :P  See how they fare.
« Last Edit: April 21, 2018, 02:28:01 am by Whales »
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 8973
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Sigrok and devices like the Hantek 6022BE: Continuous operation?
« Reply #5 on: April 21, 2018, 05:06:03 am »
Assuming it's not a black blob (the only blob type sound cards I have come across are limited to 48kHz with a rather bad SNR), find the datasheet for the ADC and it will tell you what its working input range is. Then design a front end and antialiasing filter using opamps.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline WhalesTopic starter

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
Re: Sigrok and devices like the Hantek 6022BE: Continuous operation?
« Reply #6 on: April 21, 2018, 07:31:02 am »
I had two cheap USB sound cards handy, both epoxied black-blob chip on board.  It turns out one was already dead, and the other applies AC coupling even if you bypass the input stage and inject directly into the chip.

Overall however, I'm after something that:
  • Doesn't require me to maintain the hardware (going to a home with more software-oriented folks)
  • Can sample 100Ksamples

I'll keep treading this audio card route for fun, but I'm still hoping to find more info about sigrok-supported devices and continuous capture.

Offline WhalesTopic starter

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
Re: Sigrok and devices like the Hantek 6022BE: Continuous operation?
« Reply #7 on: April 21, 2018, 07:50:16 am »
Looking at the source code of libsigrok: the driver for hantek-6xxx has no mention of the SR_CONF_CONTINUOUS flag.  This suggests me me that it's not supported.

Dang. 

There are many drivers that do have that flag.

abraxa: if it means anything then yes, I think it's really important to have information about CONTINUOUS support on the wiki.  It would be a nasty bummer to buy a device based off sigrok's support list and then find out you can't use 'sigrok-cli --continuous' on it only afterwards.
« Last Edit: April 21, 2018, 07:51:57 am by Whales »
 

Offline abraxa

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: de
  • Sigrok associate
Re: Sigrok and devices like the Hantek 6022BE: Continuous operation?
« Reply #8 on: April 21, 2018, 08:03:50 am »
Quote
Which fact surprised you here? The fact that the Rigol isn't able to stream or the fact it's not mentioned on the wiki?

Both.

I see "continuous capture streaming" as the No. 1 defining feature of a USB scope.  Without this they would provide no advantage over a standalone scope that I can see, other than cost + size.

Am I wrong?  I've never bought one of these (eg a Hantek) before.  The fact I can't find any solid information on this is making me wary.

The ability to capture and stream data only for short intervals, as the Rigol USB support appears to do, is little different in my mind to saving a screenshot or data capture from the scope onto a memory stick.  The USB link to a PC is a live connection, there's zero point having it when you don't support any tasks more live than equivalent to saving onto a memory stick.

I agree for the most part, though not entirely. The advantage of having a live USB connection is that you can save tens/thousands/millions of those data captures and perform an analysis on all of them. I, too, see streaming as the #1 reason to have a USB scope, though.

I wasn't aware that your requirements were so low. Somehow, I figured you'd need more. So depending on how many channels you need, https://sigrok.org/wiki/Supported_hardware#Mixed-signal_devices may have something for you. Those "8ch, 24MHz; 1ch analog, 3MHz BW" devices offer only one channel but they're cheap and do streaming since they're FX2-based.


Quote
I don't know whether the device supports this feature. Would definitely be nice to add to the libsigrok driver if it does.

Apologies: are you saying that the libsigrock driver doesn't have continuous capture support for the Hantek 6022BE?

Given that sigrok-cli straight out told me the Rigol didn't support continuous capture (only when I tried to run it), I'll have a poke at the source and see what it says about what devices support it.

Yeah, the driver doesn't have it implemented, as you noticed yourself. Whether it *can* be implemented on that device, I do not know.

if it means anything then yes, I think it's really important to have information about CONTINUOUS support on the wiki.  It would be a nasty bummer to buy a device based off sigrok's support list and then find out you can't use 'sigrok-cli --continuous' on it only afterwards.

Thanks for the hint, I'll see what can be done.
 

Offline PA4TIM

  • Super Contributor
  • ***
  • Posts: 1161
  • Country: nl
  • instruments are like rabbits, they multiply fast
    • PA4TIMs shelter for orphan measurement stuff
Re: Sigrok and devices like the Hantek 6022BE: Continuous operation?
« Reply #9 on: April 21, 2018, 09:40:41 am »
Thanks, I knew Sigrok, had it installed through synaptics to run my Zeroplus under linux on my old laptop, but I dit not know it could talk to so many instruments. Thanks to your topic I looked it up and found a how to install page for the whole package and I did  that. 
Sorry, I have no answer to the question.
« Last Edit: April 21, 2018, 09:43:55 am by PA4TIM »
www.pa4tim.nl my collection measurement gear and experiments Also lots of info about network analyse
www.schneiderelectronicsrepair.nl  repair of test and calibration equipment
https://www.youtube.com/user/pa4tim my youtube channel
 

Offline WhalesTopic starter

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
Re: Sigrok and devices like the Hantek 6022BE: Continuous operation?
« Reply #10 on: April 21, 2018, 12:06:46 pm »
Quote
I wasn't aware that your requirements were so low. Somehow, I figured you'd need more.

I'm looking at alternatives to an NI USB-6216 that's currently in use by a team I'm working with.  Long story short: it's occasionally/intermittently crashing a few hours into experiments.   As well as trying to fix/diagnose the issue I'm also looking at alternatives devices.

The most severe use case I have seen so far is two analog channels @ 100Ksample/s each.  If I can get something working reliably at this level then I'll make some people very happy.

The sigrok environment is appealing because it has simple-looking tools like sigrok-cli.  This contrasts with NI's SignalExpress, a big GUI program with lots of quirks that outputs in a strange and proprietary TDMS file format.

I'm also looking at BitScope's products at the moment.  I've shot an email off to them asking about continuous capture capabilities.


Quote
So depending on how many channels you need, https://sigrok.org/wiki/Supported_hardware#Mixed-signal_devices may have something for you. Those "8ch, 24MHz; 1ch analog, 3MHz BW" devices offer only one channel but they're cheap and do streaming since they're FX2-based.

Thanks for the chipset tip.  I'll poke into this category.

EDIT:  It's a shame only one analog channel on the FX2's works at a time (not sure if this is a hardware or sigrok limitation).  Otherwise these would be absolutely perfect.
« Last Edit: April 21, 2018, 01:07:58 pm by Whales »
 

Offline WhalesTopic starter

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
Re: Sigrok and devices like the Hantek 6022BE: Continuous operation?
« Reply #11 on: April 21, 2018, 12:09:47 pm »
Update on the soundcard front: no luck.

I've just finished trying to inject DC-biased signals after the input caps of three sound cards (2x USB and 1xPCI) without success.  The signals stay AC coupled and I just hit invisible clipping walls if I try to move the DC offset.  I'm beginning to suspect that I'm either very unlucky with the cards I have lying around or that something between the card and me is applying AC coupling (in software).
« Last Edit: April 21, 2018, 11:05:36 pm by Whales »
 

Offline Uwe Hermann

  • Contributor
  • Posts: 21
  • Country: 00
    • Personal website/blog
Re: Sigrok and devices like the Hantek 6022BE: Continuous operation?
« Reply #12 on: April 21, 2018, 03:11:26 pm »

EDIT:  It's a shame only one analog channel on the FX2's works at a time (not sure if this is a hardware or sigrok limitation).  Otherwise these would be absolutely perfect.

Hardware limitation. The FX2 has 16 IOs that can be sampled very quickly and streamed to the PC via USB. The 8+1 devices use 8 of those IOs for logic analyzer data, and the other 8 for one 8-bit analog sample value (they have a parallel ADC on the PCB). The most you could do (if your hardware is properly designed; some aren't) is two 8-bit analog channels.
sigrok developer (open-source, portable software for logic analyzers, oscilloscopes, DMMs, and other test & measurement gear)
 

Offline horo

  • Regular Contributor
  • *
  • Posts: 104
  • Country: de
    • My GitHub Projects
Re: Sigrok and devices like the Hantek 6022BE: Continuous operation?
« Reply #13 on: February 25, 2022, 12:29:10 pm »
(2) Where do I find information about eg the Hantek 6022 BE's continuous capture capabilities?  Eg a list of sampling rates that it can sustain continuously over USB?

Even if it is an old question, for the sake of completeness: the Hantek can measure continuously, see:
https://github.com/Ho-Ro/Hantek6022API#use-the-device-as-a-data-logger
It writes its output as CSV (time, channel, channel2).

Code: [Select]
usage: capture_6022.py [-h] [-d DOWNSAMPLE] [-o OUTFILE] [-r RATE] [-t TIME]
                       [-x CH1] [-y CH2]

optional arguments:
  -h, --help            show this help message and exit
  -d DOWNSAMPLE, --downsample DOWNSAMPLE
                        downsample 256 x DOWNSAMPLE
  -o OUTFILE, --outfile OUTFILE
                        write the data into OUTFILE
  -r RATE, --rate RATE  sample rate in kS/s (20, 50, 64, 100, default: 20)
  -t TIME, --time TIME  capture time in seconds (default: 1.0)
  -x CH1, --ch1 CH1     gain of channel 1 (1, 2, 5, 10, default: 1)
  -y CH2, --ch2 CH2     gain of channel 2 (1, 2, 5, 10, default: 1)

For visualisation, you can use this program, for example:
https://github.com/Ho-Ro/Hantek6022API/blob/main/examples/plot_from_capture_6022.py
Code: [Select]
usage: plot_from_capture_6022.py [-h] [-i INFILE] [-c CHANNELS] [-s [MAX_FREQ]]

optional arguments:
  -h, --help            show this help message and exit
  -i INFILE, --infile INFILE
                        read the data from INFILE
  -c CHANNELS, --channels CHANNELS
                        show one (CH1) or two (CH1, CH2) channels, default: 2)
  -s [MAX_FREQ], --spectrum [MAX_FREQ]
                        display the spectrum of the samples, optional up to MAX_FREQ

 

Offline WhalesTopic starter

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
Re: Sigrok and devices like the Hantek 6022BE: Continuous operation?
« Reply #14 on: February 25, 2022, 09:22:36 pm »
Thankyou Horo :)  Despite the age of these devices they still seem to be popular and easy to get, so this is useful to know.

It looks like they might support up to 1Msample/sec in continuous capture?

https://github.com/OpenHantek/OpenHantek6022/blob/main/docs/limitations.md

... but then if they're using 256x downsampling mentioned in your link then this will really be 78.125 Ksample/sec?  I presume that's configurable.
« Last Edit: February 25, 2022, 09:25:54 pm by Whales »
 

Offline horo

  • Regular Contributor
  • *
  • Posts: 104
  • Country: de
    • My GitHub Projects
Re: Sigrok and devices like the Hantek 6022BE: Continuous operation?
« Reply #15 on: February 28, 2022, 07:43:08 pm »
Thankyou Horo :)  Despite the age of these devices they still seem to be popular and easy to get, so this is useful to know.

It looks like they might support up to 1Msample/sec in continuous capture?

No, due to the python calculation overhead in the callback function the max speed is limited to 128 kS/s with the latest version. The downsampling limits the data size for long recordings and increases also the SNR (every 4x oversampling gives one additional bit of resolution, see https://www.silabs.com/documents/public/application-notes/an118.pdf).

EDIT: max rate increased to 200 kS/s with latest version 2.10.1
https://github.com/Ho-Ro/Hantek6022API/releases/tag/2.10.1
« Last Edit: March 01, 2022, 02:50:49 pm by horo »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf