Coder Social home page Coder Social logo

rogeorge / ds1054z_screen_capture Goto Github PK

View Code? Open in Web Editor NEW
206.0 206.0 55.0 267 KB

Capture the display of a Rigol DS1000Z series oscilloscope by LAN only, using LXI SCPI commands. No USB, no VISA, no IVI and no Rigol drivers are required.

Home Page: https://hackaday.io/project/5807-driverless-rigol-ds1054z-screen-capture-over-lan

License: GNU General Public License v2.0

Python 100.00%

ds1054z_screen_capture's People

Contributors

rogeorge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ds1054z_screen_capture's Issues

python2-pip has deprecated "get_installed_instributions" in version 10.0.1

Using the latest version of pip, OscScreenGrabLAN.py fails. Forcing downgrade to 9.0.1 fixes issue, but of course, then you're locked into an old version of the package.

Traceback (most recent call last):
File "OscScreenGrabLAN.py", line 55, in
log_running_python_versions()
File "/home/troy/Cloud/Electronics/DS1054Z_screen_capture/Rigol_functions.py", line 11, in log_running_python_versions
installed_packages = pip.get_installed_distributions()
AttributeError: 'module' object has no attribute 'get_installed_distributions'

Updated my Rigol DS1054Z and now the script stopped working

Hi,

The script was working nicely - for PNGs - before the update.

Now I updated to the newest firmware (v00.04.04.00.07) and the script is not working anymore.

I also applied the options to fully upgrade it to a DS1104Z - successfully - and enable all the features.

Here are my results:

$ python OscScreenGrabLAN.py bmp 10.0.1.104
Instrument ID: RIGOL TECHNOLOGIES,DS1104Z,DS1ZA180300357,00.04.04

Receiving screen capture...
ERROR

And on the log file I can see:

2016-10-06 21:37:28,331 - INFO - New run started...
2016-10-06 21:37:28,331 - INFO - Log message: INFO level set.
2016-10-06 21:37:28,331 - INFO - ***** Running Python version:
2016-10-06 21:37:28,331 - INFO - 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)], sys.version_info(major=2, minor=7, micro=10, releaselevel='final', serial=0)
2016-10-06 21:37:28,331 - INFO - sys.version_info(major=2, minor=7, micro=10, releaselevel='final', serial=0)
2016-10-06 21:37:28,332 - INFO - Installed Python modules:['altgraph==0.10.2', 'bdist-mpkg==0.5.0', 'bonjour-py==0.3', 'macholib==1.5.1', 'matplotlib==1.3.1', 'modulegraph==0.10.4', 'numpy==1.8.0rc1', 'pillow==3.4.1', 'pip==8.1.2', 'py2app==0.7.3', 'pyobjc-core==2.5.1', 'pyobjc-framework-accounts==2.5.1', 'pyobjc-framework-addressbook==2.5.1', 'pyobjc-framework-applescriptkit==2.5.1', 'pyobjc-framework-applescriptobjc==2.5.1', 'pyobjc-framework-automator==2.5.1', 'pyobjc-framework-cfnetwork==2.5.1', 'pyobjc-framework-cocoa==2.5.1', 'pyobjc-framework-collaboration==2.5.1', 'pyobjc-framework-coredata==2.5.1', 'pyobjc-framework-corelocation==2.5.1', 'pyobjc-framework-coretext==2.5.1', 'pyobjc-framework-dictionaryservices==2.5.1', 'pyobjc-framework-eventkit==2.5.1', 'pyobjc-framework-exceptionhandling==2.5.1', 'pyobjc-framework-fsevents==2.5.1', 'pyobjc-framework-inputmethodkit==2.5.1', 'pyobjc-framework-installerplugins==2.5.1', 'pyobjc-framework-instantmessage==2.5.1', 'pyobjc-framework-latentsemanticmapping==2.5.1', 'pyobjc-framework-launchservices==2.5.1', 'pyobjc-framework-message==2.5.1', 'pyobjc-framework-opendirectory==2.5.1', 'pyobjc-framework-preferencepanes==2.5.1', 'pyobjc-framework-pubsub==2.5.1', 'pyobjc-framework-qtkit==2.5.1', 'pyobjc-framework-quartz==2.5.1', 'pyobjc-framework-screensaver==2.5.1', 'pyobjc-framework-scriptingbridge==2.5.1', 'pyobjc-framework-searchkit==2.5.1', 'pyobjc-framework-servicemanagement==2.5.1', 'pyobjc-framework-social==2.5.1', 'pyobjc-framework-syncservices==2.5.1', 'pyobjc-framework-systemconfiguration==2.5.1', 'pyobjc-framework-webkit==2.5.1', 'pyopenssl==0.13.1', 'pyparsing==2.0.1', 'python-dateutil==1.5', 'pytz==2013.7', 'scipy==0.13.0b1', 'setuptools==1.1.6', 'six==1.4.1', 'vboxapi==1.0', 'xattr==0.6.4', 'zope.interface==4.1.1']
2016-10-06 21:37:28,342 - INFO - SCPI to be sent: *idn?
2016-10-06 21:37:28,342 - INFO - Send SCPI: *OPC?
2016-10-06 21:37:28,343 - INFO - Received response: 1

