Poll

What OS platform would you like to see lxi-tools ported to next?

Windows
macOS
Other
Don't port it - Linux is the future for all!

Author Topic: Open source lxi-tools and liblxi v1.0 released for GNU/Linux  (Read 89583 times)

0 Members and 2 Guests are viewing this topic.

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #125 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
« Last Edit: December 20, 2017, 06:19:15 pm by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 
The following users thanked this post: dpenev

Offline ralphrmartin

  • Frequent Contributor
  • **
  • Posts: 479
  • Country: gb
    • Me
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #126 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.
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #127 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).
« Last Edit: December 25, 2017, 04:41:00 am by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline ralphrmartin

  • Frequent Contributor
  • **
  • Posts: 479
  • Country: gb
    • Me
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #128 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?
« Last Edit: December 25, 2017, 06:38:50 pm by ralphrmartin »
 

Offline ralphrmartin

  • Frequent Contributor
  • **
  • Posts: 479
  • Country: gb
    • Me
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #129 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
 

Offline crispus

  • Regular Contributor
  • *
  • Posts: 131
  • Country: ro
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #130 on: December 25, 2017, 06:57:56 pm »
Do you have /var or /tmp as symbolic link?
I know I'm numskull, but I look around me and I feel better.
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #131 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 :)
« Last Edit: December 26, 2017, 01:39:32 pm by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #132 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.
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline ralphrmartin

  • Frequent Contributor
  • **
  • Posts: 479
  • Country: gb
    • Me
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #133 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...
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #134 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.
« Last Edit: December 28, 2017, 11:31:55 am by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline ralphrmartin

  • Frequent Contributor
  • **
  • Posts: 479
  • Country: gb
    • Me
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #135 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.
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #136 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.
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline ralphrmartin

  • Frequent Contributor
  • **
  • Posts: 479
  • Country: gb
    • Me
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #137 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.
 

Offline ralphrmartin

  • Frequent Contributor
  • **
  • Posts: 479
  • Country: gb
    • Me
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #138 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.
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #139 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).
« Last Edit: December 28, 2017, 11:17:56 am by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #140 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?
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline ralphrmartin

  • Frequent Contributor
  • **
  • Posts: 479
  • Country: gb
    • Me
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #141 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).
 

Offline ralphrmartin

  • Frequent Contributor
  • **
  • Posts: 479
  • Country: gb
    • Me
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #142 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...
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #143 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 :)
« Last Edit: December 28, 2017, 11:39:39 am by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #144 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.
« Last Edit: December 28, 2017, 11:37:11 am by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline ralphrmartin

  • Frequent Contributor
  • **
  • Posts: 479
  • Country: gb
    • Me
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #145 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. :-//
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #146 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.
« Last Edit: December 28, 2017, 04:53:11 pm by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline ralphrmartin

  • Frequent Contributor
  • **
  • Posts: 479
  • Country: gb
    • Me
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #147 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).
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #148 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.
« Last Edit: December 28, 2017, 05:20:00 pm by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline ralphrmartin

  • Frequent Contributor
  • **
  • Posts: 479
  • Country: gb
    • Me
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #149 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!  :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf