@@ -22,7 +22,7 @@ and focusses mainly on Hantek6022BE/BL under Linux (development system: Debian s
2222
2323## Hantek 6022 Python API for Linux
2424
25- < img alt = " Scope Visualisation Example " width = " 100% " src = " plot_from_capture.png " >
25+ ![ Scope Visualisation Example] ( examples/ plot_from_capture.png)
2626
2727This is a API for Python for the ultra-cheap, reasonably usable (and hackable) 6022 DSO,
2828with a libusb implementation via libusb1 for Linux.
@@ -45,8 +45,12 @@ all tools named `*_6022.py` are copied to `/usr/bin` and are thus globally avail
4545
4646You can even use the programs without installing anything. You just need a working ` python3-libusb ` installation.
4747All you need is the ` PyHT6022 ` directory in the directory where your Python program is located (e.g. in ` examples ` ).
48- This means: download this repo (as ` https://github.com/Ho-Ro/Hantek6022API/archive/refs/heads/main.zip `
49- or with ` git clone https://github.com/Ho-Ro/Hantek6022API.git ` ), go to ` examples ` and try e.g. ` python3 get_serial_number.py ` .
48+ This means:
49+
50+ - download this repo (as ` https://github.com/Ho-Ro/Hantek6022API/archive/refs/heads/main.zip ` )
51+ - or execute ` git clone https://github.com/Ho-Ro/Hantek6022API.git `
52+ - go to ` examples `
53+ - try e.g. ` python3 get_serial_number.py ` .
5054
5155
5256## Developer Info
@@ -61,8 +65,8 @@ to your udev rules, via
6165After you've done this, the scope should automatically come up with the correct permissions to be accessed
6266without being root user.
6367
64- The following instructions are tested with Debian stable versions * stretch* , * buster* and * bullseye *
65- and are executed also automatically by GitHub under Ubuntu (* 2004 * ) after each push to this repo - have a look
68+ The following instructions are tested with Debian stable versions * stretch* , * buster* , * bullseye * , and * bookworm *
69+ and are executed also automatically by GitHub under Ubuntu (* 2204 * ) after each push to this repo - have a look
6670at the [ GitHub Action] ( https://github.com/Ho-Ro/Hantek6022API/actions/workflows/build_check.yml ) .
6771On each successful run a Debian package is available under * Artifacts* .
6872
@@ -277,36 +281,61 @@ The 256 x downsampling option increases the SNR and effective resolution (8bit -
277281and allows very long time recording. The program uses the offset and gain calibration from EEPROM.
278282It writes the captured data into stdout or an outfile and calculates DC, AC and RMS of the data.
279283
280- usage: capture_6022.py [-h] [-d [DOWNSAMPLE]] [-g] [-o OUTFILE] [-r RATE] [-t TIME] [-x CH1]
281- [-y CH2]
282-
283- optional arguments:
284- -h, --help show this help message and exit
285- -d [DOWNSAMPLE], --downsample [DOWNSAMPLE]
286- downsample 256 x DOWNSAMPLE
287- -g, --german use comma as decimal separator
288- -o OUTFILE, --outfile OUTFILE
289- write the data into OUTFILE
290- -r RATE, --rate RATE sample rate in kS/s (20, 32, 50, 64, 100, 128, 200, default: 20)
291- -t TIME, --time TIME capture time in seconds (default: 1.0)
292- -x CH1, --ch1 CH1 gain of channel 1 (1, 2, 5, 10, default: 1)
293- -y CH2, --ch2 CH2 gain of channel 2 (1, 2, 5, 10, default: 1)
294-
284+ ```
285+ usage: capture_6022.py [-h] [-d [DOWNSAMPLE]] [-g] [-o OUTFILE] [-r RATE] [-t TIME] [-x CH1] [-y CH2]
286+
287+ Capture data from both channels of Hantek6022
288+
289+ options:
290+ -h, --help show this help message and exit
291+ -d [DOWNSAMPLE], --downsample [DOWNSAMPLE]
292+ downsample 256 x DOWNSAMPLE
293+ -g, --german use comma as decimal separator
294+ -o OUTFILE, --outfile OUTFILE
295+ write the data into OUTFILE (default: stdout)
296+ -r RATE, --rate RATE sample rate in kS/s (20, 32, 50, 64, 100, 128, 200, default: 20)
297+ -t TIME, --time TIME capture time in seconds (default: 1.0)
298+ -x CH1, --ch1 CH1 gain of channel 1 (1, 2, 5, 10, default: 1)
299+ -y CH2, --ch2 CH2 gain of channel 2 (1, 2, 5, 10, default: 1)
300+ ```
295301
296302The program ` plot_from_capture_6022.py ` takes the captured data (either from stdin
297303or from a file from command line argument) and presents them as seen on top of this page.
298304
299- usage: plot_from_capture_6022.py [-h] [-i INFILE] [-c CHANNELS] [-s [MAX_FREQ]]
305+ ```
306+ usage: plot_from_capture_6022.py [-h] [-i INFILE] [-c CHANNEL] [-s [MAX_FREQ]] [-x]
307+
308+ Plot output of capture_6022.py over time
309+
310+ options:
311+ -h, --help show this help message and exit
312+ -i INFILE, --infile INFILE
313+ read the data from INFILE (default: stdin)
314+ -c CHANNEL, --channel CHANNEL
315+ show only CH1 or CH2, default: show both)
316+ -s [MAX_FREQ], --spectrum [MAX_FREQ]
317+ display the spectrum of the samples, optional up to MAX_FREQ
318+ -x, --xkcd plot in XKCD style :)
319+ ```
320+
321+ The program ` fft_from_capture_6022.py ` takes the captured data (either from stdin
322+ or from a file from command line argument) and shows the spectrum.
300323
301- optional arguments:
302- -h, --help show this help message and exit
303- -i INFILE, --infile INFILE
304- read the data from INFILE
305- -c CHANNELS, --channels CHANNELS
306- show one (CH1) or two (CH1, CH2) channels, default: 2)
307- -s [MAX_FREQ], --spectrum [MAX_FREQ]
308- display the spectrum of the samples, optional up to MAX_FREQ
324+ ```
325+ usage: fft_from_capture_6022.py [-h] [-i INFILE] [-f | -n] [-x]
326+
327+ Plot FFT of output from capture_6022.py, use hann windowing as default
328+
329+ options:
330+ -h, --help show this help message and exit
331+ -i INFILE, --infile INFILE
332+ read the data from INFILE, (default: stdin)
333+ -f, --flat_top use flat top window
334+ -n, --no_window use no window
335+ -x, --xkcd plot in XKCD style :)
336+ ```
309337
338+ ![ fft from capture] ( examples/fft_from_capture.png )
310339
311340## Other neat things you can do
312341
0 commit comments