2016-10-06 21:37:28,343 - INFO - Sent SCPI: *idn?
2016-10-06 21:37:28,344 - INFO - Received response: RIGOL TECHNOLOGIES,DS1104Z,DS1ZA180300357,00.04.04

2016-10-06 21:37:28,344 - INFO - SCPI to be sent: display:data?
2016-10-06 21:37:28,344 - INFO - Send SCPI: *OPC?
2016-10-06 21:37:28,345 - INFO - Received response: 1

2016-10-06 21:37:28,345 - INFO - Sent SCPI: display:data?
2016-10-06 21:37:29,345 - INFO - Received response: #9001152054BM6”� ...

lots of data and then...

2016-10-06 21:37:29,346 - WARNING - Received LESS data then expected! (345790 out of 1152068 expected raw BMP bytes.)
2016-10-06 21:37:30,347 - WARNING - 343210 leftover bytes added to 'buff'.
2016-10-06 21:37:30,347 - WARNING - Received LESS data then expected! (689000 out of 1152068 expected raw BMP bytes.)
2016-10-06 21:37:31,347 - WARNING - 88690 leftover bytes added to 'buff'.
2016-10-06 21:37:31,348 - WARNING - Received LESS data then expected! (777690 out of 1152068 expected raw BMP bytes.)
2016-10-06 21:37:32,352 - WARNING - 92690 leftover bytes added to 'buff'.
2016-10-06 21:37:32,352 - WARNING - Received LESS data then expected! (870380 out of 1152068 expected raw BMP bytes.)
2016-10-06 21:37:33,353 - WARNING - 99370 leftover bytes added to 'buff'.
2016-10-06 21:37:33,353 - WARNING - Received LESS data then expected! (969750 out of 1152068 expected raw BMP bytes.)
2016-10-06 21:37:34,353 - WARNING - 98130 leftover bytes added to 'buff'.
2016-10-06 21:37:34,354 - WARNING - Received LESS data then expected! (1067880 out of 1152068 expected raw BMP bytes.)
2016-10-06 21:37:35,357 - WARNING - 78980 leftover bytes added to 'buff'.
2016-10-06 21:37:35,357 - WARNING - Received LESS data then expected! (1146860 out of 1152068 expected raw BMP bytes.)
2016-10-06 21:37:35,418 - WARNING - 5206 leftover bytes added to 'buff'.
2016-10-06 21:37:35,418 - WARNING - Received LESS data then expected! (1152066 out of 1152068 expected raw BMP bytes.)
2016-10-06 21:37:36,418 - ERROR - Received LESS data then expected! (1152066 out of 1152068 expected raw BMP bytes.)

save_path has no effect

DS1054Z_screen_capture $ ./OscScreenGrabLAN.py png rigol here
Instrument ID: RIGOL TECHNOLOGIES,DS1104Z,DS1ZA221102549,00.04.05.SP2

Receiving screen capture...
Saved file: 'captures/DS1104Z_DS1ZA221102549_2022-07-25_18.07.35.png'
DS1054Z_screen_capture $ ./OscScreenGrabLAN.py png rigol .   
Instrument ID: RIGOL TECHNOLOGIES,DS1104Z,DS1ZA221102549,00.04.05.SP2

Receiving screen capture...
Saved file: 'captures/DS1104Z_DS1ZA221102549_2022-07-25_18.08.12.png'

File is always saved to captures/.

OscScreenGrabLAN.py broken something between reading and saving

$ python2.7 OscScreenGrabLAN.py png 192.168.14.1
Instrument ID: RIGOL TECHNOLOGIES,DS1104Z,DS1ZAxxxxxxxxx,00.02.00.SP1

Receiving screen capture...
Traceback (most recent call last):
File "OscScreenGrabLAN.py", line 149, in
im = Image.open(StringIO.StringIO(buff))
File "/usr/lib64/python2.7/site-packages/PIL/Image.py", line 2290, in open
% (filename if filename else fp))
IOError: cannot identify image file <StringIO.StringIO instance at 0x7f60a7e0aea8>

for csv:
Active channels on the display: []
Traceback (most recent call last):
File "OscScreenGrabLAN.py", line 172, in
depth = get_memory_depth(tn)
File "/tmp/DS1054Z_screen_capture-master/Rigol_functions.py", line 27, in get_memory_depth
return float(mdep)
ValueError: could not convert string to float:

for bmp:
Receiving screen capture...
Traceback (most recent call last):
File "OscScreenGrabLAN.py", line 149, in
im = Image.open(StringIO.StringIO(buff))
File "/usr/lib64/python2.7/site-packages/PIL/Image.py", line 2290, in open
% (filename if filename else fp))
IOError: cannot identify image file <StringIO.StringIO instance at 0x7f6983975ea8>

Python 3 version

Python 2 will be shortly deprecated.
Do you intend to port DS1054Z_screen_capture to Python 3 ?
Some people like me, have completely removed Python 2.

Testing with DS2xxx/DS2xxxA

For info only - I know this hardware isn't officially supported.
I just tested this code with a Rigol DS2202, firmware 00.03.04.SP2.
Code identifies it as:
Found instrument model 'DS2202' from 'RIGOL TECHNOLOGIES'

PNG capture works.
BMP capture works.
CSV capture seems to always fail after ~1minute, with the following trace:

Traceback (most recent call last):
  File "OscScreenGrabLAN.py", line 198, in <module>
    response = command(tn, ":" + channel + ":DISP?")
  File "DS1054Z_screen_capture-master/Rigol_functions.py", line 23, in command
    response = tn.read_until("\n", 1)  # wait max 1s for an answer
  File "DS1054Z_screen_capture-master/telnetlib_receive_all.py", line 297, in read_until
    return self._read_until_with_poll(match, timeout)
  File "DS1054Z_screen_capture-master/telnetlib_receive_all.py", line 332, in _read_until_with_poll
    self.fill_rawq()
  File "DS1054Z_screen_capture-master/telnetlib_receive_all.py", line 579, in fill_rawq
    buf = self.sock.recv(50)
socket.error: [Errno 104] Connection reset by peer

I'm personally very happy with just the screen capture functionality, and I hope the word will spread that this is available.

Thanks for your work.

Constantly asking for *OPC? without answer

Hi !

I'm trying to get a screenshot of my DS1054Z (04.04.SP1) with your script via my Raspberry Pi (connected with a RJ-45 cable to the scope), but when I execute the command "sudo python2 OscScreenGrabLAN.py 193.168.1.2", the program is stuck in a loop and it's seem to wait an answer according to the log.

The configuration of the Ethernet connection between my devices are correct and I tried to interface with the scope via a telnet client and it was working (*OPC? anwser 1, *IDN? give me information about my scope...). Ping also works.

I've downloaded the release version (1.0.0) and the master and both are giving to me this problem.

Do you have any idea of what is happening ?

Thanks in advance,
Naipsys.

OscScreenGrabLAN.py.log.txt

EDIT : I've tested on my PC under Windows 10, same issues.

Can't capture CSV from a DS1054Z on Mac OS

Hi,

I just installed your software and it worked just fine to capture PNG files.

However, when I try to capture CSV I get the following error messages:

$ python OscScreenGrabLAN.py csv 10.0.1.104
Instrument ID: RIGOL TECHNOLOGIES,DS1054Z,DS1ZA180300357,00.04.03.SP2

Traceback (most recent call last):
File "OscScreenGrabLAN.py", line 199, in
depth = get_memory_depth(tn)
File "/Users/mlemos/Google Drive/Projects/rigol/DS1054Z_screen_capture-master/Rigol_functions.py", line 52, in get_memory_depth
mdep = h_grid * scal * srate
TypeError: can't multiply sequence by non-int of type 'str'

Cannot capture from DS1074Z - multiple messages

Hi,
This tool really seems to fulfill one of my needs : capture without bloated drivers. However, I can't seem to make it work with my DS1074Z.
Surprisingly, each time I start the same command line, I'm getting a different error message, in sequence:

D:\DS1054Z_screen_capture-master>python OscScreenGrabLAN.py png 192.168.0.212

ERROR: No Rigol from series DS1000Z found at  192.168.0.212
ERROR

D:\DS1054Z_screen_capture-master>python OscScreenGrabLAN.py csv 192.168.0.212
command error
Check the oscilloscope settings.
Utility -> IO Setting -> RemoteIO -> LAN must be ON
ERROR

D:\DS1054Z_screen_capture-master>python OscScreenGrabLAN.py bmp 192.168.0.212
Instrument ID: RIGOL TECHNOLOGIES,DS1104Z,<serial_removed>,00.04.00

Receiving screen capture...
Traceback (most recent call last):
  File "OscScreenGrabLAN.py", line 149, in <module>
    im = Image.open(StringIO.StringIO(buff))
  File "C:\Python27\lib\site-packages\PIL\Image.py", line 2317, in open
    % (filename if filename else fp))
IOError: cannot identify image file <StringIO.StringIO instance at 0x02059DA0>

D:\DS1054Z_screen_capture-master>

And the cycle restarts if I request again.

It seems the first call cannot see the scope, but wakes it up. The second call sees the scope but it doesn't reply yet. The third call sees the scope, gets a reply (the "Receiving screen capture" step lasts a few seconds) but then crashes.

Any idea ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.