EEVblog Electronics Community Forum

Products => Test Equipment => Topic started by: lundmar on October 07, 2017, 05:51:10 pm

Title: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on October 07, 2017, 05:51:10 pm
Hi,

I have released lxi-tools for GNU/Linux - see https://lxi-tools.github.io (https://lxi-tools.github.io)

The lxi-tools open source project provides the following:

(http://lxi-tools.github.io/images/lxi-tools-showcase.png)

https://www.youtube.com/watch?v=8EE3mf_wADg (https://www.youtube.com/watch?v=8EE3mf_wADg)

https://www.youtube.com/watch?v=QPgAGEImD0U (https://www.youtube.com/watch?v=QPgAGEImD0U)

It's fully open source and available for download.

For details on how to use the commandline interface please see https://github.com/lxi-tools/lxi-tools (https://github.com/lxi-tools/lxi-tools)

Installation:
Latest lxi-tools:  lxi-tools-1.21.tar.xz (https://github.com/lxi-tools/lxi-tools/releases/download/v1.21/lxi-tools-1.21.tar.xz)  (Changes (https://github.com/lxi/lxi-tools/releases), GitHub (https://github.com/lxi-tools/lxi-tools))
Latest liblxi:  liblxi-1.13.tar.xz (https://github.com/lxi-tools/liblxi/releases/download/v1.13/liblxi-1.13.tar.xz)  (Changes (https://github.com/lxi-tools/liblxi/releases), GitHub (https://github.com/lxi-tools/liblxi))

Install latest stable version using snap:  $ snap install lxi-tools
Install latest development version using snap:  $ snap install lxi-tools --edge
Supported snap architectures: amd64, i386, armhf

Visit https://snapcraft.io (https://snapcraft.io) to see how to install snap for your distribution.

If you are a Windows user you can install e.g. Virtualbox (see https://www.virtualbox.org (https://www.virtualbox.org)) and install Linux (e.g. Ubuntu 17.10) in a VM under which you install and run lxi-tools.
Note: Remember to reconfigure the VMs network interface to use a bridged network adapter (not NAT).

Motivation:
This open source project is for people who don't care for the proprietary, costly, and often times inferior tools available for controlling LXI compatible instruments. The very reason I authored lxi-tools/liblxi is because I wanted better and simpler tools for controlling my instruments. Stuff like NI VISA drivers/tools etc. are just too bloated for my taste and not really open source friendly. I think we can do better. After all, LXI is an open standard so why not make some proper open source tools to support it :)

Tested instruments:
The lxi commandline tool included in lxi-tools is tested to work successfully with the following instruments:

InstrumentWorking features
Keysight Technologies AWG 33612A(discover+scpi+screenshot)
Keysight Technologies DMM 34461A(discover+scpi+screenshot)
Keysight Technologies MSO-X 3024T(discover+scpi+screenshot)
Rigol Technologies DS1104Z(discover+scpi+screenshot)
Rigol Technologies DS2302(discover+scpi+screenshot)
Rigol Technologies DG4062(discover+scpi+screenshot)
Rigol Technologies DG4102(discover+scpi+screenshot)
Rigol Technologies DG4162(discover+scpi+screenshot)
Rigol Technologies DP831(discover+scpi+screenshot)
Rigol Technologies DP832(discover+scpi+screenshot)
Rigol Technologies DM3068(discover+scpi+screenshot)
Rigol Technologies DSA815(discover+scpi+screenshot)
Rigol Technologies MSO2302A(discover+scpi+screenshot)
Rigol Technologies DP832(discover+scpi+screenshot)
Rohde & Schwarz HMC 8012(discover+scpi+screenshot)
Rohde & Schwarz HMC 8043(discover+scpi+screenshot)
Rohde & Schwarz HMO 1202(discover+scpi+screenshot)
Rohde & Schwarz HMO 3054(scpi+screenshot)
Rohde & Schwarz RTB 2004(discover+scpi+screenshot)
Siglent Technologies SDG1032X(discover+scpi+screenshot)
Siglent Technologies SDG2122X(discover+scpi+screenshot)
Siglent Technologies SDG6052(discover+scpi+screenshot)
Siglent Technologies SDS1202X-E(discover+scpi+screenshot)
Siglent Technologies SDS1204X-E(discover+scpi+screenshot)
Siglent Technologies SDS2304X(discover+scpi+screenshot)
Siglent Technologies SDM3045X(discover+scpi+screenshot)
Siglent Technologies SDM3055(discover+scpi+screenshot)
Siglent Technologies SDM3065X(discover+scpi+screenshot)
Siglent Technologies SPD3303X-E(scpi)
Siglent Technologies SSA3032X(discover+scpi+screenshot)

Thanks to all the users in this forum who are helping to test and improve lxi-tools!  :-+

Future work include:

Call for contributors:
Anyone who would like to contribute to this project is welcome to join in. All types of contributions are welcome (code, feature ideas, doc, test, etc.).

P.S.: Developers/hackers, feel free to contribute. Start maybe by adding e.g. screenshot plugins for your favorite LXI instruments and push them upstream to lxi-tools via GitHub.
P.P.S: For inspiration, see https://github.com/lxi-tools/lxi-tools/blob/master/src/plugins/screenshot_rigol-1000z.c (https://github.com/lxi-tools/lxi-tools/blob/master/src/plugins/screenshot_rigol-1000z.c) which is the code for the screenshot plugin for Rigol 1000z oscilloscopes.
P.P.P.S: lxi-tools is not in any way affiliated with the LXI consortium. It is a fully independent open source effort.

Steps for building and installing the latest versions from git source (Ubuntu/Debian example):

Code: [Select]
sudo apt-get install git automake autogen autoconf libtool libreadline-dev libc-dev-bin libc6-dev libavahi-core-dev libavahi-common-dev libavahi-client-dev libxml2-dev liblua5.2-dev

mkdir lxi && cd lxi
git clone [url]https://github.com/lxi-tools/liblxi[/url] && cd liblxi
./autogen.sh
./configure --prefix=$HOME/opt/lxi
make install
cd ..

git clone [url]https://github.com/lxi-tools/lxi-tools[/url] && cd lxi-tools
./autogen.sh
./configure --prefix=$HOME/opt/lxi LDFLAGS=-L$HOME/opt/lxi/lib
make CFLAGS=-I$HOME/opt/lxi/include install
cd ..

export PATH=$HOME/opt/lxi/bin:$PATH
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: HoracioDos on October 07, 2017, 08:51:23 pm
I've opened an issue for lxi-tools. Perhaps I'm messing things up when compiling
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on October 07, 2017, 11:11:21 pm
I've opened an issue for lxi-tools. Perhaps I'm messing things up when compiling

Nope - you did actually find a real bug. Thanks for your github reporting.

It enabled me to quickly release lxi-tools v1.1 which includes the fix. It is available at http://lxi-tools.github.io (http://lxi-tools.github.io)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on October 17, 2017, 01:53:47 pm
New versions of lxi-tools and liblxi are available at http://lxi-tools.github.io (http://lxi-tools.github.io)

They include some important bug fixes that resolves issues with some instruments not responding.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: awallin on October 17, 2017, 04:56:12 pm

do you have plans for python bindings?

Might be a stupid question, but what's the difference between LXI and VXI11?
I've been using this for basic things - with good success: https://github.com/python-ivi/python-vxi11

thanks,
Anders
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on October 17, 2017, 08:27:10 pm
do you have plans for python bindings?

Not at the moment. Mostly because I don't have a need for it myself. However, if anyone wants to contribute some python bindings I welcome it.

Might be a stupid question, but what's the difference between LXI and VXI11?

It's a perfectly fine question. The short answer is that the LXI standard defines the set of communication protocols used in a LXI/Ethernet enabled instrument. Such protocols include HTTP, VXI11, etc. and in the future HiSLIP. VXI11 is the specific RPC protocol that is used to communicate eg. SCPI commands. It is a fairly dated and slow protocol that will eventually be replaced with the more modern and faster HiSLIP (High-Speed LAN Instrument Protocol).

liblxi provides a simple high level C api that abstracts away the details of the VXI protocol for doing simple stuff like discovering instruments, sending SCPI commands, and receiving responses. Eventually it will do the same for HiSLIP.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on October 26, 2017, 03:25:18 pm
New versions of lxi-tools and liblxi are available at https://lxi-tools.github.io

Updates includes some important bug fixes that resolve issues with timeout and receive errors. The API used to connect has also been improved.

For those using Fedora there will be updated packages available in 1-2 weeks or so.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on October 28, 2017, 06:12:00 am
A new version of lxi-tools has been released - see https://github.com/lxi-tools/lxi-tools

The screenshot feature has now become a subcommand of the lxi tool instead of the separate tool rigol_1000z_screenshot.

Code: [Select]
Usage: lxi [--version] [--help] <command> [<args>]                                                 

  -v, --version                       Display version                                               
  -h, --help                          Display help                                                 

Commands:               
  discover [<options>]                Search for LXI devices                                       
  scpi [<options>] <scpi-command>     Send SCPI command                                             
  screenshot [<options>] <filename>   Capture screenshot to file                                   

Discover options:       
  -t, --timeout <seconds>             Timeout (default: 3)                                         

Scpi options:           
  -a, --address <ip>                  Device IP address                                             
  -t, --timeout <seconds>             Timeout (default: 3)                                         
  -x, --dump-hex                      Print response in hexadecimal                                 
  -f, --dump-file <filename>          Save response to file                                         
  -i, --interactive                   Enter interactive mode                                       
  -s, --script <filename>             Run script file                                               

Screenshot options:     
  -a, --address <ip>                  Device IP address                                             
  -t, --timeout <seconds>             Timeout (default: 3)                                         
  -m, --model <name>                  Name of device model (model/family)                           
  -l, --list                          List supported device models                                 


Code: [Select]
EXAMPLES
       Send SCPI command to LXI device:

              lxi scpi -a 192.168.0.42 "*IDN?"

       Capture screenshot from LXI device with specific model/family:

              lxi screenshot -a 192.168.0.42 -m rigol-1000z my-screenshot.png

Also added is a small screenshot plugin framework which makes it possible to easily add screenshot support for new instruments for those interested in doing so.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: RoGeorge on October 29, 2017, 07:29:36 pm
I noticed that running "lxi discover" does not find any instrument when running on a Debian 8.0 installed in a VMware machine that is running under Windows 10, but sending SCPI commands to specified addresses works just fine.

- The Debian 8 VMware machine is set to use "NAT: Used to share the host's IP address".
- All the Rigol instruments respond when pinged from Deb8.
- In the PC there are 2 physical network cards, one of them is used for the instruments, 192.168.1.*, the other physical network card is for Internet connection, 192.168.100.*
- Both the Internet and the ping to any Rigol instrument works just fine from either Win10 or the Deb8 VMware machine.

For the moment I don't have a native Debian 8 installation without using VMware.

Is this a bug?

Code: [Select]
rogeorge@debian80:~$ lxi scpi -a 192.168.1.3 *IDN?
RIGOL TECHNOLOGIES,DS1104Z,DS1ZA16*,00.04.04.SP3
rogeorge@debian80:~$ lxi scpi -a 192.168.1.4 *IDN?
RIGOL TECHNOLOGIES,DP832,DP8C16*,00.01.11
rogeorge@debian80:~$ lxi scpi -a 192.168.1.5 *IDN?
Rigol Technologies,DG4102,DG4E17*,00.01.12
rogeorge@debian80:~$ lxi discover
Searching for LXI devices - please wait...

Broadcasting on interface lo
Broadcasting on interface eth0

No devices found

rogeorge@debian80:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:*:*:* brd ff:ff:ff:ff:ff:ff
    inet 192.168.146.134/24 brd 192.168.146.255 scope global dynamic eth0
       valid_lft 1711sec preferred_lft 1711sec
    inet6 fe80::20c:*:*:*/64 scope link
       valid_lft forever preferred_lft forever
rogeorge@debian80:~$
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on October 29, 2017, 08:05:24 pm
I noticed that running "lxi discover" does not find any instrument when running on a Debian 8.0 installed in a VMware machine that is running under Windows 10, but sending SCPI commands to specified addresses works just fine.

- The Debian 8 VMware machine is set to use "NAT: Used to share the host's IP address".

Thats your problem right there - broadcast messages do not translate through NAT and so the lxi discover command will never receive a response from your instrument.

The way to solve it is reconfiguring your VMWare guest to use a bridged network adapter instead of a NAT one.

FYI - lxi discover is tested to work fine with a bridged network adapter from a guest under VirtualBox. I highly recommend using VirtualBox instead of VMWare, but for other reasons :)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on October 30, 2017, 07:03:58 pm
I've added screenshot support for more instruments:

Code: [Select]
$ lxi screenshot --list
            Name   Description
keysight-iv2000x   Keysight InfiniVision 2000 X series oscilloscopes (experimental)
           rigol   Rigol 1000z/2000/4000 series oscilloscopes
      rs-hmo1000   Rohde & Schwarz HMO 1000 series oscilloscopes (experimental)
  tektronix-2000   Tektronix MSO/DPO 2000 series oscilloscopes (experimental)

It's experimental since I don't have the instruments to test on. But in theory it should work assuming the instrument documentation is accurate :)

Example:
Code: [Select]
lxi screenshot --adress 192.168.0.40 --model rigol screenhot.png
Saved PNG screenshot image to screenhot.png
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: RoGeorge on October 30, 2017, 07:27:58 pm
Great, thank you!  :-+

Questions and comments:

- AFAIK all Rigol oscilloscopes use the same SCPI command for a screenshot. Why it was necessary in the code to separate them by 1000/2000/4000 models?
- Also, since lxi-tools allows running a SCPI text file, why not just defining a text SCPI file for each instrument, so the user can add its own instrument any time?
- A thing that I noticed when capturing screenshots with my software was that I was lazy enough to write a small script to increment the file name, so I made the code to put a timestamp in the filename. That was useful because once a command it's typed in the terminal, it's very easy to repeat it by simply "up arrow" and "enter", and the previous screenshot files will not be overwritten.
- I can add screnshots for the Rigol DG4000 DDS signal generators if you want, and for the Rigol DP832 power source. Should I make a pull request, or just tell you here the SCPI commands after manually testing them on my instruments?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on October 30, 2017, 08:48:27 pm
- AFAIK all Rigol oscilloscopes use the same SCPI command for a screenshot. Why it was necessary in the code to separate them by 1000/2000/4000 models?
I know. It is the exact same plugin code being run for all the rigol model names but I though it looked better in the list but I think I will end up collapsing it back into one model name "rigol".

- Also, since lxi-tools allows running a SCPI text file, why not just defining a text SCPI file for each instrument, so the user can add its own instrument any time?
The point of the screenshot command is to make it extremely simple to quickly grab a screenshot from a supported model. The best thing for users to do is to simply push a plugin upstream or use liblxi to solve their screenshot needs. Also, you cant easily define in a text file how to strip headers/footers of various complexity - it would quickly become a messy solution. However, I have been pondering to add support for maybe sending/receiving binary data via files using the "lxi scpi" command, in which case users can do whatever they want, even implement screenshot capturing for unsupported models even though I would prefer them to push plugins so everyone can benefit.

- A thing that I noticed when capturing screenshots with my software was that I was lazy enough to write a small script to increment the file name, so I made the code to put a timestamp in the filename. That was useful because once a command it's typed in the terminal, it's very easy to repeat it by simply "up arrow" and "enter", and the previous screenshot files will not be overwritten.
I want the user to be able to explicitly define the resulting filename regardless of image format. This way you can do exactly what you just have done via scripting. But maybe I could make the filename optional so that if no filename is provided it will automatically save to screenshot001.png, screenshot002.png, etc.. Timestamp is not necessary as it would be redundant information since files include a time stamp. **DONE**

- I can add screnshots for the Rigol DG4000 DDS signal generators if you want, and for the Rigol DP832 power source. Should I make a pull request, or just tell you here the SCPI commands after manually testing them on my instruments?

Sure, do a pull request if you want to take a shot at the code. Actually, I was looking a bit quickly through the DP832 docs but didn't find the scpi command for capturing screenshots. I assume it is the same as other rigols but I'm not sure. If not, we can quickly create plugins for specific Rigol models.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 01, 2017, 08:13:34 pm
FYI - I've added raw/TCP support for sending commands:

Code: [Select]
lxi scpi --raw --address 192.168.0.42 "*IDN?"
RIGOL TECHNOLOGIES,DS1104Z,DS1ZA1234567890,00.04.04.SP3

It is faster than VXI-11 but does not provide the same advantages that VXI-11 brings, in particular there is no timeout/control handling in case your SCPI command somehow stalls/crashes.

A configurable communications backend has also been added to liblxi in the effort to support raw/TCP and also in preparation for adding support for HiSlip/TCP in the future.

These changes will be included in the upcoming releases.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 01, 2017, 10:06:47 pm
- I can add screnshots for the Rigol DG4000 DDS signal generators if you want, and for the Rigol DP832 power source. Should I make a pull request, or just tell you here the SCPI commands after manually testing them on my instruments?

Please, if you can don't hesitate to test the lxi tool with any LXI/LAN enabled instrument you have :)


I'm looking to hear from anyone who would like to test lxi-tools with their LXI/LAN instruments so that we can improve it steadily. The more instruments that the tools are tested against the better. I'm going to add a list of tested instruments in the README.

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: RoGeorge on November 02, 2017, 01:22:50 am
I can test DG4102 screenshot when I'll return home, maybe next Monday or Tuesday.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: rhb on November 04, 2017, 09:19:31 pm
FYI

liblxi fails in ./configure because it can't find ifaddrs.h on Solaris 10 u8

lxi-tools fails in ./configure because it can't find libreadline even though liibreadline is in /app/lib and /app/lib is in LD_LIBRARY_PATH

FWIW I have 397 executables in /app/bin, all of which were compiled from source.

Back during the workstation wars I built a large system for SunOS, AIX, IRIX, CLIX, Ultrix and HP-UX with only two #ifdefs in the code.  One for byte sex and the other for FORTRAN record length.  The only build dependency was the presence of Gnu make on all systems.  We now have autotools just to make code portable across linux distros.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 04, 2017, 11:17:37 pm
FYI

liblxi fails in ./configure because it can't find ifaddrs.h on Solaris 10 u8

lxi-tools fails in ./configure because it can't find libreadline even though liibreadline is in /app/lib and /app/lib is in LD_LIBRARY_PATH

FWIW I have 397 executables in /app/bin, all of which were compiled from source.

Back during the workstation wars I built a large system for SunOS, AIX, IRIX, CLIX, Ultrix and HP-UX with only two #ifdefs in the code.  One for byte sex and the other for FORTRAN record length.  The only build dependency was the presence of Gnu make on all systems.  We now have autotools just to make code portable across linux distros.

I'm sorry but lxi-tools and liblxi are designed for use with GNU/Linux systems only.

I'm not surprised you run into issues trying to install it on Solaris and I can't really recommend doing so. If I'm not mistaken Solaris still uses the Solaris C library and clearly it does not include ifaddrs.h . The GNU C library includes it.

The autotools readline check included is a very basic one. If it fails it could be because of missing or wrong configure options.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: rhb on November 05, 2017, 01:33:20 am
Congratulations on recreating the major mistakes of the last 70 years.

Did you ever hear of POSIX?  RMS coined the name and the concept.  If you write to the C  and POSIX standards your code will run easily almost anywhere.  That was why that 500,000+ line mixture of C, FORTRAN, lex and yacc ran on all those different systems.  The package was a port from VMS and I insisted on conformance to standards.  It was in regular use for almost 20 years with no support at all for probably 10 years.  There were no bugs left.  We had fewer than a dozen user submitted bugs the first year of deployment and it went down from there.  Every build included a large test suite.  When we wrote a module, we wrote tests for it and ran it on all the supported platforms.  It makes you very sensitive to where the standards say that behavior is "undefined" or "implementation dependent".  So you don't do stupid stuff.

The readline check fails because autotools is semantically and conceptually broken.  It is *supposed* to look in all the directories in LD_LIBRARY_PATH.  I don't try to fix broken machine generated code.  I wasted an entire week trying to get Octave to work once because they botched the autotools setup.  Never mind that R compiled just fine.  I've compiled a lot of code that uses Gnu readline.  Ken Thompson wrote early versions of Unix in fewer lines than a configure script!

The consequence is simply that I shall write my own software rather than contribute to yours. A command line LXI interface is just an example program  from "Advanced Programming in the Unix Environment" by Stevens and Rago decorated with some LXI details.  It can also be done in python or perl, though I don't care much for either.

There's a Dilbert cartoon on the cover of Stevens and Rago that's very relevant.  The interchange in the last  frame is "You're one of those condescending Unix users."  "Here's a nickel, kid.  Get yourself a better computer."
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 05, 2017, 03:15:27 am
Congratulations on recreating the major mistakes of the last 70 years.

Did you ever hear of POSIX?  RMS coined the name and the concept.  If you write to the C  and POSIX standards your code will run easily almost anywhere.  That was why that 500,000+ line mixture of C, FORTRAN, lex and yacc ran on all those different systems.  The package was a port from VMS and I insisted on conformance to standards.  It was in regular use for almost 20 years with no support at all for probably 10 years.  There were no bugs left.  We had fewer than a dozen user submitted bugs the first year of deployment and it went down from there.  Every build included a large test suite.  When we wrote a module, we wrote tests for it and ran it on all the supported platforms.  It makes you very sensitive to where the standards say that behavior is "undefined" or "implementation dependent".  So you don't do stupid stuff.

The readline check fails because autotools is semantically and conceptually broken.  It is *supposed* to look in all the directories in LD_LIBRARY_PATH.  I don't try to fix broken machine generated code.  I wasted an entire week trying to get Octave to work once because they botched the autotools setup.  Never mind that R compiled just fine.  I've compiled a lot of code that uses Gnu readline.  Ken Thompson wrote early versions of Unix in fewer lines than a configure script!

The consequence is simply that I shall write my own software rather than contribute to yours. A command line LXI interface is just an example program  from "Advanced Programming in the Unix Environment" by Stevens and Rago decorated with some LXI details.  It can also be done in python or perl, though I don't care much for either.

There's a Dilbert cartoon on the cover of Stevens and Rago that's very relevant.  The interchange in the last  frame is "You're one of those condescending Unix users."  "Here's a nickel, kid.  Get yourself a better computer."

 :-//

I'm sorry but I think your criticism is quite misdirected. I get a feeling you are angry for other reasons and you are just here to prolong whatever workstation wars you have been engaged in for years. I mean, it's all very nice stories but I can't fix the world for you.

Autotools is by no means perfect but it is still the preferred way of distributing software for GNU/Linux systems.

And let me repeat myself, lxi-tools and liblxi is written for GNU/Linux systems (as stated on the frontpage of https://lxi-tools.github.io and in all the READMEs). This means it will not work on POSIX only systems.

I'm a professional SW engineer and I'm a big fan of POSIX and I use it extensively in most software that I write. However, for some applications, part of the software rely on system level features which are not covered by any of the available POSIX standards. In case of liblxi I'm relying on specific interfaces that allows me to discover and manage all available network interfaces to be used in the lxi discover feature. No such interfaces are available via POSIX. Hence I write that part of the code specifically for GNU/Linux systems because it is the most popular platform out there in the *nix world.

To support Solaris I would have to write and maintain these code parts specifically for Solaris. Unfortunately, I simply don't have any plans to support Solaris. Why? Because fact is Solaris is a dying platform with a small and rapidly declining user base. This is true, now more than ever, especially since Oracle laid off the Solaris core development staff this year. R.I.P.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: RoGeorge on November 06, 2017, 04:04:32 pm
Made a new build today and testing right now, so brace yourself for a lot of :blah: and :rant:, but no :clap:, even if you fully deserve all the appreciation.

While my general impression about lxi-tools is a very good one :-+, and I highly appreciate what you already put there, in the next messages I will focus only on what I don't like, or on what didn't work as I expected. Many of them will rather be about my personal preferences and feature requests, maybe some misusage from my side, so not exactly a bug report. Didn't looked into the code yet.

I will repeatedly post here while testing, but I will avoid discussing solutions during testing, so please don't get annoyed if I don't reply until tomorrow.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: rhb on November 06, 2017, 05:10:30 pm
I'm a professional SW engineer and I'm a big fan of POSIX and I use it extensively in most software that I write. However, for some applications, part of the software rely on system level features which are not covered by any of the available POSIX standards. In case of liblxi I'm relying on specific interfaces that allows me to discover and manage all available network interfaces to be used in the lxi discover feature. No such interfaces are available via POSIX. Hence I write that part of the code specifically for GNU/Linux systems because it is the most popular platform out there in the *nix world.

Other than not being portable to non-Gnu/Linux systems, I don't see what this does

Quote
int lxi_discover(struct lxi_info_t *info, int timeout)
{
    struct sockaddr_in *broadcast_addr;
    struct ifaddrs *ifap;
    int status;

    // Go through available broadcast addresses
    if (getifaddrs(&ifap) == 0)
    {
   struct ifaddrs *ifap_p = ifap;

   while (ifap_p)
   {
            if ((ifap_p->ifa_addr) && (ifap_p->ifa_addr->sa_family == AF_INET))
            {
      broadcast_addr = (struct sockaddr_in *) ifap_p->ifa_broadaddr;

      // Notify current broadcast address and network interface via callback
      if (info->broadcast != NULL)
                    info->broadcast(inet_ntoa(broadcast_addr->sin_addr), ifap_p->ifa_name);

      // Find LXI devices via broadcast address
      status = discover_devices(broadcast_addr, info, timeout);

            }
            ifap_p = ifap_p->ifa_next;
   }
   freeifaddrs(ifap);
    }

    return LXI_OK;

that can't be done with this from POSIX.1 aka IEEE Std 1003.1 2004

Quote
9964 NAME
19965 SYNOPSIS
19966 #include <net/if.h>
if_nameindex — return all network interface names and indexes
struct if_nameindex *if_nameindex(void);
19967
19968 DESCRIPTION
19969 The if_nameindex( ) function shall return an array of if_nameindex structures, one structure per
19970 interface. The end of the array is indicated by a structure with an if_index field of zero and an
19971 if_name field of NULL.
19972 Applications should call if_freenameindex( ) to release the memory that may be dynamically
19973 allocated by this function, after they have finished using it.
19974 RETURN VALUE
19975 An array of structures identifying local interfaces. A NULL pointer is returned upon an error,
19976 with errno set to indicate the error.
19977 ERRORS
19978 The if_nameindex( ) function may fail if:
[ENOBUFS]
19979
Insufficient resources are available to complete the function.
19980 EXAMPLES
19981 None.
19982 APPLICATION USAGE
19983 None.
19984 RATIONALE
19985 None.
19986 FUTURE DIRECTIONS
19987 None.
19988 SEE ALSO
19989 getsockopt ( ), if_freenameindex( ), if_indextoname( ), if_nametoindex( ), setsockopt ( ), the Base
19990 Definitions volume of IEEE Std 1003.1-2001, <net/if.h>

It looks to me as if ifaddrs got written so someone could claim to be a Linux kernel contributor on their resume.

Anger is not the correct word.  Annoyed is more accurate.  I hate seeing unportable code that could trivially have been written to be portable to any Unix system.   I've had to fix far too much of it.

Solaris is quite alive despite being So Larry's.  Illumos (nee OpenSolaris) is actively developed and maintained by a number of small companies.  And MacOS is Unix, as are FreeBSD, OpenBSD and NetBSD.

If you don't understand the absurdity of autotools, then you don't grok the Unix tradition.

In this particular instance, I probably will fix your code, starting with dumping autotools.  An error generated by a compiler or linker is trivial to fix.  An error generated by autotools is pretty much impossible.  The Octave and  autotools developers both blamed each other.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: RoGeorge on November 06, 2017, 05:40:00 pm
Just in case somebody else want to give it a try starting from the github sources, I built lxi-tools like this (on a Debian 8.9 jessie):
Code: [Select]
cd ~
mkdir lxi-tools
cd lxi-tools/
git clone https://github.com/lxi/liblxi
cd liblxi/
su
apt-get update
apt-get install automake
apt-get install autogen autoconf libtool

./autogen.sh
./configure
make
make install
cd ..

git clone https://github.com/lxi/lxi-tools
cd lxi-tools/
./autogen.sh

apt-get install libreadline-dev

./configure
make
make install

exit
cd ..

# not required any more ???
# export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"

lxi

Test setup
Debian 8 running inside VMware 12 Player running inside Windows 10
Three LXI instruments are connected to LAN:

Tested commands

1.
Code: [Select]
rogeorge@debian80:~/lxi-tools$ lxi
Usage: lxi [--version] [--help] <command> [<args>]

  -v, --version                        Display version
  -h, --help                           Display help

Commands:
  discover [<options>]                 Search for LXI devices
  scpi [<options>] <scpi-command>      Send SCPI command
  screenshot [<options>] [<filename>]  Capture screenshot

Discover options:
  -t, --timeout <seconds>              Timeout (default: 3)

Scpi options:
  -a, --address <ip>                   Device IP address
  -t, --timeout <seconds>              Timeout (default: 3)
  -x, --dump-hex                       Print response in hexadecimal
  -f, --dump-file <filename>           Save response to file
  -i, --interactive                    Enter interactive mode
  -s, --script <filename>              Run script file
  -r, --raw                            Use raw/TCP
  -p, --raw-port <port>                Use raw/TCP port (default: 5555)

Screenshot options:
  -a, --address <ip>                   Device IP address
  -t, --timeout <seconds>              Timeout (default: 15)
  -m, --model <name>                   Name of model
  -l, --list                           List supported models

rogeorge@debian80:~/lxi-tools$
Passed

2.
Code: [Select]
rogeorge@debian80:~/lxi-tools$ lxi --version
lxi v1.6
rogeorge@debian80:~/lxi-tools$ lxi -v
lxi v1.6
rogeorge@debian80:~/lxi-tools$ lxi -h
Usage: lxi [--version] [--help] <command> [<args>]

  -v, --version                        Display version
  -h, --help                           Display help

Commands:
  discover [<options>]                 Search for LXI devices
  scpi [<options>] <scpi-command>      Send SCPI command
  screenshot [<options>] [<filename>]  Capture screenshot

Discover options:
  -t, --timeout <seconds>              Timeout (default: 3000)

Scpi options:
  -a, --address <ip>                   Device IP address
  -t, --timeout <seconds>              Timeout (default: 3000)
  -x, --dump-hex                       Print response in hexadecimal
  -f, --dump-file <filename>           Save response to file
  -i, --interactive                    Enter interactive mode
  -s, --script <filename>              Run script file
  -r, --raw                            Use raw/TCP
  -p, --raw-port <port>                Use raw/TCP port (default: 5555)

Screenshot options:
  -a, --address <ip>                   Device IP address
  -t, --timeout <seconds>              Timeout (default: 15000)
  -m, --model <name>                   Name of model
  -l, --list                           List supported models

rogeorge@debian80:~/lxi-tools$ lxi --help
Usage: lxi [--version] [--help] <command> [<args>]

  -v, --version                        Display version
  -h, --help                           Display help

Commands:
  discover [<options>]                 Search for LXI devices
  scpi [<options>] <scpi-command>      Send SCPI command
  screenshot [<options>] [<filename>]  Capture screenshot

Discover options:
  -t, --timeout <seconds>              Timeout (default: 3000)

Scpi options:
  -a, --address <ip>                   Device IP address
  -t, --timeout <seconds>              Timeout (default: 3000)
  -x, --dump-hex                       Print response in hexadecimal
  -f, --dump-file <filename>           Save response to file
  -i, --interactive                    Enter interactive mode
  -s, --script <filename>              Run script file
  -r, --raw                            Use raw/TCP
  -p, --raw-port <port>                Use raw/TCP port (default: 5555)

Screenshot options:
  -a, --address <ip>                   Device IP address
  -t, --timeout <seconds>              Timeout (default: 15000)
  -m, --model <name>                   Name of model
  -l, --list                           List supported models

rogeorge@debian80:~/lxi-tools$
Failed - Cosmetic
Help syntax "Usage: lxi [--version] [--help] <command> [<args>]" suggests <command> is mandatory and the rest optional, but <command> is not mandatory i.e for help and version. Maybe consider "help" and "version" as commands instead of options, or change the help to something like "Usage: lxi --version | --help | <command> [<args>]"

3.
Code: [Select]
rogeorge@debian80:~/lxi-tools$ lxi discover
Searching for LXI devices - please wait...

Broadcasting on interface lo
Broadcasting on interface eth0
    Found "RIGOL TECHNOLOGIES,DS1104Z,DS1ZA16*,00.04.04.SP3" on address 192.168.1.3
    Found "Rigol Technologies,DG4102,DG4E17*,00.01.12
4.SP3" on address 192.168.1.5
    Found "RIGOL TECHNOLOGIES,DP832,DP8C16*,00.01.11

4.SP3" on address 192.168.1.4

Found 3 devices

rogeorge@debian80:~/lxi-tools$
Failed - Major inconvenience
Leftovers from the previous instrument description text to the next instrument description. This must be investigated, just to be sure there is no out of range memory addressing at runtime.

The *IDN? answer for the last 2 instruments is:
Code: [Select]
rogeorge@debian80:~/lxi-tools$ lxi scpi -a 192.168.1.5 *IDN?
Rigol Technologies,DG4102,DG4E17*,00.01.12
rogeorge@debian80:~/lxi-tools$ lxi scpi -a 192.168.1.4 *IDN?
RIGOL TECHNOLOGIES,DP832,DP8C16*,00.01.11
rogeorge@debian80:~/lxi-tools$
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: RoGeorge on November 06, 2017, 05:52:49 pm
4.
Code: [Select]
rogeorge@debian80:~/lxi-tools$ lxi discovery
Error: No IP address specified
rogeorge@debian80:~/lxi-tools$
Failed - Minor inconvenience
Misleading error message. There is a typo in the command name, "discovery" instead of "discover",  not a missing IP.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: glarsson on November 06, 2017, 06:08:01 pm
I hate seeing unportable code that could trivially have been written to be portable to any Unix system.   I've had to fix far too much of it.
Agree 100%. A common way to write code for Linux is to grep /usr/include until you find something.  |O
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: RoGeorge on November 06, 2017, 06:12:14 pm
5.
Code: [Select]
rogeorge@debian80:~/lxi-tools$ lxi scpi -r -a 192.168.1.3 "CHAN1:DISP?"
1
rogeorge@debian80:~/lxi-tools$ lxi scpi -a 192.168.1.3 "CHAN1:DISP?"
1
rogeorge@debian80:~/lxi-tools$ lxi scpi -a 192.168.1.3 -r "CHAN1:DISP?"
1
rogeorge@debian80:~/lxi-tools$ lxi scpi -ra 192.168.1.3 "CHAN1:DISP?"
1
rogeorge@debian80:~/lxi-tools$ lxi scpi -ra 192.168.1.3 "CHAN1 DISP?"
Command error
rogeorge@debian80:~/lxi-tools$ lxi scpi -a 192.168.1.3 "CHAN1 DISP?"
Error: Read error (timeout)
Error: Failed to receive message
rogeorge@debian80:~/lxi-tools$
Passed
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: RoGeorge on November 06, 2017, 06:28:09 pm
6.
Code: [Select]
rogeorge@debian80:~/lxi-tools$ lxi screenshot
Error: Missing address
rogeorge@debian80:~/lxi-tools$ lxi screenshot -a 192.168.1.3
Error: Missing model
rogeorge@debian80:~/lxi-tools$ lxi screenshot -a 192.168.1.3 -m rigol
Saved screenshot image to screenshot-000.png
rogeorge@debian80:~/lxi-tools$ lxi screenshot -a 192.168.1.3 -m rigol -f DS1Z_SCR.png
lxi: invalid option -- 'f'
Passed

Feature request 6.1. - add an option to specify the filename
Feature request 6.2. - add a shorter syntax, like "scr" for "screenshot"
Feature request 6.3. - make model optional, and auto identify the model using the IP and *IDN?
Feature request 6.4. - add an option for datetime-stamp in the filename
Feature request 6.5. - add an option for instrument ID in the filename (can be more than just 1 oscilloscope on the same network, so after a save there is no way to identify where from is the captured screen)
Feature request 6.5. - add an option to immediately open the captured screenshot - for making multiple screen captures (manually) until the best waveform is captured
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 06, 2017, 08:22:44 pm
Made a new build today and testing right now, so brace yourself for a lot of :blah: and :rant:, but no :clap:, even if you fully deserve all the appreciation.

While my general impression about lxi-tools is a very good one :-+, and I highly appreciate what you already put there, in the next messages I will focus only on what I don't like, or on what didn't work as I expected. Many of them will rather be about my personal preferences and feature requests, maybe some misusage from my side, so not exactly a bug report. Didn't looked into the code yet.

I will repeatedly post here while testing, but I will avoid discussing solutions during testing, so please don't get annoyed if I don't reply until tomorrow.

Thanks.

Don't worry, I'm always looking for constructive feedback so we can steadily improve the tools and squash any bugs found.

Thank you for your thorough testing. Let me comment on your findings accordingly:

1. Check.

2. I believe the way the commandline is described is fairly conventional. Yes, strictly speaking <command> is optional. However, you can't really do anything without the commands. I think it will only confuse users more if we make everything optional. Popular tools like git is described in a similar way.

3. Good catch. I've pushed a commit that should fix the issue. This is exactly why I need someone with multiple instruments to test :) I only have a single LXI instrument to test with :(

4. To be fixed. Update: FIXED

5. Check.

6.1 Already implemented,   "screenshot [<options>] [<filename>]  Capture screenshot" . If no filename is provided it will autoresolve it.

6.2 Sorry no. I'm not a fan of shorthand expressions like scr. To help lazy people the tool features full bash autocompletion ;) Try e.g. 'source <prefix>/share/bash-completion/completions/lxi' to load completion
manually.

6.3 Seemingly a good idea. Assuming ID strings are consistent then it is possible. I think it should be added to the TODO list as a possible feature in the future. It is something that the screenshot plugin framework should be modified to support.

6.4 Hmm, you win. However, we don't want an option for it. I'll just add date-time by default :) Update: FIXED

6.5 Appending the ID is a bit more tricky since you don't want to include the full string in the screenshot filename. This is something that each screenshot plugin needs to handle because only it will know what to strip from the ID strings of the instruments it supports. This can work if ID strings are consistent, if not it will be troublesome. Add it to the TODO list. As an alternative and simpler solution we could append the model and IP to the filename.

6.6 A good idea but I think this feature should be reserved for a separate graphical screenshot tool to be included in lxi-tools. Something to put on the TODO list too. A simple QT or GTK application would do the job.

Btw. feel free to register a github account and submit any issues you find in the lxi-tools issue tracker: https://github.com/lxi/lxi-tools/issues . Using github issues makes it easier to track and manage issues.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 06, 2017, 08:25:56 pm
I hate seeing unportable code that could trivially have been written to be portable to any Unix system.   I've had to fix far too much of it.
Agree 100%. A common way to write code for Linux is to grep /usr/include until you find something.  |O

I don't think anyone disagrees here to the extend it is possible. Just be mindful not everything can be done in portable code and sometimes non-portable code is required, especially when dealing with hw interfaces.

Also, this is one open source project among many that I'm doing in the little spare time that I have available so I don't have the time to put endless rigor into making everything portable in the first go. That being said, anyone is welcome to contribute to the project and fix any issues they might find, including portability issues.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: glarsson on November 06, 2017, 09:08:34 pm
I don't think anyone disagrees here to the extend it is possible. Just be mindful not everything can be done in portable code and sometimes non-portable code is required, especially when dealing with hw interfaces.
True, but the non-portable code can be located in separate files to make it easier to port to different platforms.

Also, this is one open source project among many that I'm doing in the little spare time that I have available so I don't have the time to put endless rigor into making everything portable in the first go. That being said, anyone is welcome to contribute to the project and fix any issues they might find, including portability issues.
I was looking at adding code to sigrok or port lxi-tools to macOS (a certified UNIX with a marketshare larger than Linux) but did get the feeling that contributions to lxi-tools supporting platforms other than Linux was not welcome.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 06, 2017, 09:57:35 pm
True, but the non-portable code can be located in separate files to make it easier to port to different platforms.
True, especially if there is a lot of it. Conditional ifdefs will do fine for smaller code bits, which is the case here.

I was looking at adding code to sigrok or port lxi-tools to macOS (a certified UNIX with a marketshare larger than Linux) but did get the feeling that contributions to lxi-tools supporting platforms other than Linux was not welcome.
Any contributions to improve lxi-tools or liblxi are welcome. Yes, it is initially made for and tested on GNU/Linux systems but that is mainly because I don't have the bandwidth nor access to test and support other platforms. In other words, I'm not opposed to supporting other platforms but only if someone would like to contribute/help maintain that support. That being said, not much is required to make it work on most platforms.

If you want to help make lxi-tools and liblxi work on macOS I welcome it  :-+
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 07, 2017, 12:02:56 am
Other than not being portable to non-Gnu/Linux systems, I don't see what this does

vxi11_discover() iterates through the broadcast addresses of all available network interface. For each iteration it calls discover_devices() using the broadcast address to find the instruments.

Using getifaddrs() etc. is technically not portable code as it is not blessed by posix, it is however available on most platforms, including Linux, macOS, *BSD, and even Solaris 11+.

If you are not satisfied I invite your to contribute a variant of vxi11_discover() that works on your platform. Making it 100% portable is likely not possible since platforms like Linux are fading away their IOCTL support for retrieving network interface information (broadcast addresses etc.) in favor of a more efficient netlink mechanism.

By the way, you are looking at some old code there. See https://github.com/lxi/liblxi for latest.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: rhb on November 07, 2017, 01:45:07 am
FWIW I started porting it to Solaris 10 u8.  It's actually nicely written code from the little  I've looked at.  The code I'm using was downloaded from github as a tarball after you started this thread.  So I'm not sure how you can call it old.  Once I've got it running on Solaris, it will work on MacOS and *nix in general. 

if_nameindex() returns all the network interfaces and *is* part of  POSIX  and on Solaris 10 u8 which is so ancient I keep it off the Internet. It's the last Sun released version before it became So Larry's. So as a rough guess, 10 years old.  But nothing can match the Sun/Forte debugger.  Everything else is "flint knives and stone axes".  And I've used probably a dozen different *nix  debuggers.

At the moment I've got lxi_discover() commented out while I deal with other Gnuisms.   Once I've got it to run, I'll fix lxi_discover().

Yes, I'm a grumpy old man.  I've supported over 2 million lines of badly written code that other people inflicted upon the world.  I'm really tired of seeing the same mistakes made over and over again.  IBM created JCL to fix the problem of hard coded filenames.  And of course, *everyone* using JCL knew that everything after a space was a comment because that was the 360 assembler convention. Then 10-20 years later the Motif mob hard coded  xkeysymdb.  After 20+ years I've finally forgotten where. We now have a version of xclock that consumes more memory than most of the computers I've used had available. Your phone needs more horsepower than a Cray YMP.  Ain't progress grand!
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 07, 2017, 02:26:15 am
FWIW I started porting it to Solaris 10 u8.  It's actually nicely written code from the little  I've looked at.  The code I'm using was downloaded from github as a tarball after you started this thread.  So I'm not sure how you can call it old.  Once I've got it running on Solaris, it will work on MacOS and *nix in general. 

Sounds good  :-+

Sorry, I meant old as in 5 days old ... the code your are looking at is from before I did some rearrangements to support configurable communication backends (VXI11/TCP vs. RAW/TCP).

if_nameindex() returns all the network interfaces and *is* part of  POSIX  and on Solaris 10 u8 which is so ancient I keep it off the Internet.

Yes, however, getting interface names is not the problem. The problem is going from an interface name or index to actually retrieving the broadcast address in a portable way. I can't find any APIs for this except doing using ioctl() requests which is fine but not really well supported on recent Linux kernels anymore. From the little digging I've done this far I expect we need to do platform handling for this piece of code. I don't recall but I think this is the very reason I did what I did when I wrote this 2-3 years ago, I went with the seemingly most portable implementation.

Yes, I'm a grumpy old man.  I've supported over 2 million lines of badly written code that other people inflicted upon the world.  I'm really tired of seeing the same mistakes made over and over again.  IBM created JCL to fix the problem of hard coded filenames.  And of course, *everyone* using JCL knew that everything after a space was a comment because that was the 360 assembler convention. Then 10-20 years later the Motif mob hard coded  xkeysymdb.  After 20+ years I've finally forgotten where. We now have a version of xclock that consumes more memory than most of the computers I've used had available. Your phone needs more horsepower than a Cray YMP.  Ain't progress grand!

Well, I guess you earned your right to be grumpy ;)

Please bear in mind that I'm doing this open source project among quite a few other open source projects that I maintain in the little spare time I have available, so don't expect everything to be perfect. I simply don't have the time to put the same rigor in this as I do in my professional software projects. That being said, I think it is in a fair shape and with the help from your guys (contributors) I'm sure we can steadily improve it and maybe add some interesting features along the way.

Also, I think we have more views in common than you might think. For example, I share your lack of enthusiasm for perl and python. This is one of the very reasons I created lxi-tools/liblxi - I wanted a proper implementation in C for my LXI instrument control needs.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 07, 2017, 06:41:29 pm
There have been lots of changes and bug fixes recently so I'm pushing new releases which are available for download at https://lxi.github.io

For a summary of changes see:

https://github.com/lxi/lxi-tools/releases/tag/v1.6
https://github.com/lxi/liblxi/releases/tag/v1.4
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 08, 2017, 12:23:37 pm
The *IDN? answer for the last 2 instruments is:
Code: [Select]
rogeorge@debian80:~/lxi-tools$ lxi scpi -a 192.168.1.5 *IDN?
Rigol Technologies,DG4102,DG4E17*,00.01.12
rogeorge@debian80:~/lxi-tools$ lxi scpi -a 192.168.1.4 *IDN?
RIGOL TECHNOLOGIES,DP832,DP8C16*,00.01.11
rogeorge@debian80:~/lxi-tools$

Question, does the rigol screenshot plugin work with these two instruments?

Fun fact, after looking at the screenshot SCPI commands offered by various instruments I have to say that Rigol is by far the one with the most well structured / cleanest SCPI command syntax.  Instruments from the big manufacturers like Tektronix, Keysight, etc. have such cumbersome and illogically named commands. In other words, their syntax is influenced by too much legacy stuff that makes no sense in 2017. They could all do with a good cleanup.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: dpenev on November 08, 2017, 10:08:39 pm
Hello,

I built lxi-tools from git. I get the following error.
What can be wrong?
 
dpenev@yni:~/lxi-tools/lxi-tools$ lxi discover
Searching for LXI devices - please wait...

Broadcasting on interface lo
Broadcasting on interface eth0
    Found "RIGOL TECHNOLOGIES,DS2302,DS2XXXXXXXXXXXXX,00.03.05.SP3" on address 192.168.1.59

Found 1 device

dpenev@yni:~/lxi-tools/lxi-tools$ lxi screenshot -a 192.168.1.59 -m rigol 
Error: Read error (timeout)
Error: Failed to receive message


Thanks
Dimitar
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 08, 2017, 11:07:30 pm
dpenev@yni:~/lxi-tools/lxi-tools$ lxi discover
Searching for LXI devices - please wait...

Broadcasting on interface lo
Broadcasting on interface eth0
    Found "RIGOL TECHNOLOGIES,DS2302,DS2XXXXXXXXXXXXX,00.03.05.SP3" on address 192.168.1.59

Found 1 device

dpenev@yni:~/lxi-tools/lxi-tools$ lxi screenshot -a 192.168.1.59 -m rigol
Error: Read error (timeout)
Error: Failed to receive message

Thanks for the bug report. Apparently retrieving screenshots from the 2000 series scopes differs slightly from the 1000 series.

To solve this I've made separate plugins for each series.

Try update to the latest lxi-tools git and use the "rigol-2000" model.

Let me know if it works or fails. Thanks.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: dpenev on November 09, 2017, 08:39:41 am
Hi Lundmar,

Thank you for the fast update

lxi screenshot -a 192.168.1.59 -m rigol-2000 #Works fine now

I have following extra questions. Not sure which are important taking the current development plan in mind

1. Can there be a option for png instead of bmp? png are smaller.

2. The following doesn't work
dpenev@yni:~$ lxi scpi -ra 192.168.1.59 -m rigol-2000 "CHAN1 DISP?"
lxi: invalid option -- 'm'
dpenev@yni:~$ lxi scpi -ra 192.168.1.59  "CHAN1 DISP?"             
Error: Timeout
Error: Failed to receive message
Can I send scpi commands to my DS2000

3. I have Siglent SSA3021X instrument.
lxi screenshot -a 192.168.1.59  #Doesn't work for it. Is it a big deal to add support?

4. Few other test samples
lxi screenshot -m rigol-1000 #doesn't work for DP832.
lxi scpi -a 192.168.1.60  "*IDN?" #OK for my DP832.

It is interesting that for the DP832 If I send wrong scpi command I see "Wrong command" on the instrument display and I can not get any response from now on unless i reboot DP832. Is it a problem of DP832?

In general I think lxi-tools is a very good tool!
I  hope soon it will grow to support more instruments.
It can be a backbone for a real lab automation.
I really hate the big NI VISA drivers and stuff ... 

Thanks
Dimitar   
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 09, 2017, 10:55:11 am
lxi screenshot -a 192.168.1.59 -m rigol-2000 #Works fine now

1. Can there be a option for png instead of bmp? png are smaller.

The image format depends on which formats the instrument supports. PNG is certainly the preferred format but not all instruments support it. The Rigol 2000 series supports PNG for internal storage of screenshots but it is not documented whether it is possible to retrieve PNG remotely. Please try out the '"rigol_2000_png" branch and let me know if it creates a proper PNG for you. If not I'm afraid it is not possible unless the lxi tool itself starts doing BMP->PNG conversion but I think that is a bad idea. I would rather provide the raw material straight from the instrument and then the user can do as they please.

2. The following doesn't work
dpenev@yni:~$ lxi scpi -ra 192.168.1.59 -m rigol-2000 "CHAN1 DISP?"
lxi: invalid option -- 'm'

Correct. The scpi command does not accept '-m'. Only the screenshot command requires this in order to use the corresponding screenshot plugin.

See 'lxi --help' or 'man lxi' to see which options applies to which command.

dpenev@yni:~$ lxi scpi -ra 192.168.1.59  "CHAN1 DISP?"             
Error: Timeout
Error: Failed to receive message
Can I send scpi commands to my DS2000

Yes, I expect so. Please try without the '-r' option. The raw option is faster but also less reliable because it uses basic RAW/TCP instead of the VXI11/TCP. Perhaps the instrument has crashed maybe due to an invalid command in which case the instrument has a hard time to recover in case of RAW/TCP (handled better by VXI11).

3. I have Siglent SSA3021X instrument.
lxi screenshot -a 192.168.1.59  #Doesn't work for it. Is it a big deal to add support?

If the instrument is LXI compatible, that is, it supports the VXI11/TCP protocol then it should just work.

However, it is not clear to me which Siglent instruments supports VXI11. The documentation for Siglent instruments seem sparse on this topic.

It is possible this instrument does not support VXI11 in which case you might want to try the --raw option instead and maybe in combination with --raw-port if the default port differs from 5555. You might have to do some digging to figure out what port is used (if used at all).

Actually, I've been in contact with Siglent asking if they would like to support the project with some of their instruments for testing so that we can make the tools work with their instruments. Sadly, I haven't heard from them yet. Feel free to write Siglent and ask them to support this project. I think there is a Siglent support thread in this forum where they are listening ;)

4. Few other test samples
lxi screenshot -m rigol-1000 #doesn't work for DP832.

I wouldn't expect it to since the plugin is tailored for the 1000z series scopes.

I took a quick look at the DP800 programmers manual and I couldn't find any evidence that it supports remote screenshot downloads so I'm afraid it is not possible to create a working plugin for this series unless there is an undocumented screenshot feature that I'm not aware of.


lxi scpi -a 192.168.1.60  "*IDN?" #OK for my DP832.

It is interesting that for the DP832 If I send wrong scpi command I see "Wrong command" on the instrument display and I can not get any response from now on unless i reboot DP832. Is it a problem of DP832?

Please try make sure _not_ to use the raw option in this case. We know that Rigol has issues with stalling invalid commands which ends up blocking the RAW/TCP channel. With VXI11/TCP the client tells the instrument that commands are executed under a certain timeout and it handles it accordingly so you can continue to send commands. With RAW/TCP there is no such mechanism.

In general I can't recommend using the --raw option unless you really need the performance gain.

In general I think lxi-tools is a very good tool!
I  hope soon it will grow to support more instruments.
It can be a backbone for a real lab automation.
I really hate the big NI VISA drivers and stuff ... 

Thanks
Dimitar

Thank you. Yes, I think you can get a long way with lxi-tools for convenient commandline operations. liblxi can also be quite useful if you are in need of a simple programmers API for your LXI instrument control needs. Hopefully it can grow into something useful for people who don't like the proprietary and often inferior tools. The very reason I authored lxi-tools/liblxi is because I wanted better tools for my GNU/Linux system. Also, I agree, stuff like NI VISA drivers etc. are just too bloated for my taste and not really open source friendly. I think we can do better. After all, LXI is an open standard so why not make some proper open source tools to support it  :)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: borjam on November 09, 2017, 11:12:53 am
Anger is not the correct word.  Annoyed is more accurate.  I hate seeing unportable code that could trivially have been written to be portable to any Unix system.   I've had to fix far too much of it.

(Warning, @Ludmar, not criticizing you although I really hope this can help instill a bit more love for portability!) ;)

I bear your pain, dude.

And some Linux militant attitude certainly doesn't help. This week I sent a pull request to the OpenVSwitch project. A really stupidest, trivialest portability issue that certainly won't make me win an ACM Turing award.

What really annoyed me was the comment by the developer who accepted the pull request: "Ugh, another place that FreeBSD makes builds gratuitously fail."

A source file included <netinet/icmp6.h>, which, as usual, needs definitions from <sys/types.h>.

The original source looked like this:

Code: [Select]
#include <config.h>
#include <ctype.h>
#include <errno.h>
#include <netinet/in.h>
#include <netinet/icmp6.h>
#include <string.h>
#include <sys/types.h>

And it barfed on FreeBSD because <sys/types.h> is not included from <netinet/icmp6.h>. On Linux it is, it seems. What I
find really curious is that useless <sys/types.h> after <string.h> given that it's been included from <netinet/icmp6.h>.
<netinet/icmp6.h> actually includes <string.h>, <sys/types.h> and so on.

The fix for FreeBSD, OS X and presumably other *BSD derived networking code (anything but Linux, despite being *BSD
derived but sometimes seemingly butchered for the sake of it) was trivial, hence my shiny ACM Turing award. Just moving the <sys/types.h> to a position before <netinet/icmp6.h>. It always makes sense to put the #include lines more or less in a generalistic
to specialized order, so I moved it after <errno.h> (should have been ctypes.h but I was in "let's make this just work" mode and
I didn't give it a second thought).

Now, in the Linux world it seems to be customary to have system include files include themselves everything they need. I know
that lots of #include lines are annoying, but even if you are careful with #ifdef barriers and such I find it much better to have the programmer add the proper includes in the right order, so that you won't find portability surprises. But the Linux folks decided to somewhat hide all this...

Anyway what I found really annoying was the "Hey, FreeBSD breaking stuff" attitude. Linux manierism zealots don't help open source software at all, which is a pity.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 09, 2017, 12:14:39 pm
(Warning, @Ludmar, not criticizing you although I really hope this can help instill a bit more love for portability!) ;)

I don't want to :horse: but let me make it clear anyway since this topic keeps popping up. I'm fully aware what it takes to make portable programs and I'm all for it. However, one has to start somewhere and in my case it means starting out making it work on the most popular platform and the one that I'm using - thats why I put the GNU/Linux stipulations on the projects. Since this is a project I'm doing in my sparse spare time I wanted to focus on features rather than portability to begin with. That being said, I welcome anyone who would like to contribute to the project by improving the code, and that includes fixing any portability issues also. I expect eventually we will remove the GNU/Linux stipulations once the portability issues have been addressed (the few that there are).

It's always easier to criticize than actually do ;)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: HoracioDos on November 09, 2017, 12:51:51 pm
I think you shouldn't give away your work, code it your own way and sell it.
Microsoft, Oracle, IBM have a proven business model. (We do what we want and not what you need and we charge for it)
PD: You should include a "Call Home" feature and sell usage stats. By the way I would donate a good red wine for Tio!
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 09, 2017, 01:13:49 pm
By the way I would donate a good red wine for Tio!

Ha ha, well - I'm glad you like tio ;) It's just a small no-nonsense serial tty tool with a simplified interface and a few useful features. Less is more.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: borjam on November 09, 2017, 01:23:36 pm
Ha ha, well - I'm glad you like tio ;) It's just a small no-nonsense serial tty tool with a simplified interface and a few useful features. Less is more.
Speaking of what I might feel inclined to send a bottle of Spanish red wine northwards ;)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 09, 2017, 01:32:19 pm
Speaking of what I might feel inclined to send a bottle of Spanish red wine northwards ;)

Guys don't send me that much red wine as I'm not much of a wine drinker. However, I'll accept some of that fine Argentinian beef and Spanish chorizo ha ha :D
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: dpenev on November 09, 2017, 07:11:58 pm

1. Can there be a option for png instead of bmp? png are smaller.

The image format depends on which formats the instrument supports. PNG is certainly the preferred format but not all instruments support it. The Rigol 2000 series supports PNG for internal storage of screenshots but it is not documented whether it is possible to retrieve PNG remotely. Please try out the '"rigol_2000_png" branch and let me know if it creates a proper PNG for you. If not I'm afraid it is not possible unless the lxi tool itself starts doing BMP->PNG conversion but I think that is a bad idea. I would rather provide the raw material straight from the instrument and then the user can do as they please.
I have tested the rigol_2000_png branch. It produce file with png extension but it is actually a bit map, same size, BMP header. 

2. The following doesn't work
dpenev@yni:~$ lxi scpi -ra 192.168.1.59 -m rigol-2000 "CHAN1 DISP?"
lxi: invalid option -- 'm'

Correct. The scpi command does not accept '-m'. Only the screenshot command requires this in order to use the corresponding screenshot plugin.

See 'lxi --help' or 'man lxi' to see which options applies to which command.

dpenev@yni:~$ lxi scpi -ra 192.168.1.59  "CHAN1 DISP?"             
Error: Timeout
Error: Failed to receive message
Can I send scpi commands to my DS2000

Yes, I expect so. Please try without the '-r' option. The raw option is faster but also less reliable because it uses basic RAW/TCP instead of the VXI11/TCP. Perhaps the instrument has crashed maybe due to an invalid command in which case the instrument has a hard time to recover in case of RAW/TCP (handled better by VXI11).

Yes without -r I seems to get better results, thank you.

3. I have Siglent SSA3021X instrument.
lxi screenshot -a 192.168.1.59  #Doesn't work for it. Is it a big deal to add support?

If the instrument is LXI compatible, that is, it supports the VXI11/TCP protocol then it should just work.

However, it is not clear to me which Siglent instruments supports VXI11. The documentation for Siglent instruments seem sparse on this topic.

It is possible this instrument does not support VXI11 in which case you might want to try the --raw option instead and maybe in combination with --raw-port if the default port differs from 5555. You might have to do some digging to figure out what port is used (if used at all).

Actually, I've been in contact with Siglent asking if they would like to support the project with some of their instruments for testing so that we can make the tools work with their instruments. Sadly, I haven't heard from them yet. Feel free to write Siglent and ask them to support this project. I think there is a Siglent support thread in this forum where they are listening ;)
The Siglent SSA3000 programing manual is at http://www.siglentamerica.com/USA_website_2014/Documents/Program_Material/SSA3000X_ProgrammingGuide_PG0703X_E03D.pdf (http://www.siglentamerica.com/USA_website_2014/Documents/Program_Material/SSA3000X_ProgrammingGuide_PG0703X_E03D.pdf)

Some results below which probably answers some of the questions you have defined ?
dpenev@yni:~/lxi-tools$ lxi scpi -a 192.168.1.61  "*IDN?"     
Siglent Technologies,SSA3032X,SSA3XXXXXXXXXXXXX,1.2.8.5a
dpenev@yni:~/lxi-tools$ lxi scpi -a 192.168.1.61  ":SYSTem:TIME?"
024429
dpenev@yni:~/lxi-tools$ lxi scpi -a 192.168.1.61  ":SYSTem:DATE?"
20171110
dpenev@yni:~/lxi-tools$ lxi scpi -a 192.168.1.61  "FREQuency:STAR?"
+1.2560000000E+07
dpenev@yni:~/lxi-tools$ lxi scpi -a 192.168.1.61  "FREQuency:STOP?"
+2.2560000000E+07
dpenev@yni:~/lxi-tools$ lxi scpi -a 192.168.1.61  ":MMEMory:STORe"
dpenev@yni:~/lxi-tools$ lxi screenshot -a 192.168.1.61
Error: Missing model
dpenev@yni:~/lxi-tools$ lxi screenshot -a 192.168.1.61 -m rigol-2000
Error: Failed to receive message
dpenev@yni:~/lxi-tools$ lxi screenshot -a 192.168.1.61 -m rigol-1000
Error: Failed to receive message
dpenev@yni:~/lxi-tools$ 

It seems ":MMEMory:STORe" can capture the screen but not sure if the data can be retreated remotely. 

4. Few other test samples
lxi screenshot -m rigol-1000 #doesn't work for DP832.

I wouldn't expect it to since the plugin is tailored for the 1000z series scopes.

I took a quick look at the DP800 programmers manual and I couldn't find any evidence that it supports remote screenshot downloads so I'm afraid it is not possible to create a working plugin for this series unless there is an undocumented screenshot feature that I'm not aware of.

I see

lxi scpi -a 192.168.1.60  "*IDN?" #OK for my DP832.

It is interesting that for the DP832 If I send wrong scpi command I see "Wrong command" on the instrument display and I can not get any response from now on unless i reboot DP832. Is it a problem of DP832?

Please try make sure _not_ to use the raw option in this case. We know that Rigol has issues with stalling invalid commands which ends up blocking the RAW/TCP channel. With VXI11/TCP the client tells the instrument that commands are executed under a certain timeout and it handles it accordingly so you can continue to send commands. With RAW/TCP there is no such mechanism.

In general I can't recommend using the --raw option unless you really need performance gain.

I see

Thank you
Dimitar
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 09, 2017, 07:53:05 pm
I have tested the rigol_2000_png branch. It produce file with png extension but it is actually a bit map, same size, BMP header. 

Ok. Then it does not look like it is possible to download a PNG screenshot. BMP will have to do for the 2000 series.

The Siglent SSA3000 programing manual is at http://www.siglentamerica.com/USA_website_2014/Documents/Program_Material/SSA3000X_ProgrammingGuide_PG0703X_E03D.pdf (http://www.siglentamerica.com/USA_website_2014/Documents/Program_Material/SSA3000X_ProgrammingGuide_PG0703X_E03D.pdf)

Some results below which probably answers some of the questions you have defined ?
dpenev@yni:~/lxi-tools$ lxi scpi -a 192.168.1.61  "*IDN?"     
Siglent Technologies,SSA3032X,SSA3XXXXXXXXXXXXX,1.2.8.5a
dpenev@yni:~/lxi-tools$ lxi scpi -a 192.168.1.61  ":SYSTem:TIME?"
024429
dpenev@yni:~/lxi-tools$ lxi scpi -a 192.168.1.61  ":SYSTem:DATE?"
20171110
dpenev@yni:~/lxi-tools$ lxi scpi -a 192.168.1.61  "FREQuency:STAR?"
+1.2560000000E+07
dpenev@yni:~/lxi-tools$ lxi scpi -a 192.168.1.61  "FREQuency:STOP?"
+2.2560000000E+07
dpenev@yni:~/lxi-tools$ lxi scpi -a 192.168.1.61  ":MMEMory:STORe"
dpenev@yni:~/lxi-tools$ lxi screenshot -a 192.168.1.61
Error: Missing model
dpenev@yni:~/lxi-tools$ lxi screenshot -a 192.168.1.61 -m rigol-2000
Error: Failed to receive message
dpenev@yni:~/lxi-tools$ lxi screenshot -a 192.168.1.61 -m rigol-1000
Error: Failed to receive message
dpenev@yni:~/lxi-tools$ 

It seems ":MMEMory:STORe" can capture the screen but not sure if the data can be retreated remotely. 

I did a quick scan through the manual and it does not seem like there is any documented ways to download a screenshot. Yes, you can store screenshots in the local memory subsystem but there are no ways to download that file remotely either. It's a bit silly they don't support such useful feature. Also, the description of each SCPI command is quite lacking. So, unfortunately it seems it will not be possible to create a screenshot plugin to support this Siglent instrument. I guess the only positive thing here is that sending scpi commands to the instrument works fine.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: dpenev on November 09, 2017, 08:14:14 pm
Indeed,

BTW did you get some useful information from silentna about screen capture from their oscilloscopes?

Thanks
Dimitar
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 09, 2017, 08:19:44 pm
Indeed,

BTW did you get some useful information from silentna about screen capture from their oscilloscopes?

Thanks
Dimitar

No useful details. SDS1000X/SDS2000X are claimed to support screenshots but without instruments to test on I'm going to focus on other features and instruments.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 10, 2017, 02:03:38 pm
Feature request 6.3. - make model optional, and auto identify the model using the IP and *IDN?

Thanks for this good idea feature request :-+ . I've implemented it in https://github.com/lxi/lxi-tools/commit/4b07a40e1c07afb099b0842a34e1f01e8031b462

This means that the lxi tool can now be used like this:
Code: [Select]
$ lxi screenshot --address 192.168.1.210
Loaded rigol-1000 screenshot plugin
Saved screenshot image to screenshot_192.168.1.210_2017-11-10_16:07:48.png

The way it works is that it retrieves the ID string of the instrument and matches that against regular expressions provided in each plugin. The plugin with most matches is selected. Using regular expression matching is quite powerful so I expect this will work fine for future needs. Currently, only the Rigol plugins work with this feature as they are the only ones defining useful .regex entries. The other plugins will have to follow when someone shows up with real instruments that can be tested.

Also, I've done away with any model vs. plugin confusion and simplified the interface to manually specify which screenshot plugin to use:
Code: [Select]
$ lxi screenshot --address 192.168.1.210 --plugin rigol-1000
Saved screenshot image to screenshot_192.168.1.210_2017-11-10_16:08:36.png

Feature request 6.5. - add an option for instrument ID in the filename (can be more than just 1 oscilloscope on the same network, so after a save there is no way to identify where from is the captured screen)

I've implemented a compromise solution in https://github.com/lxi/lxi-tools/commit/080681f7af460b47c24ad09f46809fa65c5cb687

Trying to add unique instrument ID in the screenshot filename is troublesome because the IDN strings have no strictly guaranteed format (only guidelines) so we can run into all sorts of trouble trying to render something useful from it. Hence the alternative solution is to simply embed the instrument IP in the screenshot filename to help tell from which instrument screenshot files originate. It's not an unique identifier but it is sufficient for most use cases.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 11, 2017, 02:16:10 pm
Some important features and bug fixes have been added so I'm releasing a new version of lxi-tools:
https://github.com/lxi/lxi-tools/releases/download/v1.7/lxi-tools-1.7.tar.xz

For a summary of changes please see:
https://github.com/lxi/lxi-tools/releases/tag/v1.7

Thanks to especially RoGeorge for his thorough testing and useful feature requests. Also thanks to dpenev for his testing and help fixing the rigol-2000 screenshot plugin. I've added the instruments that you guys have tested working in the list of tested instruments in the README of lxi-tools.

P.S.: I want to add you guys to the list of contributors in the AUTHORS file. If you are ok with that, please let me know.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 12, 2017, 02:32:10 pm
I've refined and added some more information to the original post that started this thread. People might find it useful information.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: dpenev on November 13, 2017, 09:18:39 pm
Hello,

A bit off topic but can be useful for someone .

I have SSA3021X and inspired by the lxi-tool I have implemented procedure to capture the instrument screen from a PC.
It uses lxi-tool to send ":MMEMory:STORe" command
and telnet to download the file.
I hope Siglent will implement a way to transfer a file using scpi command so this script will become unnecessary

extract the two scripts from the tar in a directory
from this directory execute
Code: [Select]
./ssa3000x_print print.png
Note that you need to specify the file name with the extension png.
I guess each time new file name is required. 
Files with path is not supported.

The shell scrip is not polished but is working for me.
Feel free to improve and please share.

Thanks
Dimitar   
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 13, 2017, 10:01:15 pm
I hope Siglent will implement a way to transfer a file using scpi command so this script will become unnecessary

I hope so too. It's quite the detour to have to go manually retrieve the screenshot file like that through the back channel but nice job getting there ;)

You should request Siglent to create a new firmware for the SSA3000 so that it becomes possible to simply dump the screenshot directly via the VXI11 channel. It would be faster and more elegant and should be trivial for them to implement.

I like the fact they are using TI AM335x but its funny to see how they did not remove the traces of the "evm" strings.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 14, 2017, 11:45:56 am
I've pushed a new release of lxi-tools which adds a screenshot plugin for the new Siglent SDS1000X series scopes:

https://github.com/lxi/lxi-tools/releases/tag/v1.8

It's experimental, that is, it is not tested. If anyone has such an instrument feel free to try it out and let me know if it works. Thanks.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 15, 2017, 11:26:45 pm
3. I have Siglent SSA3021X instrument.
lxi screenshot -a 192.168.1.59  #Doesn't work for it. Is it a big deal to add support?

Update: I've added a screenshot plugin for the Siglent SSA3000X series spectrum analyzers.

It does not do a full screen capture but it captures the inner frame of interest, that is, the signal data window. Please try it out and let me know if it works.

Thanks to Jason from Siglent for providing the info necessary to create the plugin.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: dpenev on November 18, 2017, 03:58:07 pm
Hi lundmar,

I have tested it from the git master and I get empty bmp.
I have checked  your plugin and I saw that you are not using the response from SCPI command or do I miss something?
In case this is a bug please check  screenshot_siglent-sds1000x.c as well.

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 18, 2017, 04:09:59 pm
I have checked  your plugin and I saw that you are not using the response from SCPI command or do I miss something?
In case this is a bug please check  screenshot_siglent-sds1000x.c as well.

You are correct. I have pushed a fix for both Siglent screenshot plugins. Thanks.

FYI - I'm currently working on improving the discover feature by searching for instrument services using mDNS/DNS-SD. I'm curious if it will work with Siglent instruments because I know that the classic VXI11 discover feature that we support now does not work.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: dpenev on November 18, 2017, 04:24:41 pm
Hello

Still the following doesn't work
 
lxi screenshot -a 192.168.1.61 -p siglent-ssa3000x /share/scr3.png
I am sending you the file I get


at my side
lxi discover
Searching for LXI devices - please wait...

Broadcasting on interface lo
Broadcasting on interface eth0
    Found "Siglent Technologies,SSA3032X,SSA3XXXXXXXXXX,1.2.8.5a" on address 192.168.1.61

Found 1 device
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 18, 2017, 04:45:23 pm
lxi screenshot -a 192.168.1.61 -p siglent-ssa3000x /share/scr3.png
I am sending you the file I get

Hmm, does not look like a bitmap. I've pushed a new change to test. Can you try it out and send me a new file? Thanks.

Also, can you try without the -p option, just to see if it automatically loads the correct plugin.

at my side
lxi discover
Searching for LXI devices - please wait...

Broadcasting on interface lo
Broadcasting on interface eth0
    Found "Siglent Technologies,SSA3032X,SSA3XXXXXXXXXX,1.2.8.5a" on address 192.168.1.61

Found 1 device

Oh great. I was told by Siglent that some of their instruments may not discover but it could be a tool issue. Apparently the recent SSA and presumably also SDS works fine with the lxi-tools discover feature. Either way, we will soon have a discover --mdns option which will allow for finding even more instruments, in particular next gen LXI instruments
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 18, 2017, 09:09:43 pm
FYI - I've released new versions of liblxi and lxi-tools which add support for searching for LXI instruments using mDNS/DNS-SD as described by the most recent LXI device specification.

This means it is now possible to discover modern LXI instruments that do not support the older VXI-11 discover mechanism.

To search for LXI instruments using mDNS/DNS-SD simply add the --mdns option to the discover command like so:

Code: [Select]
$ lxi discover --mdns
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: dpenev on November 18, 2017, 10:57:34 pm
Hi Lundmar

With the latest liblxi and lxi-tools I get:

root@yni:/home/dpenev/lxi-tools/lxi-tools# lxi discover --mdns
lxi: unrecognized option '--mdns'
root@yni:/home/dpenev/lxi-tools/lxi-tools# lxi discover
Searching for LXI devices - please wait...

Error: Unknown discover type (532306400)

No devices found

root@yni:/home/dpenev/lxi-tools/lxi-tools#
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 18, 2017, 11:15:54 pm
Hi Lundmar

With the latest liblxi and lxi-tools I get:

root@yni:/home/dpenev/lxi-tools/lxi-tools# lxi discover --mdns
lxi: unrecognized option '--mdns'
root@yni:/home/dpenev/lxi-tools/lxi-tools# lxi discover
Searching for LXI devices - please wait...

Error: Unknown discover type (532306400)

No devices found

root@yni:/home/dpenev/lxi-tools/lxi-tools#

It looks like you are not running latest version of lxi-tools. I assume you are pulling the latest from git? Perhaps you forgot to run make install?

Both liblxi and lxi-tools must match latest versions.

Also, for the new feature to work you must install libavahi-core-dev libavahi-common-dev libavahi-client-dev
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: dpenev on November 23, 2017, 10:45:02 am
Hello,

I tried the latest version

"lxi discover" is working for my Rigol DS2000 scope and my Siglent SSA3000 amalyzer

dpenev@yni:~/lxi-tools/lxi-tools$ lxi discover --mdns
Searching for LXI devices - please wait...

No services found

Should I start something on my PC?

Screenshot for SSA3000  doesn't work at my side
lxi screenshot -a 192.168.1.61 -p siglent-ssa3000x scr10.png

I am attaching two files I get with line like the above.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 23, 2017, 12:16:38 pm
I tried the latest version

"lxi discover" is working for my Rigol DS2000 scope and my Siglent SSA3000 amalyzer

Great. Thanks for testing  :-+

dpenev@yni:~/lxi-tools/lxi-tools$ lxi discover --mdns
Searching for LXI devices - please wait...

No services found

Should I start something on my PC?

No, its fine. It simply means that these particular instruments do not advertise their presence using mDNS. It's a relatively new feature that many LXI instruments do not support yet.

Screenshot for SSA3000  doesn't work at my side
lxi screenshot -a 192.168.1.61 -p siglent-ssa3000x scr10.png

I am attaching two files I get with line like the above.

Yeah, the files still look like they contain rubbish. There is a pattern but it is certainly not PNG. Perhaps I'm missing some SCPI commands to reconfigure the instrument for PNG image format. I will talk to Siglent to check if I'm missing something here.

By the way, could you please try firing the following command:
Code: [Select]
lxi screenshot -a 192.168.1.61

And tell me if it autodetects the correct screenshot plugin ("siglent-ssa3000x"). Thanks.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 23, 2017, 05:43:50 pm
I have added some plugins for Rigol devices, the changed files are in the tar archive.
I can't handle git yet.

Peter

pedre@debian:~/Programme/lxi/bin$ ./lxi screenshot --list
            Name   Description
keysight-iv2000x   Keysight InfiniVision 2000X series oscilloscopes (experimental)
      rigol-1000   Rigol DS/MSO 1000z series oscilloscopes
      rigol-2000   Rigol DS/MSO 2000 series oscilloscopes
    rigol-dg4000   Rigol DG4000 series function generator
    rigol-dm3000   Rigol DM3000 series digital multimeter
     rigol-dp800   Rigol DP800 series power supply
    rigol-dsa800   Rigol DSA800 series spectrum analyzer
    rigol-dsa700   Rigol DSA700 series spectrum analyzer
      rs-hmo1000   Rohde & Schwarz HMO 1000 series oscilloscopes (experimental)
siglent-sds1000x   Siglent SDS 1000X series oscilloscopes (experimental)
siglent-ssa3000x   Siglent SSA 3000X series spectrum analyzers (experimental)
  tektronix-2000   Tektronix DPO/MSO 2000 series oscilloscopes (experimental)

Edit: tar archiv  new uploaded

Thanks Peter, good stuff  :-+

I've merged your files and made a git commit on your behalf. See https://github.com/lxi/lxi-tools/commit/c0a4199c50f819e069d96285b7de89be927b8cb6

I would like to add you to the contributor list in the AUTHORS file (see https://github.com/lxi/lxi-tools/blob/master/AUTHORS ). I can add you as "PeDre from EEVBlog forum" or by name/email like the others listed. Please let me know what you prefer. Thanks.

Also, have you tested any of the plugins? If not, I will add "(experimental)" to the plugin descriptions.

Isn't it fascinating to see the many different ways Rigol do screenshot SCPI commands? Consistency across products is apparently not a thing at Rigol he he. However, I don't think other manufacturers do much better.

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: dpenev on November 23, 2017, 06:04:37 pm
the plugin for SSA3000x is automatically recognized, see bellow

dpenev@yni:~/lxi-tools/lxi-tools$ sudo lxi screenshot -a 192.168.1.61
Loaded siglent-ssa3000x screenshot plugin
Saved screenshot image to screenshot_192.168.1.61_2017-11-23_19:56:10.bmp
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 23, 2017, 06:12:54 pm
The DM3068 is simulated, with my own programmed LXI server.
The DSA700 is identical to the DSA800.
The other devices have been tested.

Peter

Code: [Select]
pedre@debian:~/Programme/lxi/bin$ ./lxi discover
Searching for LXI devices - please wait...

Broadcasting on interface lo
Broadcasting on interface enp2s0
  Found "Rigol Technologies,DG4162,DG4D135100282,00.01.12" on address 192.168.1.54
  Found "RIGOL TECHNOLOGIES,DP831,DP8F174900273,00.01.14" on address 192.168.1.55
  Found "RIGOL TECHNOLOGIES,MSO2302A,DS2F161650093,00.03.05.SP3" on address 192.168.1.52
  Found "Rigol Technologies,DM3068,DM301513679735,01.01.00.01.07.00" on address 192.168.1.37
  Found "Rigol Technologies,DSA815,DSA8A143300837,00.01.18.00.02" on address 192.168.1.51
  Found "RIGOL TECHNOLOGIES,DS1104Z,DS1ZB161150038,00.04.04.SP3" on address 192.168.1.53

Found 6 devices

pedre@debian:~/Programme/lxi/bin$ ./lxi screenshot -a 192.168.1.54
Loaded rigol-dg4000 screenshot plugin
Saved screenshot image to screenshot_192.168.1.54_2017-11-23_18:53:19.bmp

pedre@debian:~/Programme/lxi/bin$ ./lxi screenshot -a 192.168.1.55
Loaded rigol-dp800 screenshot plugin
Saved screenshot image to screenshot_192.168.1.55_2017-11-23_18:52:03.bmp

pedre@debian:~/Programme/lxi/bin$ ./lxi screenshot -a 192.168.1.37
Loaded rigol-dm3000 screenshot plugin
Saved screenshot image to screenshot_192.168.1.37_2017-11-23_18:52:23.bmp

pedre@debian:~/Programme/lxi/bin$ ./lxi screenshot -a 192.168.1.51
Loaded rigol-dsa800 screenshot plugin
Saved screenshot image to screenshot_192.168.1.51_2017-11-23_18:52:50.bmp
[/code]

Great, thanks. Then I will simply consider them all non-experimental and also add your instrument models to the list of tested instruments.

Your own LXI server? (VXI-11 or RAW?) Sounds interesting - is it something publicly available? What language is it written in?

FYI - I'm currently writing a full blown HiSlip/TCP client/server library in C so we can have first class open source HiSlip support on GNU/Linux systems and in particular lxi-tools of course.

Btw., you din't tell me how you would like to be added in the AUTHORS file.

Thanks.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 23, 2017, 06:17:46 pm
the plugin for SSA3000x is automatically recognized, see bellow

dpenev@yni:~/lxi-tools/lxi-tools$ sudo lxi screenshot -a 192.168.1.61
Loaded siglent-ssa3000x screenshot plugin
Saved screenshot image to screenshot_192.168.1.61_2017-11-23_19:56:10.bmp

Great, thanks. At least we know that feature works.

I'll get back to you once I get a response from Siglent on exactly what SCPI commands are required for PNG capture.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 23, 2017, 10:08:07 pm
The server is programmed in Xojo for Windows and uses VXI-11.
Was only programmed for a test for my screen capture program.
http://peter.dreisiebner.at/rigol-bildschirmkopie-lan/ (http://peter.dreisiebner.at/rigol-bildschirmkopie-lan/)

Nice. I don't know much of xojo but it looks cool.

I don't need to be named as an author.

Too late, I've already added you as "PeDre from EEVBlog forum" in the contributor section :)

I think it is best to do so on principle to show it is not a one man show and also to put credit where credit is due.

@RoGeorge, @depenev : I've also added both of you by EEVBlog nickname. I appreciate all the testing and ideas you guys have contributed - it has allowed me to vastly improve the tool over the last few weeks.

After all, I think it is appropriate since it is thanksgiving day in some parts of the world today ;)

(https://gallery.yopriceville.com/var/resizes/Free-Clipart-Pictures/Thanksgiving-PNG/Transparent_Happy_Turkey_Day_Clipart.png?m=1434276589)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 23, 2017, 10:23:44 pm
The DSA700 is identical to the DSA800.
The other devices have been tested.

By the way, is there any chance any of the devices you have tested can be reconfigured for PNG screenshot download?

PNG is the preferred image format for the plugins so if it is possible that would be great. I know that DS2000 series only supports BMP for some unknown reason.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 24, 2017, 04:20:19 am
FYI - I've made new releases. This time it is mostly documentation updates but also a bunch of new Rigol screenshot plugins thanks to PeDre.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 24, 2017, 07:40:46 am
The DSA800 can also handle screen shots in PNG format, but takes twice as long to do so.
The Rigol devices are fastest with the BMP format.
It is better to change the format when saving.

Ok, I see. I thought PNG would be faster because of the smaller size but obviously the image compression is too costly in time for whatever CPU Rigol is using. Lets just keep it as it is then.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: 3hristian on November 25, 2017, 08:59:35 am
Howdy,

I keep running into issues with LXI-TOOLS...
so far support from Lundar has been great. Jet spamming GitHub with issues that might only be my system isn't too great.

I have been following install instructions on this forum jet I got stuck here:
after installing LIB, and TOOLS trying to start the program on the command line.
Code: [Select]
$ lxi --help
lxi: error while loading shared libraries: liblxi.so.1: cannot open shared object file: No such file or directory

i am running
Code: [Select]
Linux LAB 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Or
Code: [Select]
Linux Mint 18.1 Cinnamon 64-bit if that floats your goat.

As solving this issue has many solutions hence I wanted to ask first before fumbling around.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 25, 2017, 12:37:08 pm
Howdy,

I keep running into issues with LXI-TOOLS...
so far support from Lundar has been great. Jet spamming GitHub with issues that might only be my system isn't too great.

I have been following install instructions on this forum jet I got stuck here:
after installing LIB, and TOOLS trying to start the program on the command line.
Code: [Select]
$ lxi --help
lxi: error while loading shared libraries: liblxi.so.1: cannot open shared object file: No such file or directory

i am running
Code: [Select]
Linux LAB 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Or
Code: [Select]
Linux Mint 18.1 Cinnamon 64-bit if that floats your goat.

As solving this issue has many solutions hence I wanted to ask first before fumbling around.

Hi 3hristian,

No worries, you just keep spamming github as much as you like - that is what is what the issue tracker is for ;)

I'm sorry about your installation issue - luckily it's a temporary situation. I'm working on getting lxi-tools/liblxi into Debian so that they will eventually be included in distributions like Ubuntu and Mint. This way users don't have to bother with the challenges of manual installation. Currently software packages are being updated for Fedora. I hope to find a lxi-tools/liblxi maintainer for Debian soon.

Assuming you followed the git install instructions in the top of this thread to the letter then you shouldn't run into any issues with lxi-tools not finding liblxi. However, the issue you see can be bypassed by using for example this command:
Code: [Select]
$ LD_LIBRARY_PATH=$HOME/opt/lxi/lib ./lxi --version
v1.12

Or by simply exporting the variable like so and running the lxi tool:
Code: [Select]
$ export LD_LIBRARY_PATH=$HOME/opt/lxi/lib
$ lxi --version
lxi v1.12

Assuming your install location is $HOME/opt/lxi as suggested in the git install instructions.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 26, 2017, 03:40:10 am
I realize that many people are not comfortable building and installing stuff from source. Unfortunately it takes quite some effort and time to find package maintainers for the various distributions and even then there is usually a large turnaround time to update packages :(

To try bypass these issues I've created a snap for lxi-tools.

This means that it is now possible to install the latest release version of lxi-tools on the most popular distributions like so:

Code: [Select]
$ snap install lxi-tools

The great thing about snaps is that I maintain the snap directly and when I update my lxi-tools snap it will be immediately available for users to install. No delay!  :-+

It's pretty cool, check it out.

I've tested it on Fedora 27 and Ubuntu 17.10 but it should work on various other distributions too (Mint, ArchLinux, Debian, Gentoo, OpenSuse, Manjaro, etc.).

See https://snapcraft.io for how to install snap on your distribution.

P.s.: There is one minor issue though: after installing the lxi-tools snap the tool command is 'lxi-tools.lxi' and not 'lxi'. Will be fixed later.
P.p.s: lxi-tools snap details can be seen here: https://dashboard.snapcraft.io/dev/snaps/8744
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: nctnico on November 26, 2017, 12:28:59 pm
I realize that many people are not comfortable building and installing stuff from source. Unfortunately it takes quite some effort and time to find package maintainers for the various distributions and even then there is usually a large turnaround time to update packages :(
The easy way around that is to pack everything (including libraries) into a distribution independant package like firefox does. A statically linked binary should work well too.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 26, 2017, 01:35:03 pm
I realize that many people are not comfortable building and installing stuff from source. Unfortunately it takes quite some effort and time to find package maintainers for the various distributions and even then there is usually a large turnaround time to update packages :(
The easy way around that is to pack everything (including libraries) into a distribution independant package like firefox does. A statically linked binary should work well too.

That is true. However, there are some advantages to the snap solution because it actually includes and runs lxi-tools inside its own containerized Ubuntu core image runtime that runs specific versions of dynamic services like e.g. avahi that lxi-tools rely on for mDNS/DNS-SD discovery. If I do a static it is likely that the avahi dbus interface protocol will not work on various distributions because of version differences of their avahi daemon. Also, it's a big plus for end users that they can use the simple snap install command to manage their lxi-tools package and when I push updates they will have a super easy way to upgrade ('snap refresh lxi-tools'). In the end, that is simpler than messing with and setting up a static tarball that might or might not work. The snap support will only improve and spread to more distributions so for application distribution this is the future and I'm jumping right in he he. Once I get the last details of my lxi-tools snap sorted out it will be perfect.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 27, 2017, 03:06:24 pm
FYI - it is now possible to install latest development version using snap:

Code: [Select]
$ snap install lxi-tools --edge

The lxi-tools snap from the edge channel automatically follows the latest git version via automatic CI using https://build.snapcraft.io

Also, the lxi-tools snap is now built for the following architectures: amd64, i386, armhf

For those interested, here is the snapcraft configuration for the lxi-tools snap: https://github.com/lxi/lxi-tools.snapcraft
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 27, 2017, 09:37:15 pm
FYI - I've renamed the website from lxi.github.io to lxi-tools.github.io

Also, there are new releases of lxi-tools and liblxi which include latest fixes and documentation changes.

New snaps are also available for instant upgrade. For those who already have lxi-tools snap installed try (note that it might already be automatically updated):
Code: [Select]
snap refresh lxi-tools

Or, if you don't have it installed already, simply:
Code: [Select]
snap install lxi-tools

After snap is installed, you will have to run this command:
Code: [Select]
$ snap alias lxi-tools.lxi lxi

To make the normal 'lxi' command work. Else only 'lxi-tools.lxi' will work. It's a temporary situation until my snap is approved automatic alias support by vote of the snap guys.

I've also created a new logo for the project just to spruce things up a bit :)

If anyone runs into issues installing using snap please let me know. Thanks.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: dpenev on November 28, 2017, 12:55:54 pm
Hi lundmar,

Just to confirm that lxi snap and aliasing seem to be working fine on my Ubuntu 14.04 box.
 
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 28, 2017, 01:24:31 pm
Hi lundmar,

Just to confirm that lxi snap and aliasing seem to be working fine on my Ubuntu 14.04 box.

Thats interesting, I didn't expect snaps to be supported on such old Ubuntu installations but I guess it only demonstrates how powerful snaps are.

Thanks for the feedback :-+

Btw. I haven't heard from Siglent yet regarding the screenshot file format on the SSA3000 - I think most people are off due to extended Thanksgiving holidays.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: dpenev on November 28, 2017, 03:32:24 pm
Oh it is not that old actually but yes I had to install snap demon and it doesn't come pre-installed out of the box 
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 28, 2017, 04:27:35 pm
Oh it is not that old actually but yes I had to install snap demon and it doesn't come pre-installed out of the box

Still impressive though.

Oh by the way, I just got a response from Siglent and they provided me an undocumented SCPI command for doing a full screenshot capture on the SSA3000 series :)

In fact, I've already pushed a fix for the siglent-ssa300x plugin so you will be able  to test it immediately via the snap edge channel:

Code: [Select]
$ snap install lxi-tools --edge

Or, if you have it already installed, you can make sure it is up-to-date and using the edge channel like so:
Code: [Select]
$ snap refresh lxi-tools --edge

Please let me know if the plugin now works for you. You might have to take care to increase the default timeout as the image BMP data is rather large.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: BloodyCactus on November 29, 2017, 01:13:24 am
hmmm

Code: [Select]
> /snap/bin/lxi --version
cannot change current working directory to the original directory: Permission denied

> sudo /snap/bin/lxi --version
cannot change current working directory to the original directory: Permission denied

> cd /tmp
> lxi --version
lxi v1.13

oh, solved my own problem, posting here for posterity. You get the above error if you run it when your in an NFS mounted directory/path.


oh and screenshot fails on hmo-rs1000 (I have hmo1202)
Code: [Select]
> lxi screenshot -p rs-hmo1000 -a scope
Saved screenshot image to screenshot_scope_2017-11-28_19:55:38.png

> file screenshot_scope_2017-11-28_19\:55\:38.png
screenshot_scope_2017-11-28_19:55:38.png: data

you can see the
Code: [Select]
'G' 0D 0A 1A 0A 00 00 00 0D
but we are missing
Code: [Select]
89 50 4E the start of the PNG magic...

(https://i.imgur.com/9JyeH2N.png)

putting in the missing header shows a valid PNG from the scope

Code: [Select]
> file qq.png
qq.png: PNG image data, 640 x 520, 8-bit colormap, non-interlaced

(https://i.imgur.com/9hymMH2.png)

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 29, 2017, 02:16:48 am
hmmm

Code: [Select]
> /snap/bin/lxi --version
cannot change current working directory to the original directory: Permission denied

> sudo /snap/bin/lxi --version
cannot change current working directory to the original directory: Permission denied

> cd /tmp
> lxi --version
lxi v1.13

oh, solved my own problem, posting here for posterity. You get the above error if you run it when your in an NFS mounted directory/path.

Yeah, sorry about that.

It has to do with the way that snaps work. All snaps are running in a security enabled Linux container which means that the snap is only allowed access to certain subsystems. For example, in case of lxi-tools, it can only access your network and home directory (if it was not NFS network mounted). The main upside of having such level of security is that I am allowed to distribute updates quickly and directly to end users without having to go through the slow package update procedures of the various Linux distributions which can take weeks or even months sometimes. And the downsides... well, you just found one he he. That being said, I will investigate if it possible to reconfigure the snap to gain access to network mounted file systems.

oh and screenshot fails on hmo-rs1000 (I have hmo1202)
Code: [Select]
> lxi screenshot -p rs-hmo1000 -a scope
Saved screenshot image to screenshot_scope_2017-11-28_19:55:38.png

> file screenshot_scope_2017-11-28_19\:55\:38.png
screenshot_scope_2017-11-28_19:55:38.png: data

you can see the
Code: [Select]
'G' 0D 0A 1A 0A 00 00 00 0D
but we are missing
Code: [Select]
89 50 4E the start of the PNG magic...

Fixed! Thanks for the detailed debug info. It was very helpful :-+

It's fixed in this commit: https://github.com/lxi-tools/lxi-tools/commit/04a7cbf9a61af9ead886d4a4a29ddc11b61cbe34

The git commit automatically triggers an update of the lxi-tools snap in the edge channel so you should be able to update to it immediately:

Code: [Select]
snap refresh lxi-tools --edge

By the way, can you please try fire this command?

Code: [Select]
$ lxi screenshot -a scope
Which should automatically load the correct screenshot plugin. If it fails please provide me the IDN string of your instrument.

Thanks
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: BloodyCactus on November 29, 2017, 02:49:38 am
Code: [Select]
[ sgeorge @ workstation ] - [ /tmp ] 
[$]> lxi screenshot -a scope
Error: Read error (timeout)
Error: Failed to receive message
Error: Unable to retrieve instrument ID

needs a -p, so here is my IDN

Code: [Select]
Found "Rohde&Schwarz,HMO1202,nnnnnnnnn,05.886"
The "05.886" is firmware version.
The "nnnnnnnnn" is numeric serial number (I blanked mine out).
The "HMO1202" can change, depending on bandwidth ID code installed.

Doing
Code: [Select]
lxi screensscreenshot -p rs-hmo1000 -a scope
Saved screenshot image to screenshot_scope_2017-11-28_21:43:12.png

does not actually put "screenshot_scope_2017-11-28_21:43:12.png" on disk. not in my home directory, or anywhere...

ok. found them in
Code: [Select]
/tmp/snap.1000_lxi-tools_ql0gGm/tmp/
which is
Code: [Select]
drwx------   3 root    sgeorge 4.0K Nov 28 19:50 snap.1000_lxi-tools_ql0gGm
how very strange.

PNG do load correctly tho.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 29, 2017, 03:30:18 am
Code: [Select]
[ sgeorge @ workstation ] - [ /tmp ] 
[$]> lxi screenshot -a scope
Error: Read error (timeout)
Error: Failed to receive message
Error: Unable to retrieve instrument ID

Hmm, strange. I didn't expect it to fail retrieving the ID. Can your please verify that the following command works for you?
Code: [Select]
$ lxi scpi -a scope "*IDN?"

If that also fails please try with IP address instead of 'scope'.

Doing
Code: [Select]
lxi screensscreenshot -p rs-hmo1000 -a scope
Saved screenshot image to screenshot_scope_2017-11-28_21:43:12.png

does not actually put "screenshot_scope_2017-11-28_21:43:12.png" on disk. not in my home directory, or anywhere...

ok. found them in
Code: [Select]
/tmp/snap.1000_lxi-tools_ql0gGm/tmp/
which is
Code: [Select]
drwx------   3 root    sgeorge 4.0K Nov 28 19:50 snap.1000_lxi-tools_ql0gGm
how very strange.

Yes, since your home directory is NFS network mounted, the lxi-tools snap can't access your home directory. And when you are in /tmp the security container redirects the files to the tmp of the snap. magic...

The good news is that the NFS home issue is apparently something which has been resolved and a fix should soon be available with newly released snap subsystems. Unfortunately, only recent Ubuntu and Fedora systems are deploying latest versions of snap/snapd. In other words, if you are running a recent Ubuntu version (e.g. 17.10)  chances are it will soon be available.

PNG do load correctly tho.

Good :-+
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: BloodyCactus on November 29, 2017, 03:55:26 am
Hmm, strange. I didn't expect it to fail retrieving the ID. Can your please verify that the following command works for you?
Code: [Select]
$ lxi scpi -a scope "*IDN?"

Code: [Select]
lxi scpi -a scope "*IDN?"
Rohde&Schwarz,HMO1202,nnnnnnnnn,05.886

lxi screenshot -a 192.168.0.107 also fails, without -p

Quote
Yes, since your home directory is NFS network mounted, the lxi-tools snap can't access your home directory. And when you are in /tmp the security container redirects the files to the tmp of the snap. magic...

my home dir isnt nfs mounted. (everything off my ~ is nfs mounted, but ~/ is physical). it works in my home dir. I was actually in /tmp (which is also phsycal), but I guess snap cant run from /tmp for security.

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 29, 2017, 04:19:40 am
Code: [Select]
lxi scpi -a scope "*IDN?"
Rohde&Schwarz,HMO1202,nnnnnnnnn,05.886

Ok good. Then something is different when the ID is retrieved using the screenshot command. I will have to review the code to see if I can spot the bug - I'll get back to you on this tomorrow.

my home dir isnt nfs mounted. (everything off my ~ is nfs mounted, but ~/ is physical). it works in my home dir. I was actually in /tmp (which is also phsycal), but I guess snap cant run from /tmp for security.

Ok, got it. Then the problem is not too bad then, except it is of course annoying for your use case that you can't have it write directly to your NFS share. Some say that it is possible for a snap to write to an NFS share if you use the 'mount --bind <location of nfs> <some mount dir in your home>' command to basically map/mount your NFS share into your home and this way the snap will see it as a normal dir.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 29, 2017, 02:16:38 pm
Code: [Select]
lxi scpi -a scope "*IDN?"
Rohde&Schwarz,HMO1202,nnnnnnnnn,05.886

Ok good. Then something is different when the ID is retrieved using the screenshot command. I will have to review the code to see if I can spot the bug - I'll get back to you on this tomorrow.

Ok, I've found and fixed the bug. It was a very silly and simple bug :-[

The bug basically truncated the timeout to 1 ms when using the screenshot command which made retrieval of the instrument ID fail in your case.

The fix should be available via the edge channel now. Let me know if it works for you. Thanks.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: BloodyCactus on November 29, 2017, 10:37:42 pm
Ok, I've found and fixed the bug. It was a very silly and simple bug :-[

The bug basically truncated the timeout to 1 ms when using the screenshot command which made retrieval of the instrument ID fail in your case.

The fix should be available via the edge channel now. Let me know if it works for you. Thanks.

Code: [Select]
lxi screenshot -a scope -p rs-hmo1000 works.

Code: [Select]
> lxi screenshot -a scope
Loaded rs-hmo1000 screenshot plugin
hangs.

no change when using IP. still hangs.

with gdb, I get (but probably not much good to you).

Code: [Select]
#0  0x00007ffff76b76f0 in __poll_nocancel () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007ffff76f14e3 in readtcp (ctptr=0x60a6b0 "\004",
    buf=0x60e3d0 "d, Robert Gauthier, Floyd Wilder, Mark Drissel, Kenny Lyons,\n#  Paul Dunne, Tirath Pannu, Mike L", len=4000) at clnt_tcp.c:480
#2  0x00007ffff76ea946 in fill_input_buf (rstrm=0x60a770) at xdr_rec.c:567
#3  get_input_bytes (len=4, addr=0x7fffffbecbac "", rstrm=<optimized out>) at xdr_rec.c:586
#4  set_input_fragment (rstrm=<optimized out>) at xdr_rec.c:605
#5  xdrrec_getbytes (xdrs=<optimized out>, addr=addr@entry=0x7fffffbecbfc "\377\177", len=len@entry=4)
    at xdr_rec.c:262
#6  0x00007ffff76eab83 in xdrrec_getlong (xdrs=<optimized out>, lp=0x7fffffbecc18) at xdr_rec.c:218
#7  0x00007ffff76f6aab in __GI_xdr_u_long (xdrs=xdrs@entry=0x60a718, ulp=ulp@entry=0x7fffffbecca0) at xdr.c:214
#8  0x00007ffff76e9791 in __GI_xdr_replymsg (xdrs=xdrs@entry=0x60a718, rmsg=rmsg@entry=0x7fffffbecca0)
    at rpc_prot.c:135
#9  0x00007ffff76f12ae in clnttcp_call (h=0x60a690, proc=10, xdr_args=0x7ffff7bd07f1 <xdr_Create_LinkParms>,
    args_ptr=0x7fffffbecdb0 "\220\246`", xdr_results=0x7ffff7bd0ad1 <xdr_Create_LinkResp>,
    results_ptr=0x60a0e8 "\210\v\230\367\377\177", timeout=...) at clnt_tcp.c:287
#10 0x00007ffff7bd01e8 in create_link_1 () from liblxi.so.1
#11 0x00007ffff7bcedb2 in vxi11_connect () from liblxi.so.1
#12 0x00007ffff7bcea0e in lxi_connect () from liblxi.so.1
#13 0x0000000000404339 in rs_hmo1000_screenshot ()
#14 0x0000000000403525 in screenshot ()
#15 0x0000000000402384 in main ()

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 29, 2017, 11:30:02 pm
Code: [Select]
> lxi screenshot -a scope
Loaded rs-hmo1000 screenshot plugin
hangs.

Fixed!

New snap available.

What happened is that the automatic screenshot plugin detection first connects to the device to obtain the device ID which is used to automatically match which plugin to load and then it disconnects before it connects again later to retrieve the screenshot but someone forgot to disconnect |O and that obviously causes a hang for instruments that only support 1 active connection.

Thanks for the testing/debug :-+

This is exactly the type of testing I'm looking for - the more instruments tested the better so we can catch and eliminate bugs like this.

Btw. I've added a new benchmark command which can be useful for comparing the VXI-11 request/response performance of instruments:

Code: [Select]
lxi benchmark -a <ip>

Example:
Code: [Select]
$ lxi benchmark -a 192.168.1.210
Benchmarking by sending 100 ID requests. Please wait...
Result: 19.5 requests/second
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: dpenev on November 30, 2017, 12:21:29 pm
Hello,

I got this:
dpenev@yni:~$ sudo snap refresh lxi-tools --edge     
snap "lxi-tools" has no updates available
dpenev@yni:~$ lxi -v
lxi v1.13
dpenev@yni:~$ lxi screenshot -a 192.168.1.61   
Loaded siglent-ssa3000x screenshot plugin
Error: Failed to receive message
dpenev@yni:~$

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 30, 2017, 03:24:39 pm
Hello,

I got this:
dpenev@yni:~$ sudo snap refresh lxi-tools --edge     
snap "lxi-tools" has no updates available
dpenev@yni:~$ lxi -v
lxi v1.13

Thats's good. On some systems snaps automatically updates to the latest version available in their active channel (stable, candidate, beta, or edge).

dpenev@yni:~$ lxi screenshot -a 192.168.1.61   
Loaded siglent-ssa3000x screenshot plugin
Error: Failed to receive message
dpenev@yni:~$

Hmm. It looks like your SSA3000X instrument does not respond to or recognize the "SCDP." command.

I also notice you seem to be running the latest firmware :-+

I'll talk to Siglent again to verify that the "SCDP." command is actually supported by latest public firmware.

Thanks for testing.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 30, 2017, 05:50:59 pm
FYI - I've updated the original post that started this thread to include install instructions/hints for getting lxi-tools working with Windows.

Perhaps some would like to share their experience with VMs and lxi-tools.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: dpenev on November 30, 2017, 09:16:29 pm
Hi Lundmar,

I don't find SCDP command in the SSA3000X programming manual.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on November 30, 2017, 09:39:40 pm
Hi Lundmar,

I don't find SCDP command in the SSA3000X programming manual.

Hi,

True - I'm told it is an undocumented command that should work with SSA3000X. However, I suspect that maybe it is only available in firmware that has not been released yet. I'll check with Siglent to make sure and get back to you. It would be nice if we could get the screenshot plugin working seamlessly with this nice instrument.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 01, 2017, 01:15:16 am
I don't find SCDP command in the SSA3000X programming manual.

I've updated the siglent-ssa3000x plugin - I've added some termination characters to the capture command which might make a difference for this particular instrument.

Let me know if that gets it going.

FYI - snap revision 110 or later:

Code: [Select]
$ snap info lxi-tools
name:      lxi-tools
summary:   Open source LXI tools
publisher: lundmar
description: |
  Lxi-tools is a collection of open source software tools that enables control
  of LXI compatible instruments such as modern oscilloscopes, power supplies,
  spectrum analyzers etc.
snap-id: yha3V4dqfwJwpjSWgMFEMViAlQ2iMdL7
commands:
  - lxi-tools.lxi
tracking:    edge
installed:   1.13 (110) 14MB -
refreshed:   2017-12-01 02:08:58 +0100 CET
channels:               
  stable:    1.12 (42)  14MB -
  candidate: ?               
  beta:      ?               
  edge:      1.13 (110) 14MB -
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 01, 2017, 02:38:07 pm
Following the usual rapid release cycle I have made a new release of lxi-tools available.

For an overview of the changes please see https://github.com/lxi-tools/lxi-tools/releases/tag/v1.13

This release adds a new simple benchmark feature. Also, some important fixes has gone into the screenshot feature.

Thanks to BloodyCactus for helping out ironing out the remaining issues with the Rohde & Schwarz HMO 1000 screenshot plugin :-+

This release is available for install via the snap stable channel:

Code: [Select]
$ snap install lxi-tools
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: HoracioDos on December 01, 2017, 07:11:05 pm
Please stop improving this thing. I'm getting tired of compiling it almost every week  :-DD
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 01, 2017, 07:19:12 pm
Please stop improving this thing. I'm getting tired of compiling it almost every week  :-DD

Ha ha HoracioDos :D

I can highly recommend you install via snap instead - it updates automatically. No need to manually compile stuff anymore ;)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: HoracioDos on December 01, 2017, 07:28:44 pm
I can highly recommend you install via snap instead - it updates automatically. No need to manually compile stuff anymore ;)
I prefer flatpak or old school compile
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 01, 2017, 07:34:26 pm
I can highly recommend you install via snap instead - it updates automatically. No need to manually compile stuff anymore ;)
I prefer flatpak or old school compile

Well, it looks like snap is winning over flatpak in the popularity race... just saying ;)

Either way, they are not that much different. They solve some of the same issues but snap provides a more straightforward and polished interface for end users.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 01, 2017, 08:29:37 pm
hmmm

Code: [Select]
> /snap/bin/lxi --version
cannot change current working directory to the original directory: Permission denied

> sudo /snap/bin/lxi --version
cannot change current working directory to the original directory: Permission denied

> cd /tmp
> lxi --version
lxi v1.13

oh, solved my own problem, posting here for posterity. You get the above error if you run it when your in an NFS mounted directory/path.

Oh, by the way. I don't know why I didn't think of this before but you can try install the snap with disabled confinement like so:

Code: [Select]
snap install lxi-tools --classic

Then of course rerun the snap alias command if you want to have it recognize the 'lxi' command.

Try it out - maybe that will solve your permission denied on NFS filesystems.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: crispus on December 10, 2017, 04:25:16 pm
Hi,

I have a couple of suggestions:
1. a parameter for discover - either the network adress, interface name, etc (when you have many interfaces it takes some time)
2. I'm not able to take a screenshot on DM3058:
Code: [Select]
user@host: /s/l/out $ bin/lxi discover                   
Searching for LXI devices - please wait...

Broadcasting on interface lo
Broadcasting on interface eth0
  Found "Rigol Technologies,DM3058,DM3XXXX,01.01.00.02.02.00" on address 192.168.1.144

user@host: /s/l/out $ bin/lxi screenshot -a 192.168.1.144 screenshot
Loaded rigol-dm3000 screenshot plugin
<I can hear a beep on the multimeter>
<some time after>
Error: Read error (timeout)
Error: Failed to receive message
user@host: /s/l/out $
I do have the latest version built from github.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 10, 2017, 04:38:45 pm
Hi,

I have a couple of suggestions:
1. a parameter for discover - either the network adress, interface name, etc (when you have many interfaces it takes some time)

Perhaps I'll add an option for which interface to broadcast on. Something like:
Code: [Select]
$ lxi discover --interface wlan0
For now, to speed things up a bit, you can decrease the timeout. Usually '--timeout 1' is sufficient.

2. I'm not able to take a screenshot on DM3058:
Code: [Select]
user@host: /s/l/out $ bin/lxi discover                   
Searching for LXI devices - please wait...

Broadcasting on interface lo
Broadcasting on interface eth0
  Found "Rigol Technologies,DM3058,DM3XXXX,01.01.00.02.02.00" on address 192.168.1.144

user@host: /s/l/out $ bin/lxi screenshot -a 192.168.1.144 screenshot
Loaded rigol-dm3000 screenshot plugin
<I can hear a beep on the multimeter>
<some time after>
Error: Read error (timeout)
Error: Failed to receive message
user@host: /s/l/out $
I do have the latest version built from github.

Do you have the latest firmware from Rigol installed?

I believe that the screenshot plugin has been tested with a DM3068 by PeDre. Perhaps there is a subtle difference in how it retrieves the screenshot for the two models.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: crispus on December 10, 2017, 04:51:09 pm
I didn't (yet) upgrade the multimeter; it is as I received it (version 01.01.00.02.02.00)
I'll try to upgrade it and post the result.

The timeout workaround is good, now it takes 3 seconds instead of 10.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: crispus on December 10, 2017, 05:57:03 pm
If helps, I updated the firmware to the latest version and same error (timeout).
On MSO1104Z-S, DG4062 and DSA815 screenshot works with no problem.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 10, 2017, 07:41:19 pm
Hello Martin (lundmar),

just for your information.
The Rigol DM3068 only works without a waitlock flag. The flag may be set automatically when the VXI connection is established. The waitlock flag is used by many VXI functions as a parameter, e. g. device_read, see parameter Device_Flags.
The DM3058 may not work because of this. I have not received any feedback from anyone about this device and my program.
My VXI-simulator ignores this flag. The Rigol DS6000 and DG4000 with old firmware are also affected.

Peter

Edit:
What I wrote can't be the mistake. The IDN is received by the Rigol DM3058,
so the waitlock flag isn't the problem.

Ahh right, yes - the DM was the one you simulated. Either way, I've disabled any locking requests during establishment of the VXI-11 connection. It might fix the issue.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 10, 2017, 07:47:29 pm
If helps, I updated the firmware to the latest version and same error (timeout).
On MSO1104Z-S, DG4062 and DSA815 screenshot works with no problem.

Ok. I've updated liblxi so that the lxi_connect() function does not try to set up any locking during establishment of the VXI-11 connection. Please update and try it out.

In case you don't want to bother with manual compilation the snap version should already be available on the edge channel.

Snap build status can be monitored here: https://build.snapcraft.io/user/lxi-tools/lxi-tools.snapcraft
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 10, 2017, 08:15:08 pm
Doh!

I've just studied the documentation for DM3058 and DM3068.

It seems that the SCPI command that we use to request screenshot data ":display:data?" is actually not supported on these instruments.

It might be an undocumented feature but it does not seem to be the case.

Looks like we will have to remove the rigol-dm3000 plugin.

@PeDre , you agree?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 10, 2017, 11:18:36 pm
lxi screenshot -a 192.168.1.59 -m rigol-2000 #Works fine now

1. Can there be a option for png instead of bmp? png are smaller.

The image format depends on which formats the instrument supports. PNG is certainly the preferred format but not all instruments support it. The Rigol 2000 series supports PNG for internal storage of screenshots but it is not documented whether it is possible to retrieve PNG remotely. Please try out the '"rigol_2000_png" branch and let me know if it creates a proper PNG for you. If not I'm afraid it is not possible unless the lxi tool itself starts doing BMP->PNG conversion but I think that is a bad idea. I would rather provide the raw material straight from the instrument and then the user can do as they please.

Update: The screenshot command now supports redirecting the screenshot image data to stdout. To do so simply use '-' as the output filename. This means it is now possible to pass on the captured image to external tools for image processing, such as converting it to a different image format. For example, to convert to .jpg using imagemagicks convert tool:

Code: [Select]
$ lxi screenshot --address 10.0.0.42 - | convert - screenshot.jpg

This feature will be included in the upcoming release. It is already available in the snap edge channel.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 11, 2017, 02:44:39 pm
Looks like we will have to remove the rigol-dm3000 plugin.

@PeDre , you agree?

I have received feedback from two users that the Rigol DM3068 (Firmware 01.01.00.01.08.00.01 and 01.01.00.01.09.00) with the SCPI command ":DISP:DATA?" and my program works. This applies to the LAN and USB connection.

Peter

Ok good - so it is just an undocumented feature.

I found Wireshark protocols in my records.
The error was the timeout when creating the connection (CREATE_LINK). The timeout could then be used for write or read commands.

Peter

Ok, then my latest changes should hopefully solve the issue.

Thanks for the helpful input Peter :-+

@crispus, Please test latest git or snap and let us know if works or fails. Also, thank you for testing  :-+

Man, I wish I had more instruments so I could create a small lab with various instruments for regression and feature testing.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: crispus on December 11, 2017, 03:04:33 pm
@crispus, Please test latest git or snap and let us know if works or fails. Also, thank you for testing  :-+
If you refer to https://github.com/lxi-tools/liblxi/commit/12017460e30654e6b10ac99e982bb0d534b9df5e , I tested yesterday and it doesn't seem to work.
I will check again this evening and post the results.

Man, I wish I had more instruments so I could create a small lab with various instruments for regression and feature testing.
I mentioned that I have also MSO1104Z-S, DG4062 and DSA815-TG. And periodically I could run some regression tests.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 11, 2017, 03:25:17 pm
@crispus, Please test latest git or snap and let us know if works or fails. Also, thank you for testing  :-+
If you refer to https://github.com/lxi-tools/liblxi/commit/12017460e30654e6b10ac99e982bb0d534b9df5e , I tested yesterday and it doesn't seem to work.
I will check again this evening and post the results.

I appreciate the double check. Even I sometimes forget to install the library after updating it he he. Otherwise, the snap is readily available (revision #214 or newer).

Man, I wish I had more instruments so I could create a small lab with various instruments for regression and feature testing.
I mentioned that I have also MSO1104Z-S, DG4062 and DSA815-TG. And periodically I could run some regression tests.

If you can confirm/test that your DG4062 and MSO1104Z-S works with discover+scpi+screenshot then I would like to add them to the list of tested instruments. The DSA-815 is already in the list. Thanks.

Regarding regression testing, I might reach out to you if I feel that some testing is needed before a release that includes significant changes.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: crispus on December 11, 2017, 08:47:13 pm
Still doesn't work (neither with snap --edge, nor from source files)
Same error (the following output is from snap):
Code: [Select]
$ lxi
Usage: /snap/lxi-tools/220/bin/lxi [--version] [--help] <command> [<args>]

$ lxi screenshot -a 192.168.1.144 -
Loaded rigol-dm3000 screenshot plugin
Error: Read error (timeout)
Error: Failed to receive message

Discover && screnshots works from other instruments:
Code: [Select]
$ lxi discover --timeout 1
Searching for LXI devices - please wait...

Broadcasting on interface lo
Broadcasting on interface eth0
  Found "Rigol Technologies,DG4062,DG4xxx,00.01.12" on address 192.168.1.67
  Found "RIGOL TECHNOLOGIES,MSO1104Z,DS1xxxx,00.04.04.SP3" on address 192.168.1.149
  Found "Rigol Technologies,DM3058,DM3xxx,01.01.00.02.02.00" on address 192.168.1.144

$ lxi screenshot -a 192.168.1.67 - | convert - fg.png
$ lxi screenshot -a 192.168.1.149 - | convert - osc.png
$ ll *.png
-rw-rw-r-- 1 user user 141799 dec 11 22:34 fg.png
-rw-rw-r-- 1 user user  20750 dec 11 22:34 osc.png

Maybe it is useful to include in version name the git commits id (tools & lib) in order to be sure on what commit is the binary.
SCPI commands seems to work as well.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 11, 2017, 09:13:00 pm
Still doesn't work (neither with snap --edge, nor from source files)
Same error (the following output is from snap):
Code: [Select]
$ lxi
Usage: /snap/lxi-tools/220/bin/lxi [--version] [--help] <command> [<args>]

$ lxi screenshot -a 192.168.1.144 -
Loaded rigol-dm3000 screenshot plugin
Error: Read error (timeout)
Error: Failed to receive message

Update 2: Your trace confirmed we get a timeout waiting for response to the screenshot capture command. Please try the following (requires latest because of a fix to interactive mode):

Code: [Select]
$ lxi scpi --address <ip> --interactive

And in interactive mode please enter the following:

Code: [Select]
:disp:data?
:system:error?

I'm not fully convinced that your DM firmware supports the first command so I expect you will see a system error message like e.g. '-113,"Undefined header; keyword cannot be found"'.

Discover && screnshots works from other instruments:
Code: [Select]
$ lxi discover --timeout 1
Searching for LXI devices - please wait...

Broadcasting on interface lo
Broadcasting on interface eth0
  Found "Rigol Technologies,DG4062,DG4xxx,00.01.12" on address 192.168.1.67
  Found "RIGOL TECHNOLOGIES,MSO1104Z,DS1xxxx,00.04.04.SP3" on address 192.168.1.149
  Found "Rigol Technologies,DM3058,DM3xxx,01.01.00.02.02.00" on address 192.168.1.144

$ lxi screenshot -a 192.168.1.67 - | convert - fg.png
$ lxi screenshot -a 192.168.1.149 - | convert - osc.png
$ ll *.png
-rw-rw-r-- 1 user user 141799 dec 11 22:34 fg.png
-rw-rw-r-- 1 user user  20750 dec 11 22:34 osc.png

Thanks - I've added them to the list of tested instruments. Also, I've added you to the list of contributors.

Maybe it is useful to include in version name the git commits id (tools & lib) in order to be sure on what commit is the binary.
SCPI commands seems to work as well.

Yeah, I might add that.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: crispus on December 12, 2017, 06:49:29 am
Yeah, you're right:
Code: [Select]
$ lxi scpi -a 192.168.1.144 --interactive
Connected to 192.168.1.144
Entering interactive mode (ctrl-d to quit)

lxi> :disp:data?
Error: Read error (timeout)
Error: Failed to receive message
lxi> :system:error?
-113,"Undefined header; keyword cannot be found"
lxi> :system:error?
0,"No error"
lxi> :disp:data?
Error: Read error (timeout)
Error: Failed to receive message
lxi> :system:error?
-113,"Undefined header; keyword cannot be found"
lxi> ^C

I can't see any screenshot related in the  programming manual (https://www.batronix.com/pdf/Rigol/ProgrammingGuide/DM3058_ProgrammingGuide_EN.pdf) for DM3058
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 12, 2017, 07:23:23 am
Yeah, you're right:
Code: [Select]
$ lxi scpi -a 192.168.1.144 --interactive
Connected to 192.168.1.144
Entering interactive mode (ctrl-d to quit)

lxi> :disp:data?
Error: Read error (timeout)
Error: Failed to receive message
lxi> :system:error?
-113,"Undefined header; keyword cannot be found"
lxi> :system:error?
0,"No error"
lxi> :disp:data?
Error: Read error (timeout)
Error: Failed to receive message
lxi> :system:error?
-113,"Undefined header; keyword cannot be found"
lxi> ^C

I can't see any screenshot related in the  programming manual (https://www.batronix.com/pdf/Rigol/ProgrammingGuide/DM3058_ProgrammingGuide_EN.pdf) for DM3058

Ok.

Btw., did you upgrade to latest firmware?

It's a pretty weird regression if earlier firmware versions support this command but the latest does not. Or perhaps it is only the DM3068 that unofficially supports it.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: crispus on December 12, 2017, 03:03:27 pm
Btw., did you upgrade to latest firmware?
Yes, it seems that already had the latest version. The tricky part though, in the release notes the version contains an additional 02: 1.01.00.02.02.00 on the multimeter versus 1.01.00.02.02.00.02 in the release notes.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 12, 2017, 04:04:42 pm
Btw., did you upgrade to latest firmware?
Yes, it seems that already had the latest version. The tricky part though, in the release notes the version contains an additional 02: 1.01.00.02.02.00 on the multimeter versus 1.01.00.02.02.00.02 in the release notes.

He he, yeah - those two numbers can make you go blind trying to spot the difference.

So, since the screenshot plugin certainly won't work with the DM3058 I'm thinking I will add to the description that it only works with DM3068.

Or at least, I will assume it to be working with DM3068 until someone tells me otherwise.

Either way, thank you for your testing. I'm sorry we couldn't make it work.

As a last resort, you could try ask Rigol to add screenshot support to their firmware but it might be a futile task - I don't know how much Rigol listens to their users.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 12, 2017, 09:57:07 pm
New releases of lxi-tools and liblxi are now available via snap, tarball, or git.

This is a feature and bug fix release.

For a complete overview of changes please see:
https://github.com/lxi-tools/lxi-tools/releases/tag/v1.14
https://github.com/lxi-tools/liblxi/releases/tag/v1.8

A lot of new screenshot plugins have been added which add support for many of Siglents instruments.

Also, the screenshot command has been improved so it is now possible to redirect the captured screenshot image directly to external tools for simple or advanced image processing such as resizing, scaling, adding text, format conversion, etc. It's quite a powerful feature. For example, to embed a time stamp in the image, upscale the image to 150%, and convert it to JPG, simply use the lxi tool in combination with e.g. ImageMagicks image manipulation tools like so:

Code: [Select]
$ lxi screenshot -a 10.0.0.42 - | convert -fill white -draw "font-size 16 text 100,100 '`date`'" -scale 150% - screenshot.jpg

Or, to add a label with time stamp:
Code: [Select]
$ lxi screenshot -a 10.0.0.42 - | montage -geometry +0+0 -background white -label "`date`" -scale 150% - screenshot.png

ImageMagicks image manipulation tools support various image operations and over 200 image formats which should satisfy the needs of most users :)

Also, I would like to put a big thank you to Siglent who has been very helpful to test and make sure that lxi-tools works well with all of their LXI compatible instruments  :-+
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: dpenev on December 13, 2017, 05:57:41 pm
Hi lundmar,

I have tested the latest lxi tool v1.15 and screenshot is working fine on my Siglent SSA3021X


A minor note which would be a bit more convenient for me is if I would able to write directly to my share 
At the moment I get an error

lxi screenshot -a 192.168.1.61 /share/scr2.bmp
Loaded siglent-ssa3000x screenshot plugin
Error: Could not write screenshot file (No such file or directory)

Thank you for your work.
Dimitar
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 13, 2017, 08:14:56 pm
Hi lundmar,

I have tested the latest lxi tool v1.15 and screenshot is working fine on my Siglent SSA3021X


A minor note which would be a bit more convenient for me is if I would able to write directly to my share 
At the moment I get an error

lxi screenshot -a 192.168.1.61 /share/scr2.bmp
Loaded siglent-ssa3000x screenshot plugin
Error: Could not write screenshot file (No such file or directory)

Thank you for your work.
Dimitar

You're welcome. I'm glad we finally have it working.

Yes, an unfortunate consequence of using snap at the moment is that it runs in a security confined environment so writing to anywhere outside of your home directory is denied. I'm told this is something which might be fixed in future versions of snap.

Until then there is a little trick you can do to bypass the confinement:
Code: [Select]
$ lxi screenshot -a 10.0.0.42 - | convert - screenshot.png
This way it is the unconfined convert tool that writes the screenshot file and so you can write anywhere you like.

Actually, you can even skip the convert tool assuming your know the image file format extension:
Code: [Select]
$ lxi screenshot -a 10.0.0.42 - > screenshot.png
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on December 24, 2017, 04:17:49 pm
Just tried to install this unsuccessfully on debian.

I first installed snap as described, and all went well. I then tried

snap install lxi-tools --edge

and got

error: cannot install "lxi-tools": Get https://search.apps.ubuntu.com/api/v1/snaps/details/core?channel=stable&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cdeltas%2Cbinary_filesize%2Cdownload_url%2Cepoch%2Cicon_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Cscreenshot_urls%2Csnap_id%2Csupport_url%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cprivate%2Cconfinement: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

snap install lxi-tools

gives the same result.

Any idea what is up?

Thanks.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 24, 2017, 09:49:10 pm
Just tried to install this unsuccessfully on debian.

I first installed snap as described, and all went well. I then tried

snap install lxi-tools --edge

and got

error: cannot install "lxi-tools": Get https://search.apps.ubuntu.com/api/v1/snaps/details/core?channel=stable&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cdeltas%2Cbinary_filesize%2Cdownload_url%2Cepoch%2Cicon_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Cscreenshot_urls%2Csnap_id%2Csupport_url%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cprivate%2Cconfinement: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

snap install lxi-tools

gives the same result.

Any idea what is up?

Thanks.

I notice that "api/v1/snaps" is involved. I'm not sure but I think recent versions of snap uses snap api v2.

I just installed lxi-tools successfully on Debian 9.3 (Stretch) which uses snap/snapd version 2.29.4.2.

Which Debian and snap version are you using?

EDIT: It looks like snap/snapd is only officially supported on latest stable Debian (Stretch).
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on December 25, 2017, 05:32:54 pm
I'm using
GNU/Linux testing Stretch
and
snap    2.21-2+b1

I've realised that testing with Stretch is now a bit outdated, so have changed just to testing. Having done that, all seems OK. :-+

Oops, spoke too soon. While snap install worked OK, I now get

bash: lxi: command not found


Am I doing something silly?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on December 25, 2017, 06:42:19 pm
OK, so I found the binary: /snap/bin/lxi

But trying to run it as

/snap/bin/lxi

gives

cannot bind-mount the mount namespace file /proc/2556/ns/mnt -> lxi-tools.mnt: Permission denied
support process for mount namespace capture exited abnormally
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: crispus on December 25, 2017, 06:57:56 pm
Do you have /var or /tmp as symbolic link?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 25, 2017, 07:13:46 pm
I'm using
GNU/Linux testing Stretch
and
snap    2.21-2+b1

I've realised that testing with Stretch is now a bit outdated, so have changed just to testing. Having done that, all seems OK. :-+

Good :)

Oops, spoke too soon. While snap install worked OK, I now get

bash: lxi: command not found


Am I doing something silly?

I don't think so. Actually, the snap binaries are prefixed with the name of the snap. So in case of lxi-tools the lxi binary is named "lxi-tools.lxi". However, the lxi-tools snap recently gained support for adding the automatic alias lxi -> lxi-tools.lxi when installing so the lxi command should just work.

You can list the installed aliases like so:
Code: [Select]
snap aliases

If the alias is not listed you can install it manually:
Code: [Select]
snap alias lxi-tools.lxi lxi

You might also consider using Debian stable. I mean, Debian testing can include broken stuff :)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 25, 2017, 07:35:17 pm
FYI - lxi-tools was recently picked up by a Debian package maintainer so I expect to see it available in Debian stable in about 1 year or so :)

Of course, it will be available in unstable/testing long before that.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on December 26, 2017, 10:09:24 pm
Hmm

 snap aliases
gives
Command        Alias  Notes
lxi-tools.lxi  lxi    -

so that does not seem to be the problem.

Neither /var nor /tmp are aliases.

snap version
now gives
snap version
snap    2.27.6-2
snapd   2.27.6-2
series  16
debian  unknown
kernel  4.13.0-1-amd64

Any either ideas on how to get this to run? Even trying to run it as root gives permission errors - and it is not on my path...
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 26, 2017, 10:43:23 pm
Hmm

 snap aliases
gives
Command        Alias  Notes
lxi-tools.lxi  lxi    -

so that does not seem to be the problem.

Neither /var nor /tmp are aliases.

snap version
now gives
snap version
snap    2.27.6-2
snapd   2.27.6-2
series  16
debian  unknown
kernel  4.13.0-1-amd64

Any either ideas on how to get this to run? Even trying to run it as root gives permission errors - and it is not on my path...

The permission denied errors are likely somehow related to the fact that snaps are running in security confinement. You can try disable this confinement like so:

Code: [Select]
$ snap refresh lxi-tools --devmode

Or

Code: [Select]
$ snap refresh lxi-tools --classic

Either way, I think your best option is to use Debian stable since it includes the latest snap version (2.29.x) which is tested to work.

However, if you don't feel like distro downgrading/upgrading you can always compile and install it manually from source as described in the top post of this thread (see e.g. git build steps).

If you feel brave I have also attached the pre-release .deb packages that I got from the Debian maintainer - I have tested them with Debian 9.3.

P.s. If you get it up and running feel free to let us know what specific instruments you might have tested successfully. Thanks.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on December 27, 2017, 08:15:56 pm
Both of those variants did nothing, just giving
snap "lxi-tools" has no updates available

However the deb files seem to have worked.

Thanks!

I'll try it out with some instruments in the next few days I hope.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 27, 2017, 08:28:28 pm
Both of those variants did nothing, just giving
snap "lxi-tools" has no updates available

I think that is expected because there is no new refresh/download available but despite this message it is supposed to change the confinement setting.

However the deb files seem to have worked.

Thanks!

I'll try it out with some instruments in the next few days I hope.

Great - feel free to share your findings.

Unfortunately I will not be able to provide updated .deb packages moving forward except when the Debian package maintainer decides to do so. The great thing about snap is it is always up to date and I can push updates directly to users literally within minutes.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on December 27, 2017, 09:18:04 pm
Well, findings so far are discovery works for these devices:

  Found "Rigol Technologies,DG4062,[serial#]" on address 192.168.1.207
  Found "KEYSIGHT TECHNOLOGIES,MSO-X 3024T,[serial#],07.20.2017102614" on address 192.168.1.206

Tried sending *IDN? to both - worked OK.

Captured a screenshot from the Keysight, which resulted in a png file, but when I tried to view it, I got told it was not a png.
Running the file command on it just told me it was data.
The first few bytes of the file look like this:
00000000: 470d 0a1a 0a00 0000 0d49 4844 5200 0003  G........IHDR...
00000010: 2000 0002 0008 0200 0000 f5c9 9fbd 0000   ...............
00000020: 2000 4944 4154 7801 edbd 4dac 2cdb 75df   .IDATx...M.,.u.
00000030: 77ce 7df7 f123 fc92 68c1 a114 0e2c 4422  w.}..#..h....,D"
00000040: a297 c086 ded3 e01a a000 3940 3290 022a  ..........9@2..*
00000050: 4311 b888 151a be9c 270c e051 8078 1a22  C.......'..Q.x."
00000060: 4090 115f 9217 27b8 8092 a108 5883 0089  @.._..'.....X...

Trying to use the Keysight 2000 plugin didn't help.

Captured a screenshot from the Rigol, which resulted in a bmp file, but when I tried to view it, I got told it had a bogus header.
Running file on it told me it was a jpeg!
Changing the file extension to jpg gave me a correct picture of the screen.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on December 27, 2017, 09:49:34 pm
Just out of curiosity, I tried building this on a Mac. Unfortunately, it didn't work as rpcgen does not have a -M argument on  MacOS X.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 27, 2017, 10:15:36 pm
Well, findings so far are discovery works for these devices:

  Found "Rigol Technologies,DG4062,[serial#]" on address 192.168.1.207
  Found "KEYSIGHT TECHNOLOGIES,MSO-X 3024T,[serial#],07.20.2017102614" on address 192.168.1.206

Tried sending *IDN? to both - worked OK.


Good.

Captured a screenshot from the Keysight, which resulted in a png file, but when I tried to view it, I got told it was not a png.
Running the file command on it just told me it was data.
The first few bytes of the file look like this:
00000000: 470d 0a1a 0a00 0000 0d49 4844 5200 0003  G........IHDR...
00000010: 2000 0002 0008 0200 0000 f5c9 9fbd 0000   ...............
00000020: 2000 4944 4154 7801 edbd 4dac 2cdb 75df   .IDATx...M.,.u.
00000030: 77ce 7df7 f123 fc92 68c1 a114 0e2c 4422  w.}..#..h....,D"
00000040: a297 c086 ded3 e01a a000 3940 3290 022a  ..........9@2..*
00000050: 4311 b888 151a be9c 270c e051 8078 1a22  C.......'..Q.x."
00000060: 4090 115f 9217 27b8 8092 a108 5883 0089  @.._..'.....X...

Trying to use the Keysight 2000 plugin didn't help.


Yeah, you are the first to actually test the Keysight plugin. Clearly something needs to be fixed. I'll look into it.
Update: Fixed and ready for testing. Also, the screenshot command should now auto detect your 3000X instrument and automatically load the plugin.

Captured a screenshot from the Rigol, which resulted in a bmp file, but when I tried to view it, I got told it had a bogus header.
Running file on it told me it was a jpeg!
Changing the file extension to jpg gave me a correct picture of the screen.

Oh, interesting. In the screenshot plugin for the dg4000 we assume the image to be BMP but it seems we need to fire an additional command to make sure the format is BMP. I'll fix that.
Update:  Fixed and available in the latest snap on the edge channel.

By the way, if you want to test with snap you could install latest Debian stable (9.3) in a VirtualBox VM - that's what I'm doing on my Ubuntu system to test Debian stuff. In case you do that, remember to make the network adapter bridged (not NAT).
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 27, 2017, 10:36:08 pm
Just out of curiosity, I tried building this on a Mac. Unfortunately, it didn't work as rpcgen does not have a -M argument on  MacOS X.

Unfortunately we don't want to make do without the -M flag because it is what produces thread-safe code. I'm not sure why rpcgen on mac does not support this flag - perhaps too old version of rpcgen?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on December 28, 2017, 08:23:13 am
Thanks for the fixes.

I'm already running Debian in a VM, in bridged mode, on my Mac.  :) But my SSD does not have enough space for yet another VM. :(

I suppose the answer is to uninstall the deb and just install from the Github source, if snap doesn't work (for whatever reason).
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on December 28, 2017, 10:53:25 am
There's definitely something wrong with the way the snap version is working. I just installed a fresh Debian stretch in a VirtualBox VM, did
apt-get install snapd
then
snap install lxi-tools
which all seemed to work OK.
But then any of the commands
lxi
lxitools
lxi-tools
just gives me "command not found".

Write once run anywhere is a noble goal - but seems rather too fragile...
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 28, 2017, 11:15:46 am
There's definitely something wrong with the way the snap version is working. I just installed a fresh Debian stretch in a VirtualBox VM, did
apt-get install snapd
then
snap install lxi-tools
which all seemed to work OK.
But then any of the commands
lxi
lxitools
lxi-tools
just gives me "command not found".

These are the exact steps I do on Debian 9.3:
Code: [Select]
$ lsb_release -d
Description:   Debian GNU/Linux 9.3 (stretch)
$ snap --version
snap    2.29.4.2
snapd   2.29.4.2
series  16
debian  9
kernel  4.9.0-4-amd64
$ su -
$ snap install lxi-tools --edge
$ lxi --version
lxi v1.16
$ lxi-tools.lxi --version
lxi v1.16
$ snap aliases
Command        Alias  Notes
lxi-tools.lxi  lxi    -

Write once run anywhere is a noble goal - but seems rather too fragile...

At least it is a goal :)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 28, 2017, 11:20:19 am
There's the SCPI command:
:HCOPy:SDUMp:DATA:FORMat BMP|JPEG|PNG
:HCOPy:SDUMp:DATA:FORMat?

Exactly - that is the command I added to fix the format for the DG to force it to BMP. I'm wondering if the same trick needs to be applied to any of the other rigol plugins.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on December 28, 2017, 11:52:24 am
Well, here is my output

#lsb_release -d
Description:   Debian GNU/Linux 9.3 (stretch)

#snap --version
snap    2.29.4.2
snapd   2.29.4.2
series  16
debian  9
kernel  4.9.0-4-amd64

#snap install lxi-tools --edge
lxi-tools (edge) 1.16 from 'lundmar' installed

#lxi --version
bash: lxi: command not found

#lxi-tools.lxi --version
bash: lxi-tools.lxi: command not found

#snap aliases
Command        Alias  Notes
lxi-tools.lxi  lxi    -

All looks the same - apart from the fact that lxi is not found...
I've got no idea how it can be working on your system and not on mine.
I've had exactly the same result now on both Debian testing and a fresh Debian stretch. :-//
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 28, 2017, 12:05:21 pm
Well, here is my output

#lsb_release -d
Description:   Debian GNU/Linux 9.3 (stretch)

#snap --version
snap    2.29.4.2
snapd   2.29.4.2
series  16
debian  9
kernel  4.9.0-4-amd64

#snap install lxi-tools --edge
lxi-tools (edge) 1.16 from 'lundmar' installed

#lxi --version
bash: lxi: command not found

#lxi-tools.lxi --version
bash: lxi-tools.lxi: command not found

#snap aliases
Command        Alias  Notes
lxi-tools.lxi  lxi    -

All looks the same - apart from the fact that lxi is not found...
I've got no idea how it can be working on your system and not on mine.
I've had exactly the same result now on both Debian testing and a fresh Debian stretch. :-//

I think I've spotted your problem.

I assume you are using the "su" command to go root. Try "su -".

With the first I see the same as you. With the latter everything works fine.

Also, I normally just switch to and install as root but then exit back to my "test" user and it still works.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on December 28, 2017, 04:50:25 pm
Thanks. using
su -
instead of
sudo bash
to get a root terminal did the trick (except I still have to be root to use the lxi command).
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 28, 2017, 05:05:15 pm
Thanks. using
su -
instead of
sudo bash
to get a root terminal did the trick (except I still have to be root to use the lxi command).

Great. Let me know if the fixed screenshot plugins work with your DG and MSO. You should be able to simply do:
Code: [Select]
$ lxi screenshot --address <instrument ip>

I'm not that familiar with the Debian ways of user management. On Ubuntu I don't even have to switch to root to install/remove/use snaps.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on December 28, 2017, 07:29:14 pm
Screenshot works well now for keysight, producing a bmp file, and for the Rigol, also producing a bmp file.  :-+
(Without specifying plugins to use).

Keep up the good work!  :)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 28, 2017, 09:11:15 pm
Screenshot works well now for keysight, producing a bmp file, and for the Rigol, also producing a bmp file.  :-+
(Without specifying plugins to use).

Keep up the good work!  :)

Thanks :)

And thank you for your patience getting the snap running. Great to finally have a Keysight instrument tested working :)

For your testing effort I've added you to the list of contributors.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 29, 2017, 08:31:30 pm
New releases available via snap or source.

Changes:
https://github.com/lxi-tools/lxi-tools/releases/tag/v1.16
https://github.com/lxi-tools/liblxi/releases/tag/v1.9

The changes fix the keysight-ivx and rigol-dg4000 screenshot plugins. The discover feature has also been improved with a fallback to request ID via HTTP/XML - this should make it possible to discover instruments from e.g. Aim-TTi.

Also added are fixes making it ready for packaging in Debian and FreeBSD.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 02, 2018, 07:42:55 pm
I know that some people would welcome a GUI for lxi-tools.

Here is a first try at adding a simple QT5 GUI:

(http://lxi-tools.github.io/images/lxi-tools-gui.png)

In its first iteration it can simply discover instruments via VXI-11.

To keep the UI simple and easy-to-use I think the next step would be to feature a right-click context menu for the listed instruments which provides the following options:

* Send SCPI command
* Take screenshot (only shown if a matching screenshot plugin is available)
* Benchmark
* Copy Instrument ID
* Copy IP Address

The GUI application binary will be named lxi-gui but will also be possible to start via the commandline lxi tool using the following command: lxi gui

If there are any GUI or QT5 designers out there who are interested in helping creating this GUI application feel free to join in :)

Also, if anyone wants to add a custom, fast, simple or advanced GUI for their particular instrument it is now possible with this lxi-tools/QT5 stack. Contributors are welcome to add any useful instrument tools to lxi-tools.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on January 03, 2018, 06:35:33 pm
Just a thought: it could perhaps be useful if some of the most common SCPI commands could be available in a menu, e.g. perform self-test.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 03, 2018, 07:25:31 pm
Just a thought: it could perhaps be useful if some of the most common SCPI commands could be available in a menu, e.g. perform self-test.

Yeah - the "IEEE 488.2 Common Commands".

http://na.support.keysight.com/vna/help/latest/Programming/GP-IB_Command_Finder/Common_Commands.htm (http://na.support.keysight.com/vna/help/latest/Programming/GP-IB_Command_Finder/Common_Commands.htm)

I'm considering introducing separate tabs/panes for each of the following features: Discovery, SCPI, Screenshot, Benchmark.

Then have the SCPI, Screenshot, and Benchmark features operate on the instrument selected in Discovery.

I'm about to focus on implementing the HiSlip protocol - it will be a while before I revisit the GUI so I'm open for ideas and suggestions.

An instrument manufacturer is kindly sponsoring a HiSlip instrument so I will soon have something to test against  :-+
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 08, 2018, 02:47:55 pm
Siglent Technologies has kindly lent me their new SDS1204X-E oscilloscope (200 MHz, 4 channels) to help the lxi-tools open source effort :-+

I hooked it up, calibrated the 4 included probes, and after enabling the network interface (DHCP) it was easily discovered with lxi-tools.

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=385242)

It turns out that this is an absolutely blazingly fast scope, especially in terms of LXI/LAN SCPI command processing performance!

With the benchmark feature I'm getting ~1100 requests/s via TCP/VXI11:

Code: [Select]
$ lxi benchmark --address 192.168.1.125
Benchmarking by sending 1000 ID requests. Please wait...
Result: 1123.5 requests/second

And I get ~600 requests/s via TCP/RAW:
Code: [Select]
$ lxi benchmark --raw --address 192.168.1.125
Benchmarking by sending 1000 ID requests. Please wait...
Result: 1123.5 requests/second

This is quite impressive. Compared, the performance of e.g. the Rigol DS1054Z is ~30 requests/s via TCP/VXI11 and ~160 requests/s via TCP/RAW.

Of course, the faster performance is to be expected from a newly released scope which clearly uses a newer and faster chipset. However, fact still is, it is very fast and it is one of the first low cost scopes that makes it possible to easily implement a poor-mans data logger using LXI/LAN polling that can consistently sample data at e.g. 100 Hz or more.

I also notice that Siglent uses standard LXI ports as defined here: http://www.lxistandard.org/About/LXI-Protocols.aspx (http://www.lxistandard.org/About/LXI-Protocols.aspx)

That is, the available network ports for the SDS1204X-E are:
Code: [Select]
$ nmap -p- 192.168.1.125

Starting Nmap 7.60 ( [url]https://nmap.org[/url] ) at 2018-01-08 15:18 CET
Nmap scan report for 192.168.1.125
Host is up (0.042s latency).
Not shown: 65529 closed ports
PORT     STATE SERVICE
23/tcp   open  telnet
80/tcp   open  http
111/tcp  open  rpcbind
918/tcp  open  unknown
5024/tcp open  scpi-telnet
5025/tcp open  scpi-raw

Nmap done: 1 IP address (1 host up) scanned in 40.14 seconds

In particular, they use standard port 5025 for SCPI/RAW and port 5024 for SCPI/telnet. This is one of the odd things that Rigol fails to do for the DS1054Z (they place it on non-standard port 5555):

Code: [Select]
$ nmap -p- 192.168.1.210

Starting Nmap 7.60 ( [url]https://nmap.org[/url] ) at 2018-01-08 15:19 CET
Nmap scan report for 192.168.1.210
Host is up (0.080s latency).
Not shown: 65529 closed ports
PORT     STATE SERVICE
80/tcp   open  http
111/tcp  open  rpcbind
617/tcp  open  sco-dtmgr
618/tcp  open  dei-icda
619/tcp  open  compaq-evm
5555/tcp open  freeciv

Nmap done: 1 IP address (1 host up) scanned in 40.54 seconds

Taking a screenshot with the SDS1204X-E is very fast too:
Code: [Select]
$ time lxi screenshot -a 192.168.1.125
Loaded siglent-sds screenshot plugin
Saved screenshot image to screenshot_192.168.1.125_2018-01-08_15:37:22.bmp

real    0m0,141s
user    0m0,004s
sys     0m0,024s

Only ~0.14 second!

It's also nice to see that the Siglent scope has a small and light form factor which feels solid.

My first impressions are good - I'm looking forward to more testing with this instrument during the development of the GUI frontend for lxi-tools. It will also make a nice addition to the pool of instruments that I plan to use for lxi-tools performance and regression testing.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: BloodyCactus on January 09, 2018, 01:46:53 am
just because, why not :P R&S HMO1202 (which seems surprisingly slow...)

Code: [Select]
[ sgeorge @ workstation ] - [ ~/git/rai1/c64_c128_plus4 ] (master*)
[$]> lxi --version
lxi v1.17

[ sgeorge @ workstation ] - [ ~/git/rai1/c64_c128_plus4 ] (master*)
[$]> lxi benchmark --address scope.cactus
Benchmarking by sending 100 ID requests. Please wait...
Result: 13.9 requests/second

[ sgeorge @ workstation ] - [ ~/git/rai1/c64_c128_plus4 ] (master*)
[$]> lxi benchmark --raw --address scope.cactus
Benchmarking by sending 100 ID requests. Please wait...
Result: 12.6 requests/second

[ sgeorge @ workstation ] - [ ~/git/rai1/c64_c128_plus4 ] (master*)
[$]> nmap -p- scope.cactus

Starting Nmap 7.01 ( https://nmap.org ) at 2018-01-08 20:39 EST
Nmap scan report for scope.cactus (192.168.0.107)
Host is up (0.0022s latency).
Not shown: 65530 closed ports
PORT     STATE SERVICE
80/tcp   open  http
111/tcp  open  rpcbind
1024/tcp open  kdm
1025/tcp open  NFS-or-IIS
5025/tcp open  unknown

Nmap done: 1 IP address (1 host up) scanned in 11.73 seconds
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 09, 2018, 12:10:46 pm
just because, why not :P R&S HMO1202 (which seems surprisingly slow...)

He he - that is truly slow!

That must be the lowest benchmark scores I has seen so far.

I'm not that surprised though - well established big company instrument manufacturers like R&S tend to over engineer things and this sometimes leads to over engineered cost reduction. Likely their instrument is featuring a low cost, low performance application/communication processor or their application/network stack is horribly inefficient - I think the former is probably the case.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on January 09, 2018, 05:12:56 pm
Another instrument for you: Keysight 34461A multimeter.
Discovery works fine.
Sending scpi commands seems OK (e.g. *IDN? returns the expected ID string).
Trying to take a screenshot results in it trying to use the rigol-1000Z plugin, and thence timeout. Telling it to use the keysight-ivx plugin gave the same result.
Doing a benchmark gave a result of 45.1 requests a second.

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 09, 2018, 06:14:21 pm
Another instrument for you: Keysight 34461A multimeter.
Discovery works fine.
Sending scpi commands seems OK (e.g. *IDN? returns the expected ID string).
Trying to take a screenshot results in it trying to use the rigol-1000Z plugin, and thence timeout. Telling it to use the keysight-ivx plugin gave the same result.
Doing a benchmark gave a result of 45.1 requests a second.

Thanks. If you share the ID string that this instrument returns then I can fix the plugin matching part.

It looks like we need to create a new screenshot plugin for this instrument as it handles screenshots differently from the oscilloscopes.

EDIT: I have added a new screenshot plugin "keysight-dmm" that should work with your 34461A multimeter. Let me know if it works for you.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on January 10, 2018, 05:36:36 pm
Thanks. The ID string from the meter is
Keysight Technologies,34461A,<serial number here>,A.02.17-02.40-02.17-00.52-03-02
but apparently the ID string is user changeable to also make it look like an Agilent or HP unit, for backwards compatibility.

I tried
snap refresh lxi-tools --edge
to get your latest version, but it told me
snap "lxi-tools" has no updates available

snap list
reports
Name       Version  Rev   Developer  Notes
core       16-2.30  3748  canonical  core
lxi-tools  1.17     478   lundmar    -

Did I do something wrong? How should I get the new plugin?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 10, 2018, 06:17:42 pm
Thanks. The ID string from the meter is
Keysight Technologies,34461A,<serial number here>,A.02.17-02.40-02.17-00.52-03-02
but apparently the ID string is user changeable to also make it look like an Agilent or HP unit, for backwards compatibility.

I tried
snap refresh lxi-tools --edge
to get your latest version, but it told me
snap "lxi-tools" has no updates available

snap list
reports
Name       Version  Rev   Developer  Notes
core       16-2.30  3748  canonical  core
lxi-tools  1.17     478   lundmar    -

Did I do something wrong? How should I get the new plugin?

Good - the new plugin should match your ID.

Unfortunately it seems the snap build service is currently down and the ETA is unknown. Hopefully it will soon be available again so that a new snap will be built.

EDIT: It's because of the whole spectre/meltdown thing the build service is down.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on January 10, 2018, 07:02:06 pm
Good to know I haven't done something wrong. Will try again later, and report back. Thanks for the rapid responses! :)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 12, 2018, 02:13:49 pm
This is how I think the new lxi GUI (lxi-gui) is going to look:

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=387107;image)

To make it really simple, all features in the listed tab views (SPCI, Screenshot, Benchmark, etc.) operate on the instrument selected in the instrument list.

Currently instruments are automatically added to the list via the search feature but I expect to add the option of also adding instruments manually in case an instrument does not support discovery.

I think the structure of this GUI is very user friendly.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Karel on January 12, 2018, 03:05:09 pm
 :-+
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 12, 2018, 04:26:20 pm
Good to know I haven't done something wrong. Will try again later, and report back. Thanks for the rapid responses! :)

The lxi-tools snap is now up to date.

The snap build service is finally up and running again after they patched their build servers with Spectre/Meltdown fixes.

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on January 12, 2018, 06:04:18 pm
Great!  :-+ I now managed to snap refresh lxi-tools, and can confirm that the Keysight screenshot works as intended. :-+

The UI looks good too. Will it be possible to have multiple windows open, so you can send commands to more than one device at once? E.g. you might want to send frequency commands to an AWG, and measurement commands to a scope...

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 12, 2018, 07:14:57 pm
Great!  :-+ I now managed to snap refresh lxi-tools, and can confirm that the Keysight screenshot works as intended. :-+

Good - I've added it to the list of tested instruments. Thanks for testing  :-+

The UI looks good too. Will it be possible to have multiple windows open, so you can send commands to more than one device at once? E.g. you might want to send frequency commands to an AWG, and measurement commands to a scope...

Well, yes and no. You can open multiple instances of the application and this way control multiple instruments through different windows.

However, the tab views you see will only support one instrument at a time - namely the one selected.

The feature you are describing is something that I hope to eventually support in a script feature which might become part of lxi-gui.

Meaning, you will be able to use lxi-gui to build a script which contains various action items such as SCPI commands managing one or more instruments.

Each action item will be written in Lua which is a simple, fast, and powerful scripting language.

Lua will make it possible to create scripts looking like this (example):

Code: [Select]
inst0 = connect("vxi11://10.0.0.42")
inst1 = connect("vxi11://192.168.0.21")

scpi(inst0, ":source:frequency 10000")

sleep(1000)

voltage = scpi(inst1, ":measure:voltage:dc?")
if (voltage < 10.5) then fail() end

disconnect(inst1)
disconnect(inst0)

Or, a slightly different but object oriented variation of the same:

Code: [Select]
inst0 = connect("vxi11://10.0.0.42")
inst1 = connect("vxi11://192.168.0.21")

inst0.scpi(":source:frequency 10000")

sleep(1000)

voltage = inst1.scpi(":measure:voltage:dc?")
if (voltage < 10.5) then fail() end

disconnect(inst1)
disconnect(inst0)

Each section in this script can be a separate item in a graphical representation of the script.

The script can be saved/loaded from the application and there will be "play", "pause", "stop" buttons. When you press play it will run the script and each action item will be marked red or green depending on if they fail or succeed.

I think it will work quite nicely. Even though I don't have any plans to add an elaborate GUI for handling graphical scripting blocks I'm making it so it will be possible to add in the future. Ultimately, having Lua scripting support will make it possible to do some of the graphical programming that application such as BenchVue supports.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: nctnico on January 13, 2018, 03:27:09 pm
Lua support would be a great feature!  :-+
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 13, 2018, 04:16:34 pm
Lua support would be a great feature!  :-+

I think so too. Of all the scripting languages Lua is quite beautiful/straightforward and it has all the basic language features that are required for logic control. It helps keep the script syntax simple.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: alm on January 14, 2018, 09:54:13 am
If you develop this into an instrument control GUI and scripting language, would it not make sense to use an abstraction like VISA rather than interfacing with LXI directly? Otherwise developing a script while having an instrument without LXI in the mix (USBTMC/GPIB/RS-232) becomes a pain, while in VISA you would only change the connection string.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 14, 2018, 11:09:25 am
If you develop this into an instrument control GUI and scripting language, would it not make sense to use an abstraction like VISA rather than interfacing with LXI directly? Otherwise developing a script while having an instrument without LXI in the mix (USBTMC/GPIB/RS-232) becomes a pain, while in VISA you would only change the connection string.

I understand what you are saying but I'm afraid adding a VISA abstraction is beyond the scope and resources of this project.

As you said, VISA abstracts various interfaces such as VXI11/USBTMC/GPIB/RS-232. However, since this is lxi-tools the focus is exclusively on the interfaces supported by the LXI standard (VXI11/HiSLIP etc.) so for this project there are no plans to support other interfaces nor add a full blown VISA API in e.g. Lua.

What you are suggesting is something which would be an excellent feature for a future open source visa-tools project ;)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: nctnico on January 14, 2018, 11:29:50 am
If you develop this into an instrument control GUI and scripting language, would it not make sense to use an abstraction like VISA rather than interfacing with LXI directly? Otherwise developing a script while having an instrument without LXI in the mix (USBTMC/GPIB/RS-232) becomes a pain, while in VISA you would only change the connection string.
A better approach would be to add support to send commands to USBTMC or a COM port (both are pretty similar). VISA is way too bloated.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 14, 2018, 11:39:43 am
If you develop this into an instrument control GUI and scripting language, would it not make sense to use an abstraction like VISA rather than interfacing with LXI directly? Otherwise developing a script while having an instrument without LXI in the mix (USBTMC/GPIB/RS-232) becomes a pain, while in VISA you would only change the connection string.
A better approach would be to add support to send commands to USBTMC or a COM port (both are pretty similar). VISA is way to bloated.

I agree, if you look at the general syntax and features of VISA you either love it or hate it.

The interface that I plan to support in Lua will be much simpler - just a basic interface for sending SCPI commands, handling responses, and reporting failed test cases.

If this Lua interface proves itself to be useful/efficient/successful , one could consider expanding and adding support for non-LXI interfaces but I think that is something which should be reserved for another project.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: alm on January 14, 2018, 12:05:53 pm
A better approach would be to add support to send commands to USBTMC or a COM port (both are pretty similar). VISA is way to bloated.
I was not suggesting to use the NI-VISA implementation, but abstracting the protocol used to access an instrument. For example, there is a Python implementation (https://pyvisa-py.readthedocs.io/en/latest/) that is pretty light weight. When I was controlling a DSO that could either controlled through RS-232 or GPIB, I made my own abstraction that would call either ibconfig(), ibwrt() etc for GPIB, or tcsetattr(), write() etc for RS-232, so I did not have to sprinkle conditionals all through my code.

But obviously in a volunteer project the decision on what direction to go is entirely on the developers doing the work.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 14, 2018, 12:55:30 pm
A better approach would be to add support to send commands to USBTMC or a COM port (both are pretty similar). VISA is way to bloated.
I was not suggesting to use the NI-VISA implementation, but abstracting the protocol used to access an instrument. For example, there is a Python implementation (https://pyvisa-py.readthedocs.io/en/latest/) that is pretty light weight. When I was controlling a DSO that could either controlled through RS-232 or GPIB, I made my own abstraction that would call either ibconfig(), ibwrt() etc for GPIB, or tcsetattr(), write() etc for RS-232, so I did not have to sprinkle conditionals all through my code.

But obviously in a volunteer project the decision on what direction to go is entirely on the developers doing the work.

I think supporting non-LXI interfaces is out of scope for lxi-tools, VISA abstracted or not.

However, I do plan to support instruments with GPIB/RS-232 etc. but do so via a LXI bridge adapter.

Once lxi-tools is in a good shape I hope to maybe design such a thing and support it with open source firmware :)

After all, the future is about everything being network connected :)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 16, 2018, 11:52:46 pm
I've added the benchmark feature to the new lxi-gui application:

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=387105;image)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 17, 2018, 08:47:58 pm
Basic screenshot feature added:

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=387857;image)

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=387859;image)

Still a lot to be done. Needs some sort of (full screen) image viewer feature and perhaps a screenshot live view feature (continuously take screenshots - in case of the SDS1204X-E it can perform about 3 frames/second which is pretty good).
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 18, 2018, 06:01:09 pm
FYI - for those who want to try out the new lxi-gui application you should now be able to install and start it using the following commands:

Code: [Select]
$ snap install lxi-tools --edge
$ lxi-tools.lxi-gui

It should also be possible to simply start the application by searching for it in whatever desktop environment you have installed.

lxi-gui is still work in progress and I consider it BETA quality but the basic features are working (discover, SCPI, Screenshot, Benchmark).

If there is anyone out there who would like to help refine the GUI application please feel free to join the project.

I'm not an expert QT5 programmer so it takes time to figure out how to do QT stuff so any help would be appreciated, even if you have no experience in QT programming.

Also, if anyone have some good ideas on features or in which direction lxi-gui should go let yourself be heard :)

Some have suggested to add GUI frontends for various instruments. It is certainly a possibility but I don't have the bandwidth to create nor test such instrument specific interfaces myself. These are things which would be excellent to engage in by contributors who find such things useful. Imagine one of the tab views in lxi-gui automatically showing the instrument UI for the selected and supported instrument...
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 19, 2018, 03:34:11 pm
I've added the IEEE 488.2 Common Commands in the SCPI tab:

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=387977;image)

Each of the common command buttons displays a tool tip when hovering the mouse over the button.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 20, 2018, 08:46:33 am
The GUI is now fully responsive, meaning it supports resizing the application window to any size and the contents will adjust accordingly.

I consider the widget layout done. It's available via snap. I expect to include lxi-gui in an upcoming lxi-tools release.

This is what the final result looks like:

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=388072;image)

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=388074;image)

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=388076;image)

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=388078;image)

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=388190;image)

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=388080;image)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 22, 2018, 05:48:48 pm
First attempt at adding a simple data recorder feature:

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=388666;image)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 24, 2018, 05:20:44 pm
I've added a vote in the top of this thread: "What OS platform would you like to see lxi-tools ported to next?"

Feel free to cast your vote. Thanks  :-+
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Karel on January 24, 2018, 06:15:20 pm
I've added a vote in the top of this thread: "What OS platform would you like to see lxi-tools ported to next?"

