Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated my Rigol DS1054Z and now the script stopped working #6

Open
mlemos opened this issue Oct 7, 2016 · 2 comments
Open

Updated my Rigol DS1054Z and now the script stopped working #6

mlemos opened this issue Oct 7, 2016 · 2 comments
Assignees

Comments

@mlemos
Copy link

mlemos commented Oct 7, 2016

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.)

@RoGeorge
Copy link
Owner

RoGeorge commented Oct 7, 2016

Thank you for letting me know. There are 2 problems with v1.0.0 of the script. First, is that somehow I managed to push a broken version and tag it as the first release, v1.0.0. My bad here, sorry for that. Second is that different versions of oscilloscope firmware respond different to the same SCPI commands sent by the script.

As an example, the firmware version I have on my scope now, 00.04.03 SP1, is accepting commands without '\n' at the end. Other firmware versions seems to require a mandatory '\n' at the end of each command.

Also, 00.04.03 SP1 is adding 2 unexpected bytes at the end of the bitmap file. These two bytes does not follow the description of the BMP format, and does not follow the description of the response described in the Rigol's own manual. These 2 extra bytes can also be seen with Wireshark.

Long story short, this weekend I will try to fix all the reported issues:

  • missing '\n'
  • variable BMP length response
  • broken CSV capture

@RoGeorge RoGeorge self-assigned this Oct 7, 2016
@mlemos
Copy link
Author

mlemos commented Oct 7, 2016

Thanks @RoGeorge ,

I did a hack to capture the images, changing the expected_len to 1152066 and adding the three missing bytes to the response buffer. I added 00, 00, & 0A (hex) to the end of the buffer.

I know it is not a solution, but it helped me to capture the screens I was need for a project I'm working on.

I'll be glad to test your final solution.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants