Rigol DS1054Z Screenshot via Linux command line - Page 1
Forum section: electronics / testgear

author: WaveyDipole
author_rank: Frequent Contributor
timestamp: March 28, 2021, 10:08:33 pm
content: I read recently in these two articles that it is possible to get a screenshot from a Rigol DS1054Z via the command line on Linux:https://hackaday.io/project/6857-master-your-rigol-from-command-linehttps://www.theimpossiblecode.com/blog/rigol-ds1054z-screen-capture-linux/Since I use Linux most of the time, I had hoped this would be useful, however the problem is that it doesn't seem to work. I can connect to port 5555 using nc, telnet or PuTTy in RAW mode and the connection holds, but the scope just does not respond to anything including *IDN?. I tried the same on Windows but with the same result. The scope does respond when using the SCPI command console in UltraScope.Aside from the fact that the connection stays open in nc, I have confirmed that port 5555 is open:Starting Nmap 7.60 (https://nmap.org) at 2021-03-28 23:05 BSTNmap scan report for 10.210.210.162Host is up (0.0047s latency).Not shown: 996 closed portsPORT STATE SERVICE80/tcp open http111/tcp open rpcbind617/tcp open sco-dtmgr5555/tcp open freecivNmap done: 1 IP address (1 host up) scanned in 0.13 secondsI did a Wireshark capture of sending an *IDN? in UltraSigma and the rather weird thing is that it seems to be using port 618, which nmap does not even list as open?I am using the lates available firmware 00.04.04.04.03, which is shown as 00.04.04.SP4 on the scope in System Information. It didn't work with the previous version 00.04.04.01.01/00.04.04.SP1 either.Has anyone tried this on their DS1054Z scope and did it work?

author: Karel
author_rank: Super Contributor
timestamp: March 28, 2021, 10:29:05 pm
content: The following works fine here:Connect to your scope via LAN using telnet: (change the ip-address to the actual address of your scope)Code:> telnet 192.168.1.100 5555Trying 192.168.1.100...Connected to 192.168.1.100.Escape character is '^]'.*IDN?RIGOL TECHNOLOGIES,DS1104Z,DS1ZA170XXXXXX,00.04.04.SP3Using USB connection:Code:echo "*IDN?" > /dev/usbtmc0; cat /dev/usbtmc0RIGOL TECHNOLOGIES,DS1104Z,DS1ZA170XXXXXX,00.04.04.SP3cat: /dev/usbtmc0: Connection timed out

author: WaveyDipole
author_rank: Frequent Contributor
timestamp: March 29, 2021, 03:25:49 pm
content: Ok, tried it again today:$ telnet 10.210.210.162 5555Trying 10.210.210.162...Connected to 10.210.210.162.Escape character is '^]'.*IDN?RIGOL TECHNOLOGIES,DS1104Z,DS1ZA182712286,00.04.04.SP4Guess it must have been a network glitch of some kind?The screenshot examples now work as well.Weird.

author: HoracioDos
author_rank: Frequent Contributor
timestamp: March 29, 2021, 05:22:54 pm
content: Hello.You can use LXI-Tools if you don't want too much trouble.https://github.com/lxi-tools/lxi-toolsfrom Martin Lund.https://lxi-tools.github.ioLatest version is available with Snap.

author: Karel
author_rank: Super Contributor
timestamp: March 29, 2021, 06:14:13 pm
content: Or:https://www.teuniz.net/DSRemote/

author: WaveyDipole
author_rank: Frequent Contributor
timestamp: March 30, 2021, 12:48:07 pm
content: Had a look at lxi-tools and the command line version seems to work and I was able to send SCPI commands and get a screenshot. Thanks for the link.I initially installed it from the Linux repository but couldn't find the lxi-gui tool. I then downloaded the sources from the GitHub, but again, I got only the cli version. There is a ./src/gui/lxi-gui directory, but when I tried running make in there I got:QuoteIt looks like am missing QtCharts, but I can't find such a module in the Linux Mint repository or any information on how to install it, so am a bit stuck at the moment.

author: sb42
author_rank: Contributor
timestamp: March 30, 2021, 04:07:59 pm
content: Quote from: WaveyDipole on March 30, 2021, 12:48:07 pmIt looks like you're building against qt4, whereas lxi-tools claims to require qt5. I suspect that the lxi-tools build system generates a (wrong) Makefile in the lxi-gui directory even if the build dependencies for that program aren't satisfied(?)QTCharts should be in libqt5charts5-dev, which you'd need on top of qtbase5-dev. I can build and run lxi-gui on my Debian/unstable system like so:Code:./configure --enable-lxi-guimake./src/gui/lxi-gui/lxi-gui