Feel free to cast your vote. Thanks  :-+

I would like to see that you don't divide your resources over multiple platforms. Instead, focus on Linux only.

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: HoracioDos on January 26, 2018, 01:24:23 am
I would like to see that you don't divide your resources over multiple platforms. Instead, focus on Linux only.

Yeap! There's a missing option that I would like to vote: NONE!!!   >:D

 
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 26, 2018, 02:37:39 am
I would like to see that you don't divide your resources over multiple platforms. Instead, focus on Linux only.

Yeap! There's a missing option that I would like to vote: NONE!!!   >:D

Ha ha guys - I see what you are saying. Don't worry - I don't expect to spend time porting it anytime soon. The poll is just to get a feeling of what the demand is for other platforms.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 27, 2018, 11:36:43 pm
lxi-tools v1.17 has been released - see http://lxi-tools.github.io (http://lxi-tools.github.io)

This is the first release to include the new lxi-gui frontend which features some of the same features as the lxi command line tool plus a few additional features such as a screenshot viewer (single shot and live view) and a simple data recorder. lxi-gui is considered BETA but in a perfectly usable state.

It is available for installation via snap.

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=390160;image)

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=390184;image)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Dwaine on January 28, 2018, 08:03:18 am
How do you compile the lxi-gui?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 28, 2018, 01:50:41 pm
How do you compile the lxi-gui?

By default the configure script disables lxi-gui.

You have to add the '--enable-lxi-gui' configure flag.

However, if you can, I recommend simply using snap to install latest version which includes lxi-gui (lxi-tools.lxi-gui).
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Dwaine on January 28, 2018, 11:44:40 pm
Thanks.   I prefer to build by source.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Dwaine on January 29, 2018, 12:15:12 am
That worked great.  I had to change the Makefile.in for the fedora qmake-qt5. It was defaulting to qmake.

The GUI is really nice. Worked great with my Rigol scope.  Testing out the graphing with my DM3068.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 29, 2018, 12:31:43 am
That worked great.  I had to change the Makefile.in for the fedora qmake-qt5. It was defaulting to qmake.

The GUI is really nice. Worked great with my Rigol scope.  Testing out the graphing with my DM3068.

Great, and thanks  :-+

I'm pretty happy with the general design of the GUI - I hope we can keep this simple layout even as more features are added in the future.

FYI - the issue with calling the correct qmake should be resolved in latest git (it is now calling QT5 qmake indirectly via the qtchooser tool).

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on January 30, 2018, 10:42:28 am
Lundmar

Just a quick comment - the GUI is a little inflexible for small screens. I am running all this on a MacBook Air (under VirtualBox) which gives me an effective screen height of  just over 700 pixels. As a result, the bottom of the window is cut off, and there is no scroll bar etc to make it visible. Is there any simple way to make the window a bit more friendly to smaller screens?

Thanks for all the good work on this!

Ralph
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 30, 2018, 11:25:35 am
Lundmar

Just a quick comment - the GUI is a little inflexible for small screens. I am running all this on a MacBook Air (under VirtualBox) which gives me an effective screen height of  just over 700 pixels. As a result, the bottom of the window is cut off, and there is no scroll bar etc to make it visible. Is there any simple way to make the window a bit more friendly to smaller screens?

Thanks for all the good work on this!

Ralph

Hmm, isn't mac supposed to have them fancy high resolution Retina displays? ;)

I've reduced the minimum window size to 700x600 so I assume you can fit it now.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 01, 2018, 05:50:05 pm
I had to go back and update the benchmark performance numbers for the Siglent SDS1204X-E because it turns out my network routing tables were messed up so all tests were performed over wifi - arrghhhh!  |O

Over cabled network it's not doing ~300 requests/second.... It's doing ~1100 requests/second!!!!

Bam! Thats almost as fast as a Dolorean in overdrive!

With such result there is plenty room to make a poor-mans-datalogger sampling maybe several values at e.g. 100Hz or more.

Oh, and the screenshot live view feature in lxi-gui is now even more smooth hitting about 7 frames/second.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: technogeeky on February 01, 2018, 06:34:11 pm
I had to go back and update the benchmark performance numbers for the Siglent SDS1204X-E because it turns out my network routing tables were messed up so all tests were performed over wifi - arrghhhh!  |O

Over cabled network it's not doing ~300 requests/second.... It's doing ~1100 requests/second!!!!

Bam! Thats almost as fast as a Dolorean in overdrive!

With such result there is plenty room to make a poor-mans-datalogger sampling maybe several values at e.g. 100Hz or more.

Oh, and the screenshot live view feature in lxi-gui is now even more smooth hitting about 7 frames/second.

I haven't looked into this software for my oscilloscope (1054z), but I wanted to point out two things I learned when testing various software and hardware configurations in an effort to get the fastest screen capture of the 1054z to make videos/GIFs.

The first thing I learned is that, for the 1054z at least, there is a big difference in screen capture speed over ethernet versus USB; and furthermore this difference changes depending on OS. In my case (Linux) the USB capture was the fastest (maximum capture rate is about 1/3 of a second versus about 2 seconds).

So once I settled on the software and the USB screen capture method, I used the Rigol Bildschirmkopie (http://peter.dreisiebner.at/rigol-bildschirmkopie-lan/) software to capture "as fast as possible" (the next fastest option being once per second).

However while this does work, it causes many in-scope computed functions to slow down or cease computing entirely! This includes things like updating the various measurement items at the bottom of the screen; it includes the MATH functionality, and it includes the FFT. In other words, while the oscilloscope trace itself would be correct on every screen capture (every 1/3 of a second), the reported measured values would just freeze and stay the same (on both the oscilloscope and the captured screen). The FFT would freeze. And so on.

I'm aware of the notion that one of the main advantages of these new Siglent oscilloscopes is that they are faster, but I wanted to make sure you keep this in mind when doing tests and make sure to report this kind of behavior if you see it. If you do see it, it may be helpful to report the fastest synthetic test to get screen captures and also report how much slower you have to go, if any, to get all features on the screen to update.

As a corollary to this, since it seems the behavior of the Rigol is to drop updating certain on-screen functions if screenshot requests are made too fast, perhaps the Siglent behaves differently: it may slow down screenshot capture rates if there is much more computation going on. Perhaps this is worth testing too.

In any case, please capture a bunch of screenshots and use some software to string them together into a GIF so you can post it here and show off how pretty it is.

I use the free software GIMP, and the steps are pretty easy:

1. "Open as Layers" all of the captures.
2. Do Filters -> Animation -> Optimize (for GIF)
3. Export as GIF, and be sure to set: export as animation, set a reasonable delay between frames, use delay for all frames, and select combine.

I look forward to seeing some samples of what that scope can do in this regard!
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Karel on February 01, 2018, 07:04:45 pm
In my case (Linux) the USB capture was the fastest (maximum capture rate is about 1/3 of a second versus about 2 seconds).

Put a USB webcam in front of the scope and you'll get a much higher framerate.
And it doesn't slowdown the scope...
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 01, 2018, 07:11:24 pm
I haven't looked into this software for my oscilloscope (1054z), but I wanted to point out two things I learned when testing various software and hardware configurations in an effort to get the fastest screen capture of the 1054z to make videos/GIFs.

The first thing I learned is that, for the 1054z at least, there is a big difference in screen capture speed over ethernet versus USB; and furthermore this difference changes depending on OS. In my case (Linux) the USB capture was the fastest (maximum capture rate is about 1/3 of a second versus about 2 seconds).

So once I settled on the software and the USB screen capture method, I used the Rigol Bildschirmkopie (http://peter.dreisiebner.at/rigol-bildschirmkopie-lan/) software to capture "as fast as possible" (the next fastest option being once per second).

However while this does work, it causes many in-scope computed functions to slow down or cease computing entirely! This includes things like updating the various measurement items at the bottom of the screen; it includes the MATH functionality, and it includes the FFT. In other words, while the oscilloscope trace itself would be correct on every screen capture (every 1/3 of a second), the reported measured values would just freeze and stay the same (on both the oscilloscope and the captured screen). The FFT would freeze. And so on.

I'm aware of the notion that one of the main advantages of these new Siglent oscilloscopes is that they are faster, but I wanted to make sure you keep this in mind when doing tests and make sure to report this kind of behavior if you see it. If you do see it, it may be helpful to report the fastest synthetic test to get screen captures and also report how much slower you have to go, if any, to get all features on the screen to update.

As a corollary to this, since it seems the behavior of the Rigol is to drop updating certain on-screen functions if screenshot requests are made too fast, perhaps the Siglent behaves differently: it may slow down screenshot capture rates if there is much more computation going on. Perhaps this is worth testing too.


Sure - I already plan to report back such findings. But first I have to fix some things with the data recorder feature in lxi-gui - once that is solved I'm going to play around to see how fast my instruments can actually sample with 2 or more data measurements.

I am of course fully aware there is a difference between benchmarking the request/response time and sampling various measurements. If the measurements are super slow because the chipset or any of its sampling subsystems are slow or overloaded then a quick network response time is no use.

I'm not surprised USB is faster on your Rigol, after all USB2 is 4-5 times faster than your typical 100 Mb/s Ethernet connection which most instruments still rely on. They have yet to jump the 1 Gb/s wagon. I expect we will see that happen soon as modern chipsets are now starting to feature 1G/s network interfaces.

In any case, please capture a bunch of screenshots and use some software to string them together into a GIF so you can post it here and show off how pretty it is.

I use the free software GIMP, and the steps are pretty easy:

1. "Open as Layers" all of the captures.
2. Do Filters -> Animation -> Optimize (for GIF)
3. Export as GIF, and be sure to set: export as animation, set a reasonable delay between frames, use delay for all frames, and select combine.

I look forward to seeing some samples of what that scope can do in this regard!

I can put together a small sample.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: technogeeky on February 01, 2018, 07:12:36 pm
In my case (Linux) the USB capture was the fastest (maximum capture rate is about 1/3 of a second versus about 2 seconds).

Put a USB webcam in front of the scope and you'll get a much higher framerate.
And it doesn't slowdown the scope...

As though I hadn't considered this. A scope capture program also doesn't suffer from hands going in front of the screen.

In practice, the solution I mentioned works quite well. For example*:

(https://i.imgur.com/U3K1iw9.gif)


* Note this is at a deceptively high frame rate because it's a capture over 45 minutes.


Another example, taken at 1 screenshot per second:

(https://i.imgur.com/7i8P7zU.gif).
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 01, 2018, 08:44:29 pm
I captured a video instead to capture the time correctly:

https://raw.githubusercontent.com/lxi-tools/misc/master/lxi-gui-benchmark-live-view-sds1204xe.webm

It demonstrates the benchmark and live screenshot feature on the SDS1204X-E. It feels quite responsive.

Update: New video.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 03, 2018, 03:18:25 am
lxi-tools is now on youtube:

https://www.youtube.com/channel/UCDySM9OfJsJ99LBhrfv-pFQ (https://www.youtube.com/channel/UCDySM9OfJsJ99LBhrfv-pFQ)

First video uploaded:

https://youtu.be/8EE3mf_wADg (https://youtu.be/8EE3mf_wADg)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: HoracioDos on February 03, 2018, 11:37:42 am
lxi-tools is now on youtube:
Already subscribed here. I hope this is the first of many others regardless of lxi-tools.  :-+
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Hydron on February 03, 2018, 12:23:02 pm
Looks great, will have a play with my RTB2004 when i get time.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 03, 2018, 03:16:43 pm
Looks great, will have a play with my RTB2004 when i get time.

Let me know when you do you, then we can create a screenshot plugin and get it working with lxi-tools  :-+

Update: I went ahead and updated the existing Rohde & Schwarz plugin to make it support RTB 2000. It should work with your instrument. It is available for testing via the snap edge channel.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Jester on February 03, 2018, 03:53:48 pm
I can't wait for a Windows version.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 03, 2018, 03:54:23 pm
lxi-tools is now on youtube:
Already subscribed here. I hope this is the first of many others regardless of lxi-tools.  :-+

Thanks for your encouragement. I hope to create more videos in the future :)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 03, 2018, 04:04:09 pm
I can't wait for a Windows version.

One of two things might happen:

 * snaps will magically become supported on Windows via clever virtualization
 * someone ports lxi-tools to Windows

For now, my focus is on new features so I'm hoping the first might happen, which will require no effort, or that someone steps in to help make lxi-tools work on Windows.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Gabri74 on February 05, 2018, 09:52:47 am
I captured a video instead to capture the time correctly:

https://raw.githubusercontent.com/lxi-tools/misc/master/lxi-gui-benchmark-live-view-sds1204xe.webm

It demonstrates the benchmark and live screenshot feature on the SDS1204X-E. It feels quite responsive.

Really nice, great work!
One question: does the continuous screenshotting via the live feature impact scope performance ? Did you see any slowdown in the responsiveness of the Siglent UI ?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 05, 2018, 02:10:28 pm
I captured a video instead to capture the time correctly:

https://raw.githubusercontent.com/lxi-tools/misc/master/lxi-gui-benchmark-live-view-sds1204xe.webm

It demonstrates the benchmark and live screenshot feature on the SDS1204X-E. It feels quite responsive.

Really nice, great work!
One question: does the continuous screenshotting via the live feature impact scope performance ? Did you see any slowdown in the responsiveness of the Siglent UI ?

Thanks. No, it still felt quite responsive during the live view. However, it was a simple test so I will have to do some more testing to tell for sure.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 05, 2018, 05:08:03 pm
A big thank you and shout-out to Kikusui Electronics Corporation who has sponsored one of their latest generation compact DC power supplies, the PMX35-3A (http://www.kikusui.co.jp/en/product/detail.php?IdFamily=0130), to support the continued development of the open source lxi-tools project  :-+

I hooked it up to power one of my embedded Linux development boards and connected it to the network after which it was easily discovered with lxi-tools.

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=392670;image)

This is a really nice and compact DC power supply but what makes it particular interesting for the lxi-tools project, besides being fully LXI compliant, is the fact that it features the new HiSlip communication protocol and mDNS/DNS-SD service discovery. This device is going to be very helpful and instrumental in the effort to bring HiSlip and mDNS discovery features to lxi-tools.

In fact, testing with the PMX35-3A revealed the already implemented lxi-tools mDNS discovery feature to be broken. After further testing and debug this has been fixed and the mDNS discover feature now works perfectly fine:

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=392672;image)

Also, as is evident from the screenshot above, the PMX is an absolute screaming performance beast when it comes to VXI-11 and RAW communication speed!

With ~1600 requests/second for VXI-11 and as high as ~3700 requests/second for RAW - this is like nothing I have ever seen before - good work Kikusui!  :-+
 
After fixing the mDNS discover feature I started playing with the PMX device in combination with lxi-gui to test and refine the new data recorder feature. The end result is demonstrated in this youtube video:

https://youtu.be/QPgAGEImD0U (https://youtu.be/QPgAGEImD0U)

Notice that the data recorder now automatically scales the chart axes and supports saving sample data to CSV for later import in e.g. Libreoffice Calc.

The command line lxi tool has been stable for a while and the new lxi-gui is now also getting in pretty good shape with all the basic features working. Next, focus is going to be on implementing an open source HiSlip library and armed with the Kikusui PMX35-3A we will now have a faster path to test and make sure the HiSlip implementation is correct  :-+
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 05, 2018, 11:37:30 pm
New releases available:

https://github.com/lxi-tools/lxi-tools/releases/download/v1.18/lxi-tools-1.18.tar.xz
https://github.com/lxi-tools/liblxi/releases/download/v1.11/liblxi-1.11.tar.xz

Detailed list of changes can be found here:
https://github.com/lxi-tools/lxi-tools/releases/tag/v1.18
https://github.com/lxi-tools/liblxi/releases/tag/v1.11

Update: New stable snap is available.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: HoracioDos on February 06, 2018, 02:11:02 pm
I hooked it up to power one of my embedded Linux development boards and connected it to the network after which it was easily discovered with lxi-tools.
Nice!! It has its own LAN port. I would like to setup a USB to Ethernet bridge with a raspberry pi and try to send commands to a KORAD 3005p (Serial and USB ports only) just for fun.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 06, 2018, 02:52:39 pm
I hooked it up to power one of my embedded Linux development boards and connected it to the network after which it was easily discovered with lxi-tools.
Nice!! It has its own LAN port. I would like to setup a USB to Ethernet bridge with a raspberry pi and try to send commands to a KORAD 3005p (Serial and USB ports only) just for fun.

It could be fun to create a LXI compatible Ethernet/USB/Serial bridge. This is one of the things that will become possible with the new hislip library I'm writing - it will support both server and client side.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Hydron on February 07, 2018, 11:19:39 am
I have done a quick test of the RTB2004 using the "edge" release. Screenshots seem to work well, taking ~1.2s to capture. This is fine for screenshots but way too slow for making a video, best to use the fast web livescreen/remote panel if you need that. Discovery and screenshot plugin autodetect also work.

Benchmark shows the following (2 channels, roll mode - these numbers change significantly depending on how much work the scope is doing):
Code: [Select]
lxi benchmark -a 192.168.0.47 -c 1000
Benchmarking by sending 1000 ID requests. Please wait...
Result: 74.9 requests/second
lxi benchmark -a 192.168.0.47 -c 1000 -r
Benchmarking by sending 1000 ID requests. Please wait...
Result: 140.9 requests/second
I haven't tried logging anything yet, or the GUI.

Thanks for the work on this tool - I look forward to it's continued development!
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 07, 2018, 02:01:15 pm
I have done a quick test of the RTB2004 using the "edge" release. Screenshots seem to work well, taking ~1.2s to capture. This is fine for screenshots but way too slow for making a video, best to use the fast web livescreen/remote panel if you need that. Discovery and screenshot plugin autodetect also work.

Benchmark shows the following (2 channels, roll mode - these numbers change significantly depending on how much work the scope is doing):
Code: [Select]
lxi benchmark -a 192.168.0.47 -c 1000
Benchmarking by sending 1000 ID requests. Please wait...
Result: 74.9 requests/second
lxi benchmark -a 192.168.0.47 -c 1000 -r
Benchmarking by sending 1000 ID requests. Please wait...
Result: 140.9 requests/second
I haven't tried logging anything yet, or the GUI.

Thanks for the work on this tool - I look forward to it's continued development!

Great. It's not the fastest scope we have seen but it's not that slow either. However, I'm surprised that the instruments web live view feature is faster - it may be using a media streaming protocol to make it faster. Interesting.

Also, we might make the screenshot feature a bit faster by reconfiguring the plugin fo BMP instead of PNG. For some instruments PNG compression is relatively slow.

I'll add the scope to the list of tested instruments and add you as contributor for testing. Thanks.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Hydron on February 07, 2018, 05:58:22 pm
The live view/control is VERY fast, e.g. see this video:
https://www.youtube.com/watch?v=_6CdaeLQ6hY&t=2955 (https://www.youtube.com/watch?v=_6CdaeLQ6hY&t=2955)
(skip to 50 min for a nice display of a swept function gen)

Unfortunately the UI could do with some speed improvements, especially when using lots of functions and channels simultaneously (and this is reflected in the LXI numbers as well). While it has a 1Gbit Ethernet interface, I don't think this has much effect as the bottleneck is not the connection (linked video is via WiFi access point I think). It's a shame as otherwise you could do some cool things with 1Gbit of network bandwidth (e.g. 10s of MSa/s streaming, or fast data capture/manipulation on PC). Hopefully manufacturers will start to improve in this area.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 07, 2018, 06:14:12 pm
The live view/control is VERY fast, e.g. see this video:
(skip to 50 min for a nice display of a swept function gen)

Unfortunately the UI could do with some speed improvements, especially when using lots of functions and channels simultaneously (and this is reflected in the LXI numbers as well). While it has a 1Gbit Ethernet interface, I don't think this has much effect as the bottleneck is not the connection (linked video is via WiFi access point I think). It's a shame as otherwise you could do some cool things with 1Gbit of network bandwidth (e.g. 10s of MSa/s streaming, or fast data capture/manipulation on PC). Hopefully manufacturers will start to improve in this area.

That looks like a very nice and responsive web live control interface. The update rate must be 24 fps or more and I bet that the video feed is hardware encoded and streamed via RTSP or similar protocol. Every scope should do this :)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Hydron on February 07, 2018, 06:38:58 pm
I haven't looked properly into how they're doing it, but I don't think it's a hardware encoded video - everything is FPGA based internally so there's no hard IP blocks to do something like that (and no evidence of video encoding artifacts). I've attached the web page source and the "screencam.js" client side code incase it's of interest (the other javascript used is some standard library by the looks of it). I had to add .txt extension because of forum limitation.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 07, 2018, 07:05:12 pm
I haven't looked properly into how they're doing it, but I don't think it's a hardware encoded video - everything is FPGA based internally so there's no hard IP blocks to do something like that (and no evidence of video encoding artifacts). I've attached the web page source and the "screencam.js" client side code incase it's of interest (the other javascript used is some standard library by the looks of it). I had to add .txt extension because of forum limitation.

Ahh, I see. They are simply retrieving the image data directly from the webserver via HTTP requests:

"XMLHttpRequest;c.open("GET","/screenshot?img="+b+"&key="+vm,!0);c.setRequestHeader("Cache-Control","no-cache");..."

I can't tell from the code but the image format is likely just raw bitmap.

Inspired by this, I went ahead and reconfigured the R&S screenshot plugin to BMP. Feel free to test and see if it is faster than before :)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Hydron on February 07, 2018, 07:42:22 pm
I tried to "refresh" the snap version to test, it reported that it was already up to date. Should I remove the snap version and clone/build the git repo?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 07, 2018, 07:51:02 pm
I tried to "refresh" the snap version to test, it reported that it was already up to date. Should I remove the snap version and clone/build the git repo?

It's all automated so when I push a change to github the snap is automatically built and released for the various architectures. It usually only takes 10-20 minutes for a full update but currently it seems that i386/amd64 snaps are lagging behind.

You can see when it is updated here:
https://build.snapcraft.io/user/lxi-tools/lxi-tools.snapcraft

I expect they will build soon.

Update: Snaps with the updated R&S plugin are now built and released (edge channel).
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Hydron on February 07, 2018, 10:23:34 pm
No change in time for BMP, so the live screen view must be doing something different...
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 07, 2018, 10:29:33 pm
No change in time for BMP, so the live screen view must be doing something different...

Ok, well - it was worth a shot.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 11, 2018, 02:00:02 pm
The SCPI tab page has been updated with some of the most useful mandatory SCPI 1999.0 commands. Especially the ":system:error?" command comes handy when programming and trying out commands.

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=394134;image)

Also, the "OPT?" command has been removed from the Common Commands as it is not strictly part of the IEEE 488.2 standard.

With the exception of adding support for adding customs command buttons I think this interface is done.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: N0NB on February 11, 2018, 06:21:47 pm
I can report that my Siglent SDS 1202X-E benchmarks at 929 samples/second at 9999 samples.  The live view works surprisingly well.  Thanks, Martin.

For those of you who use Slackware, I have uploaded build scripts to SlackBuilds.org for both liblxi 1.9 and lxi-tools 1.16.  I have updates pending for 1.11 and 1.18, respectively, with a build option for the GUI so long as the SBo qt5 package is installed.  The scripts work for Slackware 14.2, bith 32 and 64 bit.

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: awallin on February 17, 2018, 08:53:01 am
Hi Lundmar, everyone,

I'd like to make an instrument that is controlled by LXI, I'm using an Arduino Due with Ethernet-shield on the Due.

Could you give some pointers on where to begin?
By googling I found some parsers for SCPI-commands (formatted ascii-text) - but I'm not sure what goes on top of the Arduino Ethernet driver to receive LXI commands?
Previously we used Modbus/TCP on the Arduino Due (and found a ready made library for that), but I'd like to move to LXI as modbus seems quite 1980s... ^-^

thanks!
AW
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: N0NB on February 17, 2018, 01:38:59 pm
I can report that SlackBuild scripts for liblxi 1.11 and lxi-tools (with build option for the GUI) for Slackware/Slackware64 14.2 and friends are now live at SlackBuilds.org.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 17, 2018, 04:45:46 pm
Hi Lundmar, everyone,

I'd like to make an instrument that is controlled by LXI, I'm using an Arduino Due with Ethernet-shield on the Due.

Could you give some pointers on where to begin?
By googling I found some parsers for SCPI-commands (formatted ascii-text) - but I'm not sure what goes on top of the Arduino Ethernet driver to receive LXI commands?
Previously we used Modbus/TCP on the Arduino Due (and found a ready made library for that), but I'd like to move to LXI as modbus seems quite 1980s... ^-^

thanks!
AW

A LXI compatible instrument supports one of the following protocols for communicating SCPI: RAW/TCP, VXI11/TCP, HiSlip/TCP.

You have to decide which communication protocol to go with for your server implementation and then add to that your SCPI parser.

RAW/TCP offers fast communication but is less robust. It is easy to implement as it is just a standard socket TCP server. There are countless examples available online on how to create socket TCP servers.

VXI11/TCP is robust but slow as it introduces a lot of protocol communication overhead. It is more complicated to implement as it is a protocol based on the aging RPC framework. Both VXI11 client and server stubs are defined by this file: https://github.com/lxi-tools/liblxi/blob/master/src/vxi11core.rpcl and then generated into C code using the rpcgen tool: https://linux.die.net/man/1/rpcgen . General guides on how to implement a RPC(gen) server are available, for example: https://docs.oracle.com/cd/E19683-01/816-1435/rpcgenpguide-21470/index.html . However, the specific VXI11 server stub implementation is largely undocumented AFAIK which makes it harder to implement.

HiSlip/TCP is the future communications protocol for LXI compatible instruments. It is robust and basically just as fast as a RAW/TCP connection because it has very little communication overhead. I'm not aware of any open source client/server HiSlip implementations so I have started writing my own: https://github.com/lxi-tools/libhislip . It is still work in progress but now that I have finished the basics of lxi-gui I hope to continue this project but it won't be done anytime soon.

VXI-11 is available in most LXI compatible instruments and kind of considered the standard option. To keep things simple and get something working fast, you might just want to go with RAW/TCP.

Finally, to make your instrument discoverable on the network you will have to implement either VXI11 discovery or mDNS/DNS-SD. In your case, I recommend the first option as it is easy to implement, especially in an Arduino type environment. It's basically just a specific response to a network broadcast message.

I hope this helps you decide in which direction to go.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: awallin on February 18, 2018, 08:05:10 am
A LXI compatible instrument supports one of the following protocols for communicating SCPI: RAW/TCP, VXI11/TCP, HiSlip/TCP.

You have to decide which communication protocol to go with for your server implementation and then add to that your SCPI parser.

RAW/TCP offers fast communication but is less robust. It is easy to implement as it is just a standard socket TCP server. There are countless examples available online on how to create socket TCP servers.

VXI11/TCP is robust but slow as it introduces a lot of protocol communication overhead. It is more complicated to implement as it is a protocol based on the aging RPC framework. Both VXI11 client and server stubs are defined by this file: https://github.com/lxi-tools/liblxi/blob/master/src/vxi11core.rpcl (https://github.com/lxi-tools/liblxi/blob/master/src/vxi11core.rpcl) and then generated into C code using the rpcgen tool: https://linux.die.net/man/1/rpcgen (https://linux.die.net/man/1/rpcgen) . General guides on how to implement a RPC(gen) server are available, for example: https://docs.oracle.com/cd/E19683-01/816-1435/rpcgenpguide-21470/index.html (https://docs.oracle.com/cd/E19683-01/816-1435/rpcgenpguide-21470/index.html) . However, the specific VXI11 server stub implementation is largely undocumented AFAIK which makes it harder to implement.

Thanks for this explanation. I found this vxi-11 implementation on arduino due:
https://www.bankras.org/projects/electronics/instrument-of-things/ (https://www.bankras.org/projects/electronics/instrument-of-things/)
and that code is now here: https://github.com/bankrasrg/colortestkitmeter (https://github.com/bankrasrg/colortestkitmeter)

I will try to get it working and see how far I get.
If it gets too complicated I guess I will just fall back to simple http control only.

AW
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 18, 2018, 02:01:37 pm
A LXI compatible instrument supports one of the following protocols for communicating SCPI: RAW/TCP, VXI11/TCP, HiSlip/TCP.

You have to decide which communication protocol to go with for your server implementation and then add to that your SCPI parser.

RAW/TCP offers fast communication but is less robust. It is easy to implement as it is just a standard socket TCP server. There are countless examples available online on how to create socket TCP servers.

VXI11/TCP is robust but slow as it introduces a lot of protocol communication overhead. It is more complicated to implement as it is a protocol based on the aging RPC framework. Both VXI11 client and server stubs are defined by this file: https://github.com/lxi-tools/liblxi/blob/master/src/vxi11core.rpcl (https://github.com/lxi-tools/liblxi/blob/master/src/vxi11core.rpcl) and then generated into C code using the rpcgen tool: https://linux.die.net/man/1/rpcgen (https://linux.die.net/man/1/rpcgen) . General guides on how to implement a RPC(gen) server are available, for example: https://docs.oracle.com/cd/E19683-01/816-1435/rpcgenpguide-21470/index.html (https://docs.oracle.com/cd/E19683-01/816-1435/rpcgenpguide-21470/index.html) . However, the specific VXI11 server stub implementation is largely undocumented AFAIK which makes it harder to implement.

Thanks for this explanation. I found this vxi-11 implementation on arduino due:
https://www.bankras.org/projects/electronics/instrument-of-things/ (https://www.bankras.org/projects/electronics/instrument-of-things/)
and that code is now here: https://github.com/bankrasrg/colortestkitmeter (https://github.com/bankrasrg/colortestkitmeter)

I will try to get it working and see how far I get.
If it gets too complicated I guess I will just fall back to simple http control only.

AW

Interesting implementation. Though, it's a shame it is GPLv3.

Good luck.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Karel on February 18, 2018, 02:13:57 pm
Though, it's a shame it is GPLv3.

????  :palm:
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 18, 2018, 02:22:53 pm
Though, it's a shame it is GPLv3.

????  :palm:

I would prefer a more permissive license. If you include GPLv3 code in your firmware you are forced to make all your firmware GPLv3.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Karel on February 18, 2018, 02:29:07 pm
Though, it's a shame it is GPLv3.

????  :palm:

I would prefer a more permissive license. If you include GPLv3 code in your firmware you are forced to make all your firmware GPLv3.

And what's wrong with that? You use my code, I use your code. Sounds fair to me.

You'd prefer that people can take without giving back?? Doesn't sound fair to me.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 18, 2018, 02:35:12 pm
Though, it's a shame it is GPLv3.

????  :palm:

I would prefer a more permissive license. If you include GPLv3 code in your firmware you are forced to make all your firmware GPLv3.

And what's wrong with that? You use my code, I use your code. Sounds fair to me.

You'd prefer that people can take without giving back?? Doesn't sound fair to me.

I would prefer people take my code and use it in whatever way they want - if they give back fine, if not fine too. I don't really want to put any restrictions like the GPLv3 does.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Karel on February 18, 2018, 02:41:56 pm
I would prefer people take my code and use it in whatever way they want - if they give back fine, if not fine too. I don't really want to put any restrictions like the GPLv3 does.

Why is it a shame if somebody wants  to put restrictions on the use of his software?

According to you it's a shame if people want to sell software, either open or closed source,
either for money or for giving back your code?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 18, 2018, 03:07:18 pm
I would prefer people take my code and use it in whatever way they want - if they give back fine, if not fine too. I don't really want to put any restrictions like the GPLv3 does.

Why is it a shame if somebody wants  to put restrictions on the use of his software?

According to you it's a shame if people want to sell software, either open or closed source,
either for money or for giving back your code?

Thats not what I said at all.

I don't mind people putting restrictions on the open source software they publish. What matters is what kind of restrictions.

I support free choice - with GPLv3 all your firmware code is forced to be GPLv3 - that seems less of a free choice to me.

I don't mind people taking my code and mixing/linking it with their proprietary or other open source licensed software and sell it as a product. If they find it useful they are free to contribute back any fixes or improvements they make and reap the long term maintenance benefits of doing so... or not. That's free choice.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Karel on February 18, 2018, 03:16:01 pm
I would prefer people take my code and use it in whatever way they want - if they give back fine, if not fine too. I don't really want to put any restrictions like the GPLv3 does.

Why is it a shame if somebody wants  to put restrictions on the use of his software?

According to you it's a shame if people want to sell software, either open or closed source,
either for money or for giving back your code?

Thats not what I said at all.

You said: "it's a shame it is GPLv3"
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 18, 2018, 03:39:24 pm
I would prefer people take my code and use it in whatever way they want - if they give back fine, if not fine too. I don't really want to put any restrictions like the GPLv3 does.

Why is it a shame if somebody wants  to put restrictions on the use of his software?

According to you it's a shame if people want to sell software, either open or closed source,
either for money or for giving back your code?

Thats not what I said at all.

You said: "it's a shame it is GPLv3"

Yes, exactly. For the reasons I stated.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Karel on February 18, 2018, 04:25:28 pm
I would prefer people take my code and use it in whatever way they want - if they give back fine, if not fine too. I don't really want to put any restrictions like the GPLv3 does.

Why is it a shame if somebody wants  to put restrictions on the use of his software?

According to you it's a shame if people want to sell software, either open or closed source,
either for money or for giving back your code?

Thats not what I said at all.

You said: "it's a shame it is GPLv3"

Yes, exactly. For the reasons I stated.

So, you say it's a shame if somebody publishes opensource code under a license that requires you to give back your code.
But isn't it a shame if people only want to take and not to give back?

It's a shame that my baker asks money for his bread. This way I can't take his bread without giving him money. My baker is too restrictive... :palm:


Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: dpenev on February 18, 2018, 05:40:55 pm
Karel,

Why we should be so literal?
Lets thank lundmar for his great work
And let everyone of us has its own opinion about the open source licenses :)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Karel on February 18, 2018, 05:48:40 pm
Karel,

Why we should be so literal?
Lets thank lundmar for his great work
And let everyone of us has its own opinion about the open source licenses :)

Agreed.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 18, 2018, 09:17:38 pm
I would prefer people take my code and use it in whatever way they want - if they give back fine, if not fine too. I don't really want to put any restrictions like the GPLv3 does.

Why is it a shame if somebody wants  to put restrictions on the use of his software?

According to you it's a shame if people want to sell software, either open or closed source,
either for money or for giving back your code?

Thats not what I said at all.

You said: "it's a shame it is GPLv3"

Yes, exactly. For the reasons I stated.

So, you say it's a shame if somebody publishes opensource code under a license that requires you to give back your code.
But isn't it a shame if people only want to take and not to give back?

It's a shame that my baker asks money for his bread. This way I can't take his bread without giving him money. My baker is too restrictive... :palm:

Karel, I'm a big proponent of open source software and I suspect we can agree on most things open source.

However, to understand why I think it is a shame that this particular code is licensed under GPLv3 you have to understand the subtle but important differences between the various open source licenses and in particular what makes GPLv3 problematic in this case.

I don't want to use your baker analogy because well, analogies like that are not precise nor well translated.

Imagine instead that an instrument manufacturer is creating a new advanced instrument and have invested 10 man years or more of engineering work into implementing its micro-controller firmware. Now, if the manufacturer wants to use this specific GPLv3 VXI11 implementation to add a VXI11 feature to the instrument, that means the manufacturer would also be forced to release all firmware code under the same GPLv3 license basically inviting competing instrument manufacturers to simply take/steal the entire firmware work when the product is released. This is clearly a futile way for an instrument manufacturer to make money.

Instead, if the same VXI11 implementation is released under a more permissive license such as a BSD type license or even LGPLv2 then the instrument manufacturer is free to use the VXI11 implementation without compromising the rest of the heavily invested firmware. This way the instrument manufacturer might end up actually using and improving the open source VXI11 implementation and, in case of LGPLv2, be obligated to give back those improvements and, in case of a BSD type license, not be obligated to give back but might feel inclined to do so anyway simply to avoid self maintaining any improvements long term. Also, optimistically, if the instrument manufacturer can't use the GPLv3 VXI11 implementation the manufacturer might start their own VXI11 open source project instead of contributing to the original project and that would ultimately result in a waste of community resources.

Open source licensing is complicated and one has to choose carefully which license to use to maximize the use and success of any open source project.

I don't want to turn this into a big GPLv3 discussion thread but I'm not alone in expressing my concerns with GPLv3 - there are valid reasons why the BSD people dislike GPL and also why Linus Torvalds continue to license the Linux kernel under GPLv2 instead of GPLv3.

Anyway, I hope it is now clear to everyone why I think it is a shame this particular open source VXI11 code is licensed under GPLv3 instead of a more permissive open source license. Hence my original statement.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 19, 2018, 11:51:45 pm
It is possible to add an instrument UI feature to lxi-gui.

Here is a couple of mockups:

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=396630;image)

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=396632;image)

When a supported instrument is chosen in the instrument list the corresponding instrument UI could be loaded.

All buttons could be made pushable and the dials rotate able (perhaps easily by using QT Quick/QML).

Also, the Instrument UI could be combined with the live view feature or a digit generator to offer full control and feedback.

I'm just putting the idea out there since I won't have any time myself to implement this. However, lxi-gui and QT5 provides the basic framework and includes the bits and pieces that makes it possible to add such feature.

Maybe someone would like to jump this idea and take a shot a implementing it.

Hoping there is a QT5 buff out there who would like to get involved :)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Hydron on February 20, 2018, 10:19:23 am
To go with the above post, here is an example of the web UI of the RTB2004, which I'm guessing is the sort of thing that lundmar is getting to:
(note that the mouse was hovering over the horizontal scale knob when I captured this - see the arrows that come up)
Unfortunately implementing this isn't something I can do either (in this case due to lack of skill rather than time, though time is lacking as well!)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 20, 2018, 04:57:41 pm
To go with the above post, here is an example of the web UI of the RTB2004, which I'm guessing is the sort of thing that lundmar is getting to:
(note that the mouse was hovering over the horizontal scale knob when I captured this - see the arrows that come up)
Unfortunately implementing this isn't something I can do either (in this case due to lack of skill rather than time, though time is lacking as well!)

Thats one of the best examples and exactly what I'm inspired by but instead of a web page it will be a plugin in lxi-gui. Such instrument UI feature could be convenient and useful, in particular for instruments that has no web page like that or maybe the instrument web page is no good.

Though, it's a lot of work but it could be done.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on February 20, 2018, 06:48:07 pm
To be honest, I don't see the point of front panel emulators. If I want to use the instruments front panel, I dont need a computer.

What would be much more useful in my view would be some way of writing simple scripts so I can do something like this

For V = 0 to 3.3 step 0.1
Set the power supply output to V
Tell the meter to read the current I
Save V, I to file
End for

Surely such automation is the real use of LXI, not just having a remote front panel?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 20, 2018, 08:02:14 pm
To be honest, I don't see the point of front panel emulators. If I want to use the instruments front panel, I dont need a computer.

What would be much more useful in my view would be some way of writing simple scripts so I can do something like this

For V = 0 to 3.3 step 0.1
Set the power supply output to V
Tell the meter to read the current I
Save V, I to file
End for

Surely such automation is the real use of LXI, not just having a remote front panel?

I think it is safe to say that people have different needs - for some such a remote front panel might be useful.

In my case, I actually have all of my instruments installed in a lab room separate from my office room in which I spend most of my work time. It's really nice to not have to listen to the accumulated loud noise that most instruments generate and if I just need to quick tweak an instrument I believe such remote feature could be convenient.

That being said, my current development priorities are adding support for HiSlip and eventually Lua scripting to support exactly what you describe.

I'm just putting the instrument UI idea out there in case someone think it is a good idea and would like to take a crack at it :)

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 23, 2018, 03:10:01 pm
FYI - the snapcraft folks have accepted my request for automatic alias of lxi-gui.

This means, to start the lxi-tools GUI application, you can now use the shorter straightforward alias 'lxi-gui' instead of 'lxi-tools.lxi-gui'

The new alias should be available automatically or when installing the snap.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: gsocker on March 04, 2018, 08:01:12 pm
Just tested the HMO/RTB screenshot plugin with some other R&S/Hameg instruments.
HMC8043 power supply: works, autodetects correct plugin.
HMC8012 DMM: works, does not autodetect plugin as IDN string returned starts with "HAMEG", not "Rohde & Schwarz", even though the branding is R&S otherwise. First part of returned string is "HAMEG,HMC8012".
HMO3054: works, same issue as HMC8012: IDN string contains HAMEG, not R&S.

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 04, 2018, 08:20:42 pm
Just tested the HMO/RTB screenshot plugin with some other R&S/Hameg instruments.
HMC8043 power supply: works, autodetects correct plugin.
HMC8012 DMM: works, does not autodetect plugin as IDN string returned starts with "HAMEG", not "Rohde & Schwarz", even though the branding is R&S otherwise. First part of returned string is "HAMEG,HMC8012".
HMO3054: works, same issue as HMC8012: IDN string contains HAMEG, not R&S.

Great, thanks for testing  :-+

I've fixed the plugin so it should detect your instruments correctly.

R&S bought Hameg right?

I don't expect we will see any new instruments from R&S with Hameg identifier?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: gsocker on March 04, 2018, 09:09:10 pm
Yes, R&S brought Hameg - back around 2005/6 I think. Mine were bought around the time they were switching things over to R&S branding - the HMO3054 is branded as "R&S/Hameg".

The PS and and DMM were bought later and have have R&S branding, which is why it's a bit weird that the DMM id string still returns "Hameg" instead of R&S. However, I doubt any future instruments will return "Hameg" as the manufacturer.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 04, 2018, 09:28:02 pm
Yes, R&S brought Hameg - back around 2005/6 I think. Mine were bought around the time they were switching things over to R&S branding - the HMO3054 is branded as "R&S/Hameg".

The PS and and DMM were bought later and have have R&S branding, which is why it's a bit weird that the DMM id string still returns "Hameg" instead of R&S. However, I doubt any future instruments will return "Hameg" as the manufacturer.

Ok.

I've updated the list of tested instruments and added you to our list of contributors as a thank you for testing.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: tautech on March 04, 2018, 09:34:58 pm
lundmar
I've been following this for some time and I'd like to offer my sincere thanks for your efforts in supporting a wide range of Siglent products.  :-+
AFAIK there'll be a couple more for you to check later on this year.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 04, 2018, 10:27:34 pm
lundmar
I've been following this for some time and I'd like to offer my sincere thanks for your efforts in supporting a wide range of Siglent products.  :-+
AFAIK there'll be a couple more for you to check later on this year.

tautech, thank you very much :)

Siglent has been very helpful making it possible for me to add full support for their LXI compatible instruments :-+

I'm very happy to see instrument manufacturers like Siglent put their support behind the open source lxi-tools project. In fact, I'm hoping more instrument manufacturers will do the same. The end goal is to make available free high quality open source instrument software tools which make it easy for users to manage their instruments remotely without having to concern themselves with costly proprietary software which may or may not bring much value.

I hope Siglent will continue to support the lxi-tools project and I'll be looking forward to add support for more of their instruments in the future.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: gsocker on March 04, 2018, 10:34:41 pm

Ok.

I've updated the list of tested instruments and added you to our list of contributors as a thank you for testing.

One note - the HMO 3054 is not discoverable via "lxi discover" and does not claim LXI support.
 It also doesn't support VXI-11; it is raw sockets only, defaulting to port 5025. Commands and the screenshots work fine.
The HMC8043/HMC8012 are discoverable if the -m option is used.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: tautech on March 04, 2018, 10:53:43 pm
lundmar
I've been following this for some time and I'd like to offer my sincere thanks for your efforts in supporting a wide range of Siglent products.  :-+
AFAIK there'll be a couple more for you to check later on this year.

tautech, thank you very much :)

Siglent has been very helpful making it possible for me to add full support for their LXI compatible instruments :-+

I'm very happy to see instrument manufacturers like Siglent put their support behind the open source lxi-tools project. In fact, I'm hoping more instrument manufacturers will do the same. The end goal is to make available free high quality open source instrument software tools which make it easy for users to manage their instruments remotely without having to concern themselves with costly proprietary software which may or may not bring much value.

I hope Siglent will continue to support the lxi-tools project and I'll be looking forward to add support for more of their instruments in the future.
I know some in Siglent are very aware of your great work and those I speak of are not Hamburg based which I guess is your point of contact. I think you can safely assume further support from Siglent when new products are rolled out.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 05, 2018, 05:03:54 pm

Ok.

I've updated the list of tested instruments and added you to our list of contributors as a thank you for testing.

One note - the HMO 3054 is not discoverable via "lxi discover" and does not claim LXI support.
 It also doesn't support VXI-11; it is raw sockets only, defaulting to port 5025. Commands and the screenshots work fine.
The HMC8043/HMC8012 are discoverable if the -m option is used.

Ok, I've removed the discover feature from the instrument list for HMO 3054.

Are you sure that VXI-11 scpi commands does not work with the HMO 3054?

If the HMO 3054 works with the screenshot plugin that implies that VXI-11 is working since all plugins use VXI-11 to retrieve screenshots at this point.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: gsocker on March 06, 2018, 01:26:24 am

Ok.

I've updated the list of tested instruments and added you to our list of contributors as a thank you for testing.

One note - the HMO 3054 is not discoverable via "lxi discover" and does not claim LXI support.
 It also doesn't support VXI-11; it is raw sockets only, defaulting to port 5025. Commands and the screenshots work fine.
The HMC8043/HMC8012 are discoverable if the -m option is used.

Ok, I've removed the discover feature from the instrument list for HMO 3054.

Are you sure that VXI-11 scpi commands does not work with the HMO 3054?

If the HMO 3054 works with the screenshot plugin that implies that VXI-11 is working since all plugins use VXI-11 to retrieve screenshots at this point.
Just checked - apparently it does. Using strace confirms lxi is connecting to port 1024 sucessfully. Interestingly, there is no mention of VXI-11 anywhere in the programming manual. It explicitly says to use raw sockets on port 5025. I guess the VXI-11 support is intended for VISA since the VISA address shown in the device info dialog uses ::INSTR.
Oh well, at least it works...
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 06, 2018, 07:02:07 am
Just checked - apparently it does. Using strace confirms lxi is connecting to port 1024 sucessfully. Interestingly, there is no mention of VXI-11 anywhere in the programming manual. It explicitly says to use raw sockets on port 5025. I guess the VXI-11 support is intended for VISA since the VISA address shown in the device info dialog uses ::INSTR.
Oh well, at least it works...

Great.

Well, I guess they don't think they need to advertise such features he he

FYI - here you can find a nice overview of ports that LXI compatible/certified instruments should support:
http://www.lxistandard.org/About/LXI-Protocols.aspx (http://www.lxistandard.org/About/LXI-Protocols.aspx)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 10, 2018, 10:45:55 pm
To be honest, I don't see the point of front panel emulators. If I want to use the instruments front panel, I dont need a computer.

What would be much more useful in my view would be some way of writing simple scripts so I can do something like this

For V = 0 to 3.3 step 0.1
Set the power supply output to V
Tell the meter to read the current I
Save V, I to file
End for

Surely such automation is the real use of LXI, not just having a remote front panel?

I've finally added the Lua scripting feature to support advanced instrument automation.

A "run" command is introduced which can be used to run Lua scripts like so:

Code: [Select]
$ lxi run test.lua
For example, writing a Lua script which prints out the instrument ID is as simple as:
Code: [Select]
device = connect("192.168.0.110")
id = scpi(device, "*IDN?")
print("Instrument ID = " .. id)
disconnect(device)

An example of a more advanced Lua script can be found here:
https://github.com/lxi-tools/lxi-tools/blob/master/test/test.lua (https://github.com/lxi-tools/lxi-tools/blob/master/test/test.lua)

Lua offers a clean cut language which allows for writing very concise automation scripts. It is also considered the fastest scripting language around which makes it excellent for automation.

Check it out, it's pretty cool. It's available in the snap edge channel.

For those not familiar with Lua, see this tutorial: https://www.tutorialspoint.com/lua/index.htm (https://www.tutorialspoint.com/lua/index.htm)

I'm pretty happy about how it works right now but I might change the Lua interface so that it becomes object oriented in the future.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on March 12, 2018, 06:30:25 pm
Excellent - is there some documentation?

but

snap refresh lxi-tools --edge
snap "lxi-tools" has no updates available

 :-//
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 12, 2018, 07:24:28 pm
Excellent - is there some documentation?

but

snap refresh lxi-tools --edge
snap "lxi-tools" has no updates available

 :-//

The snap system automatically updates your snaps when new updates are available. So your snap is likely up-to-date.

If you want to make sure you can see the list of latest lxi-tools snap versions here: https://dashboard.snapcraft.io/snaps/lxi-tools (https://dashboard.snapcraft.io/snaps/lxi-tools)

And compare it with the information retrieved from the "snap info lxi-tools" command.


Documentation is work in progress. I will try to soon expand with more documentation in the man page.

To run the script named myscript.lua, simply do e.g.:

Code: [Select]
$ lxi run myscript.lua

In the script file you add regular Lua script code which can use any of the available Lua script libraries for math, file I/O, etc.. See more here: https://www.tutorialspoint.com/lua/index.htm (https://www.tutorialspoint.com/lua/index.htm)

There is also a Lua quick guide here: https://www.tutorialspoint.com/lua/lua_quick_guide.htm (https://www.tutorialspoint.com/lua/lua_quick_guide.htm)

In addition, lxi-tools provides the following Lua functions for managing instruments:

Code: [Select]
-- Connect to instrument ip and return device handle
device = connect(ip)

-- Send SCPI command to device and return response if ? command
response = scpi(device, command)

-- Send SCPI command to device and return raw response if ? command
response = scpi_raw(device, command)

-- Sleep ms
msleep(milliseconds)

-- Sleep seconds
sleep(seconds)

-- Disconnect device
disconnect(device)

Most of the interfaces are demonstrated in https://github.com/lxi-tools/lxi-tools/blob/master/test/test.lua (https://github.com/lxi-tools/lxi-tools/blob/master/test/test.lua)

As you can see you simply connect to your instrument using the connect function which give you a device handle upon which the scpi function can operate. This allows to connect to multiple instruments in the same session.

In case of a question command, the scpi command returns a sanitized response string (removes newlines and carriage returns from the received response string).

Likewise, the scpi_raw command returns the original non sanitized response from the instrument, useful if receiving e.g. image or trace binary data.

Notice that the example script uses the Lua function tonumber() Lua to convert the received scientific notation number string (e.g. "+5.000E-2", notation returned by most instruments) to a float number.

Thats pretty much all there is to it. You simply connect to instruments, send scpi commands, and use Lua to do comparison, loops, data manipulation, wait delays, conditional delays, write stuff to disk, etc.. The possibilities are almost endless.

If you have any questions regarding how to do specific things in Lua feel free to ask here, I will try help best I can.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 13, 2018, 08:48:27 pm
Take a look here, Siglent wrote a post about LXI Tools :-+

https://www.siglentamerica.com/application-note/lxi-tools (https://www.siglentamerica.com/application-note/lxi-tools)

There is also a short video demonstrating how to use LXI Tools with Siglent instruments:

https://www.youtube.com/watch?v=c6IZMStyuo4 (https://www.youtube.com/watch?v=c6IZMStyuo4)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 15, 2018, 12:22:17 am
New releases available:

https://github.com/lxi-tools/lxi-tools/releases/tag/v1.19
https://github.com/lxi-tools/liblxi/releases/tag/v1.12

This release includes bug fixes and adds support for Lua scripting which is very useful for instrument automation.

It is ready to install via the snap stable channel:

Code: [Select]
$ snap install lxi-tools
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: Dwaine on March 15, 2018, 01:08:17 am
Nice work...  Using it now...
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 15, 2018, 06:37:18 pm
Nice work...  Using it now...

Thanks  :-+

For those who might start to play with the new lxi Lua scripting feature here are a few example scripts:

https://github.com/lxi-tools/lxi-tools/blob/master/test/test.lua
https://github.com/lxi-tools/lxi-tools/blob/master/test/basic-tests.lua

And of course, to run a script simply do e.g.:
Code: [Select]
$ lxi run basic-tests.lua
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 17, 2018, 11:29:58 am
I've found some interesting lxi-tools snap statistics:

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=404530;image)

More statistics are available here: https://dashboard.snapcraft.io/snaps/lxi-tools/stats (https://dashboard.snapcraft.io/snaps/lxi-tools/stats)

Of course, the statistics only include snap users and not those who use it via other package managers or manual install.

I think it is a solid start for this type of project, especially considering it is currently only available for *nix platforms.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: N0NB on March 18, 2018, 11:28:49 am
Arghh!

I'm getting tripped up by Lua in updating my SlackBuild script for lxi-tools 1.19.  The configure script halts as Lua5.2 is not found and the SlackBuilds.org site has version 5.1.5 available.  I presume this version is too old for various and sundry reasons?

I've never used Lua knowingly, but I found when writing a SlackBuild script for Hamlib (someone else contributed Swig Lua bindings).  The impression I got is that Lua seems to be rather incompatible between minor versions.  I hope I am wrong about that.

I suppose I can try installing Lua 5.1.5 and see if lxi-tools will build and run against it.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: N0NB on March 18, 2018, 12:29:11 pm
Well, I did get lxt-tools to compile with Lua 5.1.5.  No telling if it works or not!   :-//

I had to patch configure.ac as follows:

Code: [Select]
$ diff -u /tmp/SBo/lxi-tools-1.19/configure.ac ./configure.ac
--- /tmp/SBo/lxi-tools-1.19/configure.ac        2018-03-10 18:54:41.000000000 -0600
+++ ./configure.ac      2018-03-18 07:21:43.825850367 -0500
@@ -14,8 +14,8 @@
 AC_CHECK_LIB([readline], [readline], [], [AC_MSG_ERROR(libreadline not found)])
 AC_CHECK_LIB([lxi], [lxi_connect], [], [AC_MSG_ERROR(liblxi not found)])

-# Check for Lua 5.2
-PKG_CHECK_MODULES([lua], [lua5.2])
+# Check for Lua 5.1 or newer
+PKG_CHECK_MODULES([lua], [lua >= 5.1])

 # Handle bash completion
 AC_ARG_WITH([bash-completion-dir],

and run autoreconf --force -v --install to rebuild configure.

It built fine but with the following warnings:

Code: [Select]
  CC       libapp_a-lxilua.o
lxilua.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:63: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:64:5: note: expected ‘char *’ but argument is of type ‘const char *’
 int lxi_send(int device, char *message, int length, int timeout);
     ^
lxilua.c:92:18: warning: passing argument 1 of ‘question’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
     if (question(command))
                  ^
lxilua.c:42:12: note: expected ‘char *’ but argument is of type ‘const char *’
 extern int question(char *string);
            ^
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:64:5: note: expected ‘char *’ but argument is of type ‘const char *’
 int lxi_send(int device, char *message, int length, int timeout);
     ^
lxilua.c:141:18: warning: passing argument 1 of ‘question’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
     if (question(command))
                  ^
lxilua.c:42:12: note: expected ‘char *’ but argument is of type ‘const char *’
 extern int question(char *string);
            ^

I don't know if those warnings are simply due to the older version of Lua I'm compiling against or what.  As the compiler didn't error out, I'm inclined to think that Lua support will probably work.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 18, 2018, 02:04:53 pm
Well, I did get lxt-tools to compile with Lua 5.1.5.  No telling if it works or not!   :-//

I had to patch configure.ac as follows:

Code: [Select]
$ diff -u /tmp/SBo/lxi-tools-1.19/configure.ac ./configure.ac
--- /tmp/SBo/lxi-tools-1.19/configure.ac        2018-03-10 18:54:41.000000000 -0600
+++ ./configure.ac      2018-03-18 07:21:43.825850367 -0500
@@ -14,8 +14,8 @@
 AC_CHECK_LIB([readline], [readline], [], [AC_MSG_ERROR(libreadline not found)])
 AC_CHECK_LIB([lxi], [lxi_connect], [], [AC_MSG_ERROR(liblxi not found)])

-# Check for Lua 5.2
-PKG_CHECK_MODULES([lua], [lua5.2])
+# Check for Lua 5.1 or newer
+PKG_CHECK_MODULES([lua], [lua >= 5.1])

 # Handle bash completion
 AC_ARG_WITH([bash-completion-dir],

Perfectly fine patch  :-+

I simply had it fixed at Lua 5.2 but I assume it will work fine with all 5.x. If you feel like it I invite you to create a github pull request to push your change upstream. Or I can apply the patch on your behalf.

and run autoreconf --force -v --install to rebuild configure.

FYI - for convenience, same as running ./autogen.sh

It built fine but with the following warnings:

Code: [Select]
  CC       libapp_a-lxilua.o
lxilua.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:63: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:64:5: note: expected ‘char *’ but argument is of type ‘const char *’
 int lxi_send(int device, char *message, int length, int timeout);
     ^
lxilua.c:92:18: warning: passing argument 1 of ‘question’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
     if (question(command))
                  ^
lxilua.c:42:12: note: expected ‘char *’ but argument is of type ‘const char *’
 extern int question(char *string);
            ^
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:64:5: note: expected ‘char *’ but argument is of type ‘const char *’
 int lxi_send(int device, char *message, int length, int timeout);
     ^
lxilua.c:141:18: warning: passing argument 1 of ‘question’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
     if (question(command))
                  ^
lxilua.c:42:12: note: expected ‘char *’ but argument is of type ‘const char *’
 extern int question(char *string);
            ^

I don't know if those warnings are simply due to the older version of Lua I'm compiling against or what.  As the compiler didn't error out, I'm inclined to think that Lua support will probably work.

Those are warnings that are yet to be fixed. You can ignore them for now. To test you could start by running the basic Lua test script:

Code: [Select]
lxi run test/basic-tests.lua
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 18, 2018, 02:13:32 pm
Arghh!

I'm getting tripped up by Lua in updating my SlackBuild script for lxi-tools 1.19.  The configure script halts as Lua5.2 is not found and the SlackBuilds.org site has version 5.1.5 available.  I presume this version is too old for various and sundry reasons?

I've never used Lua knowingly, but I found when writing a SlackBuild script for Hamlib (someone else contributed Swig Lua bindings).  The impression I got is that Lua seems to be rather incompatible between minor versions.  I hope I am wrong about that.

I suppose I can try installing Lua 5.1.5 and see if lxi-tools will build and run against it.

There is an overview of Lua 5.x version changes here: https://www.lua.org/versions.html (https://www.lua.org/versions.html)

For now I think it will work to require minimum 5.1. Sure there are some nice features added in 5.2 and 5.3 but I think most can do without them. In case a script needs e.g. Lua 5.3 it can add a check and opt out in case it is not available.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: N0NB on March 18, 2018, 05:05:08 pm
Perfectly fine patch  :-+

I simply had it fixed at Lua 5.2 but I assume it will work fine with all 5.x. If you feel like it I invite you to create a github pull request to push your change upstream. Or I can apply the patch on your behalf.

Go ahead and apply it, Martin.

and run autoreconf --force -v --install to rebuild configure.

FYI - for convenience, same as running ./autogen.sh

As I'm working from your release tarballs, that script is not included, but it's no more complicated to simply call autoreconf from the SlackBuild script.   :)


Those are warnings that are yet to be fixed. You can ignore them for now. To test you could start by running the basic Lua test script:

Code: [Select]
lxi run test/basic-tests.lua

I see that is in the Git repository but not in the 1.19 release tarball.  It would be useful to include the test script in the 1.20 release tarball.   :-+

Edit:

The basic-test.lua script ran without error using Lua 5.1.5, so it will likely work just fine.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 18, 2018, 05:57:07 pm
Perfectly fine patch  :-+

I simply had it fixed at Lua 5.2 but I assume it will work fine with all 5.x. If you feel like it I invite you to create a github pull request to push your change upstream. Or I can apply the patch on your behalf.

Go ahead and apply it, Martin.

I tested the change on Ubuntu/Debian and unfortunately it fails so a bit more rework is required. Debian/Ubuntu supports parallel lua installations which introduces separate named pkgconfig lookup names, not "lua" but "lua5.2", "lua5.3" etc. basically invalidating any possibility for a single version check.

EDIT: Fixed in https://github.com/lxi-tools/lxi-tools/commit/beddd9316a3e0cc46ad9023013a31ae94b3c4f33

I see that is in the Git repository but not in the 1.19 release tarball.  It would be useful to include the test script in the 1.20 release tarball.   :-+

Oh, I've forgot to include them.

EDIT: Fixed

Edit:

The basic-test.lua script ran without error using Lua 5.1.5, so it will likely work just fine.

Great - lets assume it works.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: N0NB on March 20, 2018, 12:26:44 pm
An interesting issue I am seeing has to do with my main Slackware 14.2 desktop which is running the avahi daemon cannot discover the 'scope.  However, in a Slackware 14.2 VM where I have avahi installed for building lxi-tools, but not running, I can access the 'scope just fine.   :-//

I know that avahi is working as I am using it to play audio over to my MythTV box using PulseAudio.  Also the avahi browser utility shows a bunch of mDNS stuff from the network.

I have to admit that I am far from knowledgeable regarding mDNS and even less so in beginning to troubleshoot it.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 20, 2018, 04:18:49 pm
An interesting issue I am seeing has to do with my main Slackware 14.2 desktop which is running the avahi daemon cannot discover the 'scope.  However, in a Slackware 14.2 VM where I have avahi installed for building lxi-tools, but not running, I can access the 'scope just fine.   :-//

I know that avahi is working as I am using it to play audio over to my MythTV box using PulseAudio.  Also the avahi browser utility shows a bunch of mDNS stuff from the network.

I have to admit that I am far from knowledgeable regarding mDNS and even less so in beginning to troubleshoot it.

I assume your have built lxi-tools on each machine in which case you have to make sure that libavahi-core-dev libavahi-common-dev libavahi-client-dev or similar is installed so that the configure script enables the mDNS feature.

For some unknown reason I decided to make mDNS an optional feature. I think I will likely change it to a mandatory feature in the future.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: N0NB on March 20, 2018, 05:23:18 pm
I double checked and the configure script is properly finding the avahi headers and that liblxi and lxi are linked to the avahi libraries on both the desktop and the VM.  As both the desktop and VM have the same version of avahi and other libraries installed, the only difference is that the avahi daemon is running on the desktop and not running in the VM.

Here is the output from lxi discover on the desktop:

Code: [Select]
$ lxi discover
Searching for LXI devices - please wait...

Broadcasting on interface lo
Broadcasting on interface eth0

No devices found

Code: [Select]
$ lxi discover -m
Searching for LXI devices - please wait...

No services found


And the same as run in the VM:

Code: [Select]
$ lxi discover
Searching for LXI devices - please wait...

Broadcasting on interface lo
Broadcasting on interface eth0
  Found "Siglent Technologies,SDS1202X-E,SDS1EBBXXXXXXX,5.1.3.13" on address 192.168.X.X

Found 1 device

Code: [Select]
$ lxi discover -m
Searching for LXI devices - please wait...

Error: Failed to create client: Daemon not running
No services found


Obviously lxi does not find the avahi daemon in the VM but raises no such complaint on the desktop.

I am puzzled that even when the -m is not used, lxi cannot discover the 'scope.

I need to do some more studying of Wireshark to try and isolate any network traffic from lxi as my network interface is too busy to catch any lxi traffic just by watching it scroll by.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 20, 2018, 05:31:16 pm
Code: [Select]
$ lxi discover -m
Searching for LXI devices - please wait...

Error: Failed to create client: Daemon not running
No services found

Obviously lxi does not find the avahi daemon in the VM but raises no such complaint on the desktop.

Have you tried starting/restarting the avahi daemon manually before calling lxi?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: N0NB on March 20, 2018, 06:25:11 pm
False alarm.  It looks like a firewall rule is blocking the reply from the 'scope.   :palm:

I thought I had looked in the logs a few days ago but Slackware logs a bit differently than Debian.

As I use Shorewall, I added the following rule to allow the 'scope's traffic to pass through:

Code: [Select]
ACCEPT          net:192.168.X.0/24     $FW     udp     -       111

All is well now:

Code: [Select]
$ lxi discover
Searching for LXI devices - please wait...

Broadcasting on interface lo
Broadcasting on interface eth0
  Found "Siglent Technologies,SDS1202X-E,SDS1EBBXXXXXXX,5.1.3.13" on address 192.168.X.X

Found 1 device


The key for me figuring this out was working through the liblxi source and seeing that the network braodcast address is obtained and used for the polling.  The 'scope replies but since there is no tracking from a SYN packet, the response was blocked (at least that's how I understand it).  I found the firewall logging is placed in /var/log/messages and then found the firewall had blocked the 'scope's address.  On Slackware dmesg also includes this output.

