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 89546 times)

0 Members and 2 Guests are viewing this topic.

Offline awallin

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

Offline N0NB

  • Contributor
  • Posts: 48
  • Country: us
  • Amateur radio op; electronics dabbler
    • N0NB.us
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #226 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.
- Nate

The optimist proclaims we live in the best of all possible worlds.  The pessimist fears this is true.
 
The following users thanked this post: lundmar

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #227 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.
« Last Edit: February 17, 2018, 08:35:47 pm by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline awallin

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

Thanks for this explanation. I found this vxi-11 implementation on arduino due:
https://www.bankras.org/projects/electronics/instrument-of-things/
and that code is now here: 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
 

Offline lundmarTopic starter

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

Thanks for this explanation. I found this vxi-11 implementation on arduino due:
https://www.bankras.org/projects/electronics/instrument-of-things/
and that code is now here: 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.
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: 00
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #230 on: February 18, 2018, 02:13:57 pm »
Though, it's a shame it is GPLv3.

???:palm:
 

Offline lundmarTopic starter

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

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: 00
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #232 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.
 

Offline lundmarTopic starter

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

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: 00
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #234 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?
 

Offline lundmarTopic starter

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

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: 00
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #236 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"
 

Offline lundmarTopic starter

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

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: 00
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #238 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:


 

Offline dpenev

  • Regular Contributor
  • *
  • Posts: 183
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #239 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 :)
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: 00
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #240 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.
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #241 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.
« Last Edit: February 18, 2018, 11:16:06 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: Gabri74, bicycleguy

Offline lundmarTopic starter

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





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 :)
« Last Edit: February 19, 2018, 11:59:52 pm by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Online Hydron

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

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #244 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.
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 #245 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?
 

Offline lundmarTopic starter

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

« Last Edit: February 20, 2018, 09:35:07 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 #247 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.
« Last Edit: February 23, 2018, 03:50:46 pm by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline gsocker

  • Contributor
  • Posts: 23
  • Country: us
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #248 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.

« Last Edit: March 04, 2018, 08:05:19 pm by gsocker »
 

Offline lundmarTopic starter

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


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf