Control your DS1000Z series oscilloscope from Python: screenshots, settings, deep memory, and more.
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
Hi everyone, Just want to let you now that I just published v0.4.0 of this software (on Github and on PyPI). The major change is that downloading screenshots is now *much* faster. (Using PNG download now instead of BMP24.) Please check that you're running the latest firmware, though. The changelog is to be found here: https://github.com/pklaus/ds1054z/releases/tag/v0.4.0
Create an account to leave a comment. Already have an account? Log In.
Just wanted to let you know that a while back, I came across your project while trying to write some semi-automated tests for hardware I was working on, and found it extremely useful. Thanks for all the work!
Hi RoGeorge, thanks for your comment. And thanks for your prior work on the subject. That was helpful! The problem you're seeing should be fixed now with commit f785ef6. A small wrapper named ds1054z.exe should be placed in your PATH on windows when reinstalling the package. You can directly use the github zip download path in the pip installation command:
pip install https://github.com/pklaus/ds1054z/archive/master.zip
This will get you the latest revision including the fix. (Besides, please note that you downloaded the zip file from Github manually but then installed the ds1054z package from the Python Package Index "pypi", not from your local file/folder! To install the one you downloaded you would have had to specify a "local path" for pip, like: pip install ./ds1054z-master.)
If you need the Pillow package for Windows, you can get it from http://www.lfd.uci.edu/~gohlke/pythonlibs/.
Please let me know if that does the job.
Yeee, it's working! Thank you very much for your help!
I guess I still miss some Python packages, because not all commands are working for me, but the most important ones, does work. I was able to get the oscilloscope info and to capture a screen. In the help command, there are listed a lot of nice features that I would like to try.
I really like your program, very well done!
Is there any way for a Python installer to check for all it's required dependencies?
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\m>cd C:\Users\m\Desktop\ds_tst
C:\Users\m\Desktop\ds_tst>pip install https://github.com/pklaus/ds1054z/archi
ve/master.zip
Downloading/unpacking https://github.com/pklaus/ds1054z/archive/master.zip
Running setup.py (path:c:\users\m\appdata\local\temp\pip-esseqr-build\setup
.py) egg_info for package from https://github.com/pklaus/ds1054z/archive/master.
zip
Requirement already satisfied (use --upgrade to upgrade): python-vxi11 in c:\pyt
hon27\lib\site-packages (from ds1054z==0.3-dev)
Installing collected packages: ds1054z
Found existing installation: ds1054z 0.3.4
Uninstalling ds1054z:
Successfully uninstalled ds1054z
Running setup.py install for ds1054z
Installing ds1054z-script.py script to C:\Python27\Scripts
Installing ds1054z.exe script to C:\Python27\Scripts
Installing ds1054z.exe.manifest script to C:\Python27\Scripts
Successfully installed ds1054z
Cleaning up...
C:\Users\m\Desktop\ds_tst>ds1054z.exe
usage: ds1054z-script.py [-h] [-v] ...
ds1054z-script.py: error: too few arguments
C:\Users\m\Desktop\ds_tst>ds1054z.exe -h
usage: ds1054z-script.py [-h] [-v] ...
CLI for the DS1054Z scope by Rigol
This tool can be used in very versatile ways.
Ask it for --help on the individual actions
and it will tell you how to use them.
positional arguments:
Action to perform on the scope:
discover Discover and list scopes on your network and exit
info Print information about your oscilloscope
cmd Send an SCPI command to the oscilloscope
save-screen Save an image of the screen
save-data Save the waveform data to a file
properties Query properties of the DS1054Z instance
run Start the oscilloscope data acquisition
stop Stop the oscilloscope data acquisition
single Set the oscilloscope to the single trigger mode.
tforce Generate a trigger signal forcefully.
shell Start an interactive shell to control your scope.
optional arguments:
-h, --help show this help message and exit
-v, --verbose More verbose output
C:\Users\m\Desktop\ds_tst>ds1054z.exe -v discover
Discovery depends on the zeroconf Python package which is missing.
C:\Users\m\Desktop\ds_tst>ds1054z.exe -v info
Please specify a device to connect to. Auto-discovery doesn't work because the z
eroconf Python package is missing.
C:\Users\m\Desktop\ds_tst>ds1054z.exe -v info 192.168.1.3
Vendor: RIGOL TECHNOLOGIES
Product: DS1104Z
Serial: manually_removed
Firmware: 00.04.03
C:\Users\m\Desktop\ds_tst>ds1054z.exe -v discover 192.168.1.3
usage: ds1054z-script.py [-h] [-v] ...
ds1054z-script.py: error: unrecognized arguments: 192.168.1.3
C:\Users\m\Desktop\ds_tst>ds1054z.exe -v shell 192.168.1.3
Traceback (most recent call last):
File "C:\Python27\Scripts\ds1054z-script.py", line 9, in
load_entry_point('ds1054z==0.3-dev', 'console_scripts', 'ds1054z')()
File "C:\Python27\lib\site-packages\ds1054z\cli.py", line 304, in main
import readline
ImportError: No module named readline
C:\Users\m\Desktop\ds_tst>ds1054z.exe -v save-screen 192.168.1.3
Traceback (most recent call last):
File "C:\Python27\Scripts\ds1054z-script.py", line 9, in
load_entry_point('ds1054z==0.3-dev', 'console_scripts', 'ds1054z')()
File "C:\Python27\lib\site-packages\ds1054z\cli.py", line 245, in main
im = Image.alpha_composite(im, overlay)
AttributeError: 'module' object has no attribute 'alpha_composite'
C:\Users\m\Desktop\ds_tst>pip install Pillow
Downloading/unpacking Pillow
Installing collected packages: Pillow
Successfully installed Pillow
Cleaning up...
C:\Users\m\Desktop\ds_tst>ds1054z.exe -v save-screen 192.168.1.3
Saved file: ds1054z-scope-display_2015-09-19_17-18-17.png
C:\Users\m\Desktop\ds_tst>ds1054z.exe -v shell 192.168.1.3
Traceback (most recent call last):
File "C:\Python27\Scripts\ds1054z-script.py", line 9, in
load_entry_point('ds1054z==0.3-dev', 'console_scripts', 'ds1054z')()
File "C:\Python27\lib\site-packages\ds1054z\cli.py", line 304, in main
import readline
ImportError: No module named readline
C:\Users\m\Desktop\ds_tst>pip install pyCLI
Downloading/unpacking pyCLI
Running setup.py (path:c:\users\m\appdata\local\temp\pip_build_muuu\pyCLI\s
etup.py) egg_info for package pyCLI
Installing collected packages: pyCLI
Running setup.py install for pyCLI
Successfully installed pyCLI
Cleaning up...
C:\Users\m\Desktop\ds_tst>ds1054z.exe -v shell 192.168.1.3
Traceback (most recent call last):
File "C:\Python27\Scripts\ds1054z-script.py", line 9, in
load_entry_point('ds1054z==0.3-dev', 'console_scripts', 'ds1054z')()
File "C:\Python27\lib\site-packages\ds1054z\cli.py", line 304, in main
import readline
ImportError: No module named readline
C:\Users\m\Desktop\ds_tst>
Once again, I'm impressed, congrats!
The command
pip install --upgrade ds1054z[savescreen,discovery]
should get you up and running. The statements in the square brackets behind the package name tell pip to also fetch and install the requirements for those 'extra' features. Unfortunately this doesn't work if you directly install from the Github URL. But never mind, just install the version from PyPI with the command above to get all requirements and later run pip install --upgrade https://github.com/pklaus/ds1054z/archive/master.zip if your really need the bleading edge version from Github - the packages for the extra dependencies will remain.
I'm glad to see other implementations, thanks for github credits!
I am not familiar with Python, and for some reason the script didn't worked for me. I downloaded the zip from github, then followed the redme installation steps:
<code>
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\m>cd C:\Users\m\Desktop\ds1054z-master
C:\Users\m\Desktop\ds1054z-master>pip install ds1054z
Downloading/unpacking ds1054z
Downloading ds1054z-0.3.4.tar.gz
Running setup.py (path:c:\users\m\appdata\local\temp\pip_build_m\ds1054z
\setup.py) egg_info for package ds1054z
Downloading/unpacking python-vxi11 (from ds1054z)
Downloading python-vxi11-0.8.tar.gz
In the tar file c:\users\m\appdata\local\temp\pip-ozyypi-unpack\python-vxi1
1-0.8.tar.gz the member python-vxi11-0.8/README is invalid: unable to resolve li
nk inside archive
Running setup.py (path:c:\users\m\appdata\local\temp\pip_build_m\python-
vxi11\setup.py) egg_info for package python-vxi11
Installing collected packages: ds1054z, python-vxi11
Running setup.py install for ds1054z
Running setup.py install for python-vxi11
Installing vxi11-cli-script.py script to C:\Python27\Scripts
Installing vxi11-cli.exe script to C:\Python27\Scripts
Installing vxi11-cli.exe.manifest script to C:\Python27\Scripts
Successfully installed ds1054z python-vxi11
Cleaning up...
C:\Users\m\Desktop\ds1054z-master>ds1054z save-screen
'ds1054z' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\m\Desktop\ds1054z-master>ds1054z save-screen --overlay 0.6 192.168.1
.3
'ds1054z' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\m\Desktop\ds1054z-master>
</code>
Become a member to follow this project and never miss any updates
I have the python zeroconf package, but the cli complains:
"Please specify a device to connect to. Auto-discovery doesn't work because the zeroconf Python package is missing."
I then tried to just open python and import zeroconf, and it failed:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/zeroconf.py", line 175
def current_time_millis() -> float:
^
SyntaxError: invalid syntax
So something's wrong with zeroconf. I looked further and it seems that zeroconf is not supporting python 2 any more.
Should the cli work with python 3, and how would I start it with python 3?