Carry on!   :-+


Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on March 20, 2018, 07:19:46 pm
False alarm.  It looks like a firewall rule is blocking the reply from the 'scope.   :palm:

I thought I had looked in the logs a few days ago but Slackware logs a bit differently than Debian.

As I use Shorewall, I added the following rule to allow the 'scope's traffic to pass through:

Code: [Select]
ACCEPT          net:192.168.X.0/24     $FW     udp     -       111

All is well now:

Code: [Select]
$ lxi discover
Searching for LXI devices - please wait...

Broadcasting on interface lo
Broadcasting on interface eth0
  Found "Siglent Technologies,SDS1202X-E,SDS1EBBXXXXXXX,5.1.3.13" on address 192.168.X.X

Found 1 device


The key for me figuring this out was working through the liblxi source and seeing that the network braodcast address is obtained and used for the polling.  The 'scope replies but since there is no tracking from a SYN packet, the response was blocked (at least that's how I understand it).  I found the firewall logging is placed in /var/log/messages and then found the firewall had blocked the 'scope's address.  On Slackware dmesg also includes this output.

Carry on!   :-+

Ok. Different distributions different problems  ;D
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on May 05, 2018, 02:34:46 pm
Hi guys,

Just announcing new releases of lxi-tools and liblxi:

https://github.com/lxi-tools/lxi-tools/releases/tag/v1.20
https://github.com/lxi-tools/liblxi/releases/tag/v1.13

These releases mostly include various bug fixes. Perhaps the most noticeable fix is that now bash auto completion is working with the lxi snap command.

Also, for those new to lua, I've added https://github.com/lxi-tools/lxi-tools/blob/master/test/basic-tests.lua which details concisely how to do basic stuff in Lua. Using this as inspiration you can create some very clean cut and powerful instrument control scripts for whatever purpose you need.

Recently I've been busy with other stuff and haven't had much time to continue the development on lxi-tools. However, during my absence I see that there have been a steady increase in snap users which is great.

Also, rumors are that there is someone out there who have ported lxi-tools to macOS!  :-+

Hopefully they will contribute their changes back to the lxi-tools project to benefit everyone. Code contributions are welcome.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: crispus on June 11, 2018, 07:39:00 am
Take a look here, Siglent wrote a post about LXI Tools :-+
Congrats! Keep up the good work :)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on June 11, 2018, 01:24:34 pm
Take a look here, Siglent wrote a post about LXI Tools :-+
Congrats! Keep up the good work :)

Thanks :)

The next thing on the TODO list is improving the mDNS feature. I expect to add a new discover interface to liblxi which will make it possible for the lxi command line tool to select which network interface is broadcasted on. For example:

Code: [Select]
$ lxi discover --interface wlan0

This way we can avoid broadcasting on all networks available. It will also speed up the discovery step.

The mDNS feature in lxi-gui also needs some TLC.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: crispus on June 26, 2018, 10:58:32 am
Did anyone tried to use measure item function on a DS1000z?
Code: [Select]
:MEASure:ITEM OVERshoot,CHANnel2 /* Enable the overshoot measurement of CH2 */
:MEASure:ITEM? OVERshoot,CHANnel2 /* The query returns 8.888889e-03 */
I was trying to measure VPP on channel 1, but all it does is to show on the scope's screen the measurement...
The query does not return anything...
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on June 30, 2018, 08:09:14 am
Did anyone tried to use measure item function on a DS1000z?
Code: [Select]
:MEASure:ITEM OVERshoot,CHANnel2 /* Enable the overshoot measurement of CH2 */
:MEASure:ITEM? OVERshoot,CHANnel2 /* The query returns 8.888889e-03 */
I was trying to measure VPP on channel 1, but all it does is to show on the scope's screen the measurement...
The query does not return anything...

I tried firing your commands and I get this:

Code: [Select]
$ lxi scpi --address 192.168.1.112 ":MEASure:ITEM OVERshoot,CHANnel2"
$ lxi scpi --address 192.168.1.112 ":MEASure:ITEM? OVERshoot,CHANnel2"
9.9E37
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: crispus on July 01, 2018, 09:26:34 am
Thanks for reply.

As standalone commands it works. I was trying in interactive mode and it doesn't. (build from sources, v1.20)
Code: [Select]
$ src/lxi --version
lxi v1.20
$ src/lxi scpi -a 192.168.1.149 -i
Connected to 192.168.1.149
Entering interactive mode (ctrl-d to quit)

lxi> *IDN?
RIGOL TECHNOLOGIES,MSO1104Z,DS1ZDxxxxxxxx,00.04.04.SP3
lxi> :MEASure:ITEM? OVERshoot,CHANnel2
lxi>

$ src/lxi scpi -a 192.168.1.149 ":MEASure:ITEM? OVERshoot,CHANnel2"
2.306453e-02
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on July 01, 2018, 11:53:16 am
Thanks for reply.

As standalone commands it works. I was trying in interactive mode and it doesn't. (build from sources, v1.20)
Code: [Select]
$ src/lxi --version
lxi v1.20
$ src/lxi scpi -a 192.168.1.149 -i
Connected to 192.168.1.149
Entering interactive mode (ctrl-d to quit)

lxi> *IDN?
RIGOL TECHNOLOGIES,MSO1104Z,DS1ZDxxxxxxxx,00.04.04.SP3
lxi> :MEASure:ITEM? OVERshoot,CHANnel2
lxi>

$ src/lxi scpi -a 192.168.1.149 ":MEASure:ITEM? OVERshoot,CHANnel2"
2.306453e-02

Thanks for reporting the bug. Luckily it was a simple fix:
https://github.com/lxi-tools/lxi-tools/commit/c244dbe573d191f8bd2513f0f61638209bc528dc

I haven't tested it but it should do the trick  :)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: crispus on July 01, 2018, 12:17:50 pm
So quick. It works. Thanks.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on July 08, 2018, 09:43:56 am
FYI - I've just pushed a new release of lxi-tools:

https://github.com/lxi-tools/lxi-tools/releases/tag/v1.21

It basically only includes the latest change to fix interactive mode when firing question SCPI commands. The main reason I'm pushing a new stable release is to update the lxi-tools snap on the stable release channel because some users have reported issues with missing fonts - an issue which is automagically fixed by an update because of some updated snapcraft infrastructure.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: HoracioDos on July 10, 2018, 12:57:21 pm
automagically
This has been my preferred word  for years  :-DD. I see that's universal. Why everyone loves automagic solutions?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on July 10, 2018, 02:53:12 pm
automagically
This has been my preferred word  for years  :-DD. I see that's universal. Why everyone loves automagic solutions?

Easy, everyone loves magic :clap:
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on August 17, 2018, 07:50:54 am
Here is a shout out and big thank you to Siglent for supporting the open source lxi-tools project!  :-+

They have recently decided that we can keep the SDS1204X-E which was lent to us to support the ongoing development of lxi-tools. See https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/msg1394796/#msg1394796 (https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/msg1394796/#msg1394796)

The device has been very helpful for the development and testing of lxi-tools. It will now become a permanent part of a regression test setup to make sure lxi-tools will continue to work with Siglent devices.

Personally I'm happy to finally see instrument manufacturers be serious about supporting open source - this way we will all get better tools for our instruments. It is also worth noticing that Siglent is very responsive to feedback from the EEVBlog forum users and I'm sure that has helped make their instruments better and more desirable. I wish more manufacturers would do the same. It's the new way of doing business. Good job Siglent  :-+

https://www.siglentamerica.com/application-note/lxi-tools/ (https://www.siglentamerica.com/application-note/lxi-tools/)
https://www.siglentamerica.com/video/lxi-tools/ (https://www.siglentamerica.com/video/lxi-tools/)

List of lxi-tools sponsors: https://github.com/lxi-tools/lxi-tools#9-sponsors (https://github.com/lxi-tools/lxi-tools#9-sponsors)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on August 17, 2018, 10:21:32 am
Just some interesting statistics retrieved from the snap system:

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=499553;image)

This statistics only count snap installs, not lxi-tools installations installed via native distro packages.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: cnkz on September 12, 2018, 05:48:31 pm
I tried to compile the tools....

First the install steps description in the readmes are not correct, they say:
Code: [Select]
./configure; make; make install    But there are no configure scripts...

I think i need to use the autogen.sh scripts to generate the configure scripts but they do give errors:

a) for liblxi

Code: [Select]
./autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
configure.ac:22: error: possibly undefined macro: AC_ENABLE_SHARED
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:23: error: possibly undefined macro: AC_ENABLE_STATIC
autoreconf: /usr/bin/autoconf failed with exit status: 1

b) for lxitools
Code: [Select]
./autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:6: installing './ar-lib'
configure.ac:6: installing './compile'
configure.ac:4: installing './install-sh'
configure.ac:4: installing './missing'
src/Makefile.am:2: error: library used but 'RANLIB' is undefined
src/Makefile.am:2:   The usual way to define 'RANLIB' is to add 'AC_PROG_RANLIB'
src/Makefile.am:2:   to 'configure.ac' and run 'autoconf' again.
src/Makefile.am: installing './depcomp'
autoreconf: automake failed with exit status: 1

Any idea how to fix that?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on September 13, 2018, 08:13:01 am
I tried to compile the tools....

First the install steps description in the readmes are not correct, they say:
Code: [Select]
./configure; make; make install    But there are no configure scripts...

I think i need to use the autogen.sh scripts to generate the configure scripts but they do give errors:


It's because you pulled the git development code. What you want to do is download and use the release tarballs - only they include the configure script etc..

If you don't want to bother with autotools I recommend simply installing lxi-tools via snap to get latest version:

Code: [Select]
$ snap install lxi-tools

If you do insist on building from git source please see the top post in this thread where you will find a description of how to build from git source.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: cnkz on September 14, 2018, 08:25:15 pm
Thanks, i tried (first time) snap and it works.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on September 15, 2018, 09:19:33 am
Thanks, i tried (first time) snap and it works.

Great  :-+

Snap is pretty cool - it is working on the most popular gnu/linux platforms and it makes it very easy for me to push updates to end users.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: awallin on September 24, 2018, 07:27:04 pm
There's now a quick hack at python bindings for liblxi over here: https://github.com/lxi-tools/python-liblxi

if you are brave and want to test then:
- checkout that repo
- git submodule init&update
- autogen and configure in the liblxi-dir
- out of source cmake-build for the python module

I did not have time to test with real hardware yet - may or may not work...
do post issues and pull-requests on github if you find bugs or fix them!

thanks, Anders.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on April 13, 2019, 08:03:00 pm
For a while, the screenshot feature in the snap version of lxi-gui has been broken because of a bug revealed by an updated snap toolchain.

This issue has now been solved and an updated lxi-tools snap is available.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on May 01, 2019, 11:10:57 pm
Thanks dear lundmar!
I trying make console datalogger (https://github.com/shodanx/LXI-Instruments-DataLogger) based on your's liblxi, for my Raspberry Pi.
Low power consumption of Raspberry Pi - is very good for very long measurement's cycle. Now i can do measurement's without my PC.

Your's lib work fine via VXI-11.

I hope share first release on next week, now it testing and debugging stage.

Good stuff :-+

I'm glad liblxi seems to perform well for your data logger application. Using the rpi for a low cost data logger is an excellent idea.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: enz on May 07, 2019, 07:48:15 am
Today I cloned the lxi-tools git repository.
I tried to compile the lxi-gui under windows with QT-Creator.
But I got an error about a missing include file "lxi.h".
It is included from main.cpp and mainwindow.cpp.

I couldn't find it in the project directory tree.

Maybe it is missing in the project?

Best regards,
Martin
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on May 07, 2019, 08:27:45 pm
Today I cloned the lxi-tools git repository.
I tried to compile the lxi-gui under windows with QT-Creator.
But I got an error about a missing include file "lxi.h".
It is included from main.cpp and mainwindow.cpp.

I couldn't find it in the project directory tree.

Maybe it is missing in the project?

Best regards,
Martin

Hi enz,

The applications in lxi-tools depend on liblxi so you need to go install liblxi first which provides lxi.h.

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: enz on May 08, 2019, 11:19:59 am
Today I cloned the lxi-tools git repository.
I tried to compile the lxi-gui under windows with QT-Creator.
But I got an error about a missing include file "lxi.h".
It is included from main.cpp and mainwindow.cpp.

I couldn't find it in the project directory tree.

Maybe it is missing in the project?

Best regards,
Martin

Hi enz,

The applications in lxi-tools depend on liblxi so you need to go install liblxi first which provides lxi.h.

 :palm:
Of course, thanks for the hint.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on May 22, 2019, 08:22:59 pm
I hope share first release on next week, now it testing and debugging stage.

First release is published (https://github.com/shodanx/LXI-Instruments-DataLogger/releases).
I also add support of high precision TI TMP117 temperature sensor.

Now i have completed data logger solution with environment temperature measurement.

Cool - I'm curious, what kind of sampling rates are you getting using liblxi on the pi to query the temperatures from your instruments?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on October 07, 2020, 04:19:27 pm
Hi Lundmar

three things, if you are still there and listening:

(1) Discover and SCPI commands seem to work for Rigol RSA3000 series spectrum analyzers  :-+ but screen shot does not.

(2) If you have a 4K display, the GUI is too small to read comfortably - is there any chance of scaling it up for high dpi displays?

(3)  While lxi-tools reads output fine with from the RSA3000, if I simply telnet to its LXI port, the output is garbled: it seems I just get the first character repeated, rather than the expected string, so for example, if I do *IDN? the output is RRRRRRRRRRRRRRRRRRRRRRRR some large number of times rather than the correct string saying Rigol... whatever. Can you enlighten me as to what the issue is here? Is there anything I can do to make simple telnet output the correct strings instead?

Thanks.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: tv84 on October 07, 2020, 04:29:46 pm
(3)  While lxi-tools reads output fine with from the RSA3000, if I simply telnet to its LXI port, the output is garbled: it seems I just get the first character repeated, rather than the expected string, so for example, if I do *IDN? the output is RRRRRRRRRRRRRRRRRRRRRRRR some large number of times rather than the correct string saying Rigol... whatever. Can you enlighten me as to what the issue is here? Is there anything I can do to make simple telnet output the correct strings instead?

This must be a bug. Which renders the SCPI output useless... If you can't even do the standard *IDN?...  :palm:
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: ralphrmartin on October 07, 2020, 05:45:27 pm
But the interesting thing is that lxi-tools gets the correct output from the device, e.g. showing the correct identification presumably in response to an *IDN?

Rigol's own ultra sigma also gives the correct output too.

It's only a direct telnet connection that returns this garbled output (verified from a Mac (telnet), a PC (putty) and a Linux box (telnet) - all the same).

Input is clearly going into the device OK, e.g. I can send commands from telnet to turn things on and off and see the expected responses.

Other commands which generate output seem to do the same, sending strings with the correct first character which is then repeated. E.g. If I query the impedance, I get 55, not 50.

How can lxi-tools be getting the correct output, if telnet is not?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 26, 2021, 04:44:51 am
Hi Lundmar

three things, if you are still there and listening:

I'm back - I've been busy IRL and neglecting the lxi-tools project for a long time but now I'm back and some interesting changes are coming :)

Quote
(1) Discover and SCPI commands seem to work for Rigol RSA3000 series spectrum analyzers  :-+ but screen shot does not.

I'm sure we can figure that one out - just takes a little digging in the RSA 3000 programmers guide and an update to one of the existing rigol screenshot plugins or maybe a new one. Feel free to create a bug report / feature request in the github issue tracker: https://github.com/lxi-tools/lxi-tools/issues

Quote
(2) If you have a 4K display, the GUI is too small to read comfortably - is there any chance of scaling it up for high dpi displays?

Yes, hi-dpi scaling support is coming. One of the big changes coming is actually a total rewrite of the lxi-gui application. I've kicked out the old QT based lxi-gui application in favour of a much more modern looking GTK4 based application and that also implies hi-dpi support. You can take a peak at some screenshots of the new lxi-gui application here: https://github.com/lxi-tools/lxi-tools

Part of the move to the new lxi-gui is also to make it easy to install lxi-gui on Windows with the new WSL2/wayland feature.

Quote
(3)  While lxi-tools reads output fine with from the RSA3000, if I simply telnet to its LXI port, the output is garbled: it seems I just get the first character repeated, rather than the expected string, so for example, if I do *IDN? the output is RRRRRRRRRRRRRRRRRRRRRRRR some large number of times rather than the correct string saying Rigol... whatever. Can you enlighten me as to what the issue is here? Is there anything I can do to make simple telnet output the correct strings instead?

Yeah, that wont work. LXI compatible instruments uses either VXI11 or raw/TCP for communicating commands - you likely telnetted into the VXI11 port and so you get gobbledygook.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: RoGeorge on December 26, 2021, 10:14:15 am
Thank you for the new additions, I'm eager to try them (probably next year, my desktop install just died 2 days ago).
So far the new lxi/GUI looks good by the github pics!   :-+



As a feature request, will it be possible to have the LXI GUI as a native install in the repositories, too, same as the lxi-tools, please?

I mean, in the latest Ubuntu 20.04.3 LTS repositories, the lxi-tools can be installed with "sudo apt install lxi-tools", while the GUI can only be installed as a "snap" install.  Some users are trying to avoid snap install for various reasons, I don't like snaps mostly because snap installed programs, when launched, are starting visible slower than a native install.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 26, 2021, 01:54:23 pm
Thank you for the new additions, I'm eager to try them (probably next year, my desktop install just died 2 days ago).
So far the new lxi/GUI looks good by the github pics!   :-+

Thanks, I think it is looking pretty good. Writing it in GTK4 has been a nice experience - modern GUI toolkits have improved a lot. The application is really fast now because it renders in OpenGL/GLES/Vulkan and the modern toolkit has many cool subtle features never seen in any classic GUI.

Quote
As a feature request, will it be possible to have the LXI GUI as a native install in the repositories, too, same as the lxi-tools, please?

I mean, in the latest Ubuntu 20.04.3 LTS repositories, the lxi-tools can be installed with "sudo apt install lxi-tools", while the GUI can only be installed as a "snap" install.  Some users are trying to avoid snap install for various reasons, I don't like snaps mostly because snap installed programs, when launched, are starting visible slower than a native install.

Yes, once I make an official release the package maintainers will pick them up when they have time and eventually you will see lxi-tools as native packages in various distributions. Snap is just a way to distribute a release quickly but I am aware of the performance hit that snaps take but for this type of application it matters less.

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: N0NB on December 27, 2021, 07:24:21 pm
Going from Qt to GTK is definitely not a path well traveled that I've seen.  Regardless, good to see you're back to coding again.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on December 27, 2021, 09:49:53 pm
Going from Qt to GTK is definitely not a path well traveled that I've seen.  Regardless, good to see you're back to coding again.

I would normally agree, but GTK4 is changing things up and is becoming a very solid alternative to QT. Much improved API, performance, and debug features. Also, I feel GTK4 is doing stuff more intuitively, the Linux way.

Let me put it this way. I would never have considered porting anything to GTK3.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 04, 2022, 03:38:42 am
Hi guys,

Happy new year 2022!

If you feel brave you are welcome to try out the newly rewritten lxi-gui application via the snap edge channel:

Code: [Select]
$ snap install lxi-tools --edge
$ snap connect lxi-tools:avahi-control

It is work in progress and as long as it is on the snap edge channel it will be subject to changes and bugs. Try on your own risk.

Basic features are working and I am currently working on the script feature.

Here are a few updated screenshots to provide a quick look at the new GUI interface:

(https://raw.githubusercontent.com/lxi-tools/lxi-tools/master/images/lxi-gui-scpi.png)
(https://raw.githubusercontent.com/lxi-tools/lxi-tools/master/images/lxi-gui-screenshot.png)
(https://raw.githubusercontent.com/lxi-tools/lxi-tools/master/images/lxi-gui-benchmark.png)
(https://raw.githubusercontent.com/lxi-tools/lxi-tools/master/images/lxi-gui-script.png)
(https://raw.githubusercontent.com/lxi-tools/lxi-tools/master/images/lxi-gui-preferences.png)
(https://raw.githubusercontent.com/lxi-tools/lxi-tools/master/images/lxi-gui-about.png)

FYI: The old application is still available on the snap stable channel.

/Martin
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: N0NB on January 09, 2022, 01:57:54 am
Well, it finds my Siglent SDS1202X-E DSO but nothing else seems to work.  I tried the :VERSion? button followed by the Send button and get a "Error: Read error (timeout)" in the terminal from where I started lxi-gui (I've not restarted to allow the snap system to integrate with Gnome).

I am using Debian 11.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 09, 2022, 02:08:59 am
Well, it finds my Siglent SDS1202X-E DSO but nothing else seems to work.  I tried the :VERSion? button followed by the Send button and get a "Error: Read error (timeout)" in the terminal from where I started lxi-gui (I've not restarted to allow the snap system to integrate with Gnome).

That means you should be able to send "*IDN?" command to your instrument successfully using the SCPI interface.

Most of the SCPI 1999.0 commands must be used in some combination. Try send ":system:version?" like you see in the screenshots.

":version?" alone is not supported by the standards AFAIK.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 09, 2022, 04:31:59 am
The new lxi-gui scripting feature is coming along nicely:

(https://raw.githubusercontent.com/lxi-tools/lxi-tools/master/images/lxi-gui-script.png)

The new scripting feature is going to become very powerful for such a simple tool. It will be great for quickly managing many network attached instruments and do all sorts of data processing and presentation.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: RoGeorge on January 10, 2022, 05:49:58 pm
Happy New Year to you, too!   :D




I was ready to kindly ask for a new feature request:  Python support, only to discover today you already have this on github, wow!   :-+

Thank you very much for the new python module "lxi.py":  https://github.com/lxi-tools/python-liblxi

Since I didn't repair my damaged Ubuntu install yet, I'm still running on a FreeBSD pendrive, so I thought I'll test if lxi-tools can work in FreeBSD, too.  So far, good news:

- liblxi is already in the official binary repository of "FreeBSD 13.0-RELEASE-p4".  In FreeBSD, lxitools can now be installed online with:
Quote
pkg install liblxi

- and it's WORKING in FreeBSD  :-+, tested it from Python, with "import lxi", and it could "*IDN?" my Rigol DS1054z.  Python support is a great feature, thank you!




(also made a pull request to python-liblxi, my first pull-request ever, so please don't whack me if I did something stupid there  ;D)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: N0NB on January 10, 2022, 06:43:28 pm

That means you should be able to send "*IDN?" command to your instrument successfully using the SCPI interface.

Most of the SCPI 1999.0 commands must be used in some combination. Try send ":system:version?" like you see in the screenshots.

":version?" alone is not supported by the standards AFAIK.

I am not familiar at all with the SCPI commands, etc.  However, there does seem to be a bit working now as shown by this screenshot:

[attachimg=1]

I was also able to capture this shot from the 'scope via the program:

[attachimg=2]

Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: tautech on January 10, 2022, 08:14:31 pm
I am not familiar at all with the SCPI commands, etc.  However, there does seem to be a bit working now as shown by this screenshot:
Yes I struggle with this stuff a bit too however we have someone here to thank for your SDS1202X-E definition to use with lundmar's cool program.
Here's the latest programming manual for your scope: 
https://int.siglent.com/u_file/document/SDS1000%20Series&SDS2000X&SDS2000X-E_ProgrammingGuide_PG01-E02D.pdf

However it does include commands for all the other Siglent models but also tables of command compatibility and responses.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 10, 2022, 09:04:47 pm
I was ready to kindly ask for a new feature request:  Python support, only to discover today you already have this on github, wow!   :-+

Thank you very much for the new python module "lxi.py":  https://github.com/lxi-tools/python-liblxi

Ha ha - yes, I forced myself to sit down and write the python bindings on request from a good engineer friend of mine to make it usable in his work environment. It is no secret that I am no fan of python (slow, horrible syntax) but it is what some people want, so here it finally is! :)

All I'm missing is to implement the discover feature for the bindings - I will eventually add that binding unless contributors beat me to it ;)

Quote
- and it's WORKING in FreeBSD  :-+, tested it from Python, with "import lxi", and it could "*IDN?" my Rigol DS1054z.  Python support is a great feature, thank you!

You're welcome. Now that liblxi is available on most platforms, the python bindings should work on most systems.

Quote
(also made a pull request to python-liblxi, my first pull-request ever, so please don't whack me if I did something stupid there  ;D)

Yes, I see it. Already merged. Thank you!

Perfect first github PR - keep em coming ;) 
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 10, 2022, 09:18:58 pm
I am not familiar at all with the SCPI commands, etc.  However, there does seem to be a bit working now as shown by this screenshot:

Good :-+

Quote
I was also able to capture this shot from the 'scope via the program:

Great, I just fixed the screenshot feature for people using the snap. It works fine on my local system but when built in the older snap environment it failed because some GTK image loaders failed to load. With the help of werwaswarum from Github, who reported the issue, we got it sorted out.

Now, we just need more testers and more equipment so we can broaden the lxi-tools instrument support.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: N0NB on January 12, 2022, 02:17:54 pm
A bit off-topic, but as I am using the Snap (only app so far) does it update automatically or is there a command I need to issue to pull an update?
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 12, 2022, 03:03:03 pm
A bit off-topic, but as I am using the Snap (only app so far) does it update automatically or is there a command I need to issue to pull an update?

It updates automatically but you can force an update using the following command:

Code: [Select]
$ snap refresh

If you want to know which version you have installed you can do:

Code: [Select]
$ snap info lxi-tools
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 12, 2022, 06:24:15 pm
I just got approval of auto-connection of avahi-control for the lxi-tools snap. This means that if you want to try out the development version of lxi-tools you can now install it with a single command like so:

Code: [Select]
$ snap install lxi-tools --edge

No more need for the "snap connect ..." command.

The new lxi-gui is in good shape. I'm currently working on refining the script feature before the upcoming v2.0 release.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 16, 2022, 06:13:58 pm
I've just added a new feature to lxi-gui which allows scripts to sample data from instruments and plot it in a nice graphical chart. The chart is updated live as the data comes in.

This feature is leaps better than the old rigid lxi-gui "Data Recorder" feature that was inflexible and didn't really work well. This new way of scripting a data logger / recorder is the right way to do it. It's a little more complex because it is scripted but I think the way I've made the interface with lua makes it really simple! I think most people with little to no scripting experience will still understand.

Here are a couple of examples of the new feature in action:

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=1382101;image)

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=1382105;image)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: N0NB on January 16, 2022, 06:34:26 pm
Looks good.

I think you're said the script language is Python, but what I see doesn't look like the Python I know.  I was guessing it to be LUA which seems to be popular for embedded scripting these days.

Please correct me and explain the syntax.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 16, 2022, 07:33:18 pm
Looks good.

I think you're said the script language is Python, but what I see doesn't look like the Python I know.  I was guessing it to be LUA which seems to be popular for embedded scripting these days.

Please correct me and explain the syntax.

Correct, it is Lua.

If you are not familiar with Lua you can a find this quick guide https://github.com/lxi-tools/lxi-tools/blob/master/test/basics.lua (https://github.com/lxi-tools/lxi-tools/blob/master/test/basics.lua) which explains the basic primitives - it's very easy and elegant and offers very fast execution. The new lxi-gui script functions such as clock_new(), chart_new(), connect() etc. will be documented before the upcoming v2.0 release. For now, more examples can be found here: https://github.com/lxi-tools/lxi-tools/tree/master/test (https://github.com/lxi-tools/lxi-tools/tree/master/test)

There really is no limit to what kind of GUI elements we can attach to the scripting language to aid what we want to do with our instruments. At first I expect more chart types to be added.
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 16, 2022, 10:57:01 pm
Please correct me and explain the syntax.

FYI - the lxi-tools specific lua API is now documented here: https://github.com/lxi-tools/lxi-tools/blob/master/doc/lua-api.txt
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 25, 2022, 08:28:12 pm
I've implemented a few different chart types - should be good for representing various data types.

So now you can retrieve data from your instrument and represent it live in e.g. a linear gauge for quick monitoring.

If anyone can think of other useful chart types to add for your instrument feel free to come with suggestions.

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=1391957;image)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on January 27, 2022, 06:10:41 pm
So, I have finally arrived at the point where I have implemented the required features to produce the perfect example on how to use the lxi-gui script feature as I envision it.

The following screenshot shows how one can easily create a script that retrieves voltage samples from a DC power supply for 100 seconds while drawing a live chart of the incoming data and finally save the sampled data to CSV and PNG files!

I do not believe it can be done much simpler than this! It is a very clean cut environment that even novice script writers can use. However, it also allows for experienced programmers to make some pretty cool and complex scripts to fit their needs.

(https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/?action=dlattach;attach=1393397;image)
Title: Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
Post by: lundmar on February 02, 2022, 12:38:20 am
Now that lxi-tools v2.0 is released I think it is time to retire this v1.0 thread.

I suggest moving to https://www.eevblog.com/forum/testgear/open-source-lxi-tools-v2-0-released/ (https://www.eevblog.com/forum/testgear/open-source-lxi-tools-v2-0-released/) for future lxi-tools discussions.

Thanks!
Title: Re: Open source lxi-tools v2.0 released - soon in all major *nix repositories!!!
Post by: RoGeorge on February 02, 2022, 08:39:07 am
The drawback is that everybody who posted here, won't stay updated with the new thread unless they write something there, in the new thread, a drawback of SMF Forums platform, there is no "subscribe to thread" button.

Just FYI, alternatives to making a new thread by changing the title, could be:
- any OP title can be edited by the OP, either to change it only in the OP message, or to make it change along all the existing replies, along the whole thread.
- at any reply, anybody replying can change the "Subject:" textbox during a reply, for example I've made this post to say v2.0, to bamboozle everyone.

Thank you for lxi 2.0, see you there!  :-+
Title: Re: Open source lxi-tools v2.0 released - soon in all major *nix repositories!!!
Post by: lundmar on February 05, 2022, 06:43:43 pm
The drawback is that everybody who posted here, won't stay updated with the new thread unless they write something there, in the new thread, a drawback of SMF Forums platform, there is no "subscribe to thread" button.

Just FYI, alternatives to making a new thread by changing the title, could be:
- any OP title can be edited by the OP, either to change it only in the OP message, or to make it change along all the existing replies, along the whole thread.
- at any reply, anybody replying can change the "Subject:" textbox during a reply, for example I've made this post to say v2.0, to bamboozle everyone.

Thank you for lxi 2.0, see you there!  :-+

Right, oh well. We'll do that next time. I'm fine with letting this one RIP.

Moving to https://www.eevblog.com/forum/testgear/open-source-lxi-tools-v2-0-released/ (https://www.eevblog.com/forum/testgear/open-source-lxi-tools-v2-0-released/)