author: WaveyDipole
author_rank: Frequent Contributor
timestamp: March 30, 2021, 05:57:36 pm
content: Quote from: sb42 on March 30, 2021, 04:07:59 pmThank you for the hints. It was the --enable-lxi-gui flag that I was missing. I apologise if I missed that info somewhere on their Github, but I don't see it mentioned.I did a 'make clean' followed by './configure --enable-lxi-gui'. This time configure reports that Qt5Charts is required. I therefore checked and found that the binary version is installed but the dev version was not. I installed the missing dev package and ran configure again. This time it completed.Make now compiles lxi and then attempts to compile the gui, but it fails with errors. The two errors seem to relate to the earlier warnings? It does. at least, seem to be using QT5. I'm still trying to figure out what the errors are about.$ makeMaking all in srcmake: Entering directory '/home/johnc/src/lxi-tools/lxi-tools-1.21/src'CC libapp_a-options.oCC libapp_a-discover.odiscover.c: In function ‘discover’:discover.c:66:20: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]info.broadcast = &broadcast;^discover.c:67:17: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]info.device = &device;^discover.c:68:18: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]info.service = &service;^CC libapp_a-scpi.oCC libapp_a-screenshot.oCC libapp_a-benchmark.oCC libapp_a-run.oCC libapp_a-lxilua.olxilua.c: In function ‘connect’:lxilua.c:51:26: warning: passing argument 1 of ‘lxi_connect’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]device = lxi_connect(address, 0, NULL, option.timeout, VXI11);^~~~~~~In file included from lxilua.c:36:0:/usr/include/lxi.h:59:5: note: expected ‘char *’ but argument is of type ‘const char *’int lxi_connect(char *address, int port, char *name, int timeout, lxi_protocol_t protocol);^~~~~~~~~~~lxilua.c: In function ‘scpi’:lxilua.c:83:31: warning: passing argument 2 of ‘lxi_send’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]length = lxi_send(device, command, strlen(command), option.timeout);^~~~~~~In file included from lxilua.c:36:0:/usr/include/lxi.h:60:5: note: expected ‘char *’ but argument is of type ‘const char *’int lxi_send(int device, char *message, int length, int timeout);^~~~~~~~lxilua.c: In function ‘scpi_raw’:lxilua.c:132:31: warning: passing argument 2 of ‘lxi_send’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]length = lxi_send(device, command, strlen(command), option.timeout);^~~~~~~In file included from lxilua.c:36:0:/usr/include/lxi.h:60:5: note: expected ‘char *’ but argument is of type ‘const char *’int lxi_send(int device, char *message, int length, int timeout);^~~~~~~~CC plugins/libapp_a-screenshot_keysight-dmm.oCC plugins/libapp_a-screenshot_keysight-ivx.oCC plugins/libapp_a-screenshot_rigol-1000z.oCC plugins/libapp_a-screenshot_rigol-2000.oCC plugins/libapp_a-screenshot_rigol-dg4000.oCC plugins/libapp_a-screenshot_rigol-dm3068.oCC plugins/libapp_a-screenshot_rigol-dp800.oCC plugins/libapp_a-screenshot_rigol-dsa.oCC plugins/libapp_a-screenshot_rohde-schwarz-hmo-rtb.oCC plugins/libapp_a-screenshot_siglent-sdm3000.oCC plugins/libapp_a-screenshot_siglent-sdg.oCC plugins/libapp_a-screenshot_siglent-sds.oCC plugins/libapp_a-screenshot_siglent-ssa3000x.oCC plugins/libapp_a-screenshot_tektronix.oAR libapp.aar: `u' modifier ignored since `D' is the default (see `U')CC main.oCCLD lximake: Leaving directory '/home/johnc/src/lxi-tools/lxi-tools-1.21/src'Making all in manmake: Entering directory '/home/johnc/src/lxi-tools/lxi-tools-1.21/man'make: Nothing to be done for 'all'.make: Leaving directory '/home/johnc/src/lxi-tools/lxi-tools-1.21/man'Making all in src/gui/lxi-guimake: Entering directory '/home/johnc/src/lxi-tools/lxi-tools-1.21/src/gui/lxi-gui'qtchooser -run-tool=qmake -qt=5 -makefile -o Makefile.qmake lxi-gui.pro \QT_INCDIR="//usr/local/include" \QT_LIBDIR="//usr/local/lib" \SNAPCRAFT="" \Info: creating stash file /home/johnc/src/lxi-tools/lxi-tools-1.21/src/gui/lxi-gui/.qmake.stashmake -f Makefile.qmake allmake: Entering directory '/home/johnc/src/lxi-tools/lxi-tools-1.21/src/gui/lxi-gui'g++ -c -pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_CHARTS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /usr/local/include -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtCharts -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o main.o main.cppmain.cpp: In function ‘void lxi_setup()’:main.cpp:32:26: error: invalid conversion from ‘void (*)(const char*, const char*)’ to ‘void (*)(char*, char*)’ [-fpermissive]lxi_info.broadcast = &broadcast;^~~~~~~~~~main.cpp:33:23: error: invalid conversion from ‘void (*)(const char*, const char*)’ to ‘void (*)(char*, char*)’ [-fpermissive]lxi_info.device = &device;^~~~~~~Makefile.qmake:426: recipe for target 'main.o' failedmake: *** [main.o] Error 1make: Leaving directory '/home/johnc/src/lxi-tools/lxi-tools-1.21/src/gui/lxi-gui'Makefile:471: recipe for target 'all-local' failedmake: *** [all-local] Error 2make: Leaving directory '/home/johnc/src/lxi-tools/lxi-tools-1.21/src/gui/lxi-gui'Makefile:409: recipe for target 'all-recursive' failedmake: *** [all-recursive] Error 1

author: sb42
author_rank: Contributor
timestamp: March 30, 2021, 08:35:09 pm
content: Quote from: WaveyDipole on March 30, 2021, 05:57:36 pmOn my system, with liblxi-1.13, the prototypes of those two functions in lxi-gui's main.cpp match the corresponding types in liblxi's lxi_info_t struct from lxi.h. On your system the types appear to differ. Perhaps you can upgrade your liblxi or, uh, fix lxi-gui/main.cpp(The right fix would be for lxi-tools to have a versioned dependency on a liblxi that implements the expected API, or to test the API at configure-time...)

author: WaveyDipole
author_rank: Frequent Contributor
timestamp: March 31, 2021, 02:50:20 pm
content: Thank you once again. I have liblxi-1.8 on my system. This is not surprising since Linux Mint pulls from an older Ubuntu repository. I removed the library installed from the linux repository and downloaded the sources from the lxi-tools Github. The current liblxi library co compiled with minimal fuss(just needed libxml2). After that I ran 'make clean' and './configure --enable-lxi-gui again. This time another Qt component was missing - QtGui/QAction:Code:$ makeMaking all in srcmake: Entering directory '/home/johnc/src/lxi-tools/lxi-tools-1.21/src'CC libapp_a-options.oCC libapp_a-discover.oCC libapp_a-scpi.oCC libapp_a-screenshot.oCC libapp_a-benchmark.oCC libapp_a-run.oCC libapp_a-lxilua.oCC plugins/libapp_a-screenshot_keysight-dmm.oCC plugins/libapp_a-screenshot_keysight-ivx.oCC plugins/libapp_a-screenshot_rigol-1000z.oCC plugins/libapp_a-screenshot_rigol-2000.oCC plugins/libapp_a-screenshot_rigol-dg4000.oCC plugins/libapp_a-screenshot_rigol-dm3068.oCC plugins/libapp_a-screenshot_rigol-dp800.oCC plugins/libapp_a-screenshot_rigol-dsa.oCC plugins/libapp_a-screenshot_rohde-schwarz-hmo-rtb.oCC plugins/libapp_a-screenshot_siglent-sdm3000.oCC plugins/libapp_a-screenshot_siglent-sdg.oCC plugins/libapp_a-screenshot_siglent-sds.oCC plugins/libapp_a-screenshot_siglent-ssa3000x.oCC plugins/libapp_a-screenshot_tektronix.oAR libapp.aar: `u' modifier ignored since `D' is the default (see `U')CC main.oCCLD lximake: Leaving directory '/home/johnc/src/lxi-tools/lxi-tools-1.21/src'Making all in manmake: Entering directory '/home/johnc/src/lxi-tools/lxi-tools-1.21/man'make: Nothing to be done for 'all'.make: Leaving directory '/home/johnc/src/lxi-tools/lxi-tools-1.21/man'Making all in src/gui/lxi-guimake: Entering directory '/home/johnc/src/lxi-tools/lxi-tools-1.21/src/gui/lxi-gui'make -f Makefile.qmake allmake: Entering directory '/home/johnc/src/lxi-tools/lxi-tools-1.21/src/gui/lxi-gui'g++ -c -pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_CHARTS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /usr/local/include -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtCharts -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o main.o main.cppg++ -c -pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_CHARTS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /usr/local/include -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtCharts -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o mainwindow.o mainwindow.cppIn file included from mainwindow.cpp:2:0:ui_mainwindow.h:14:10: fatal error: QtGui/QAction: No such file or directory#include <QtGui/QAction>^~~~~~~~~~~~~~~compilation terminated.Makefile.qmake:437: recipe for target 'mainwindow.o' failedmake: *** [mainwindow.o] Error 1make: Leaving directory '/home/johnc/src/lxi-tools/lxi-tools-1.21/src/gui/lxi-gui'Makefile:471: recipe for target 'all-local' failedmake: *** [all-local] Error 2make: Leaving directory '/home/johnc/src/lxi-tools/lxi-tools-1.21/src/gui/lxi-gui'Makefile:409: recipe for target 'all-recursive' failedmake: *** [all-recursive] Error 1I checked and I have libqt5gui5 installed and libqtgui4 apparently. I did a bit of digging and found that I need to add 'QT += widgets' to the .pro file. After a make clean and make, the program finally compiled. I then did a make install.The problem I now have is that it is not finding liblxi.so.1:Code:$ lxi-guilxi-gui: error while loading shared libraries: liblxi.so.1: cannot open shared object file: No such file or directoryI ran 'sudo ldconfig' and after that was able to launch the gui. Phew!On clicking 'Search', the gui identified the IP of my scope and I was able to send an *IDN? and grab a screenshot, so we finally have success! Got there in the end.Thank you very much for your help with the compile issues.