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

0 Members and 1 Guest are viewing this topic.

Offline gsocker

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

Offline lundmarTopic starter

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

Online tautech

  • Super Contributor
  • ***
  • Posts: 28138
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #252 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.
Avid Rabid Hobbyist
Siglent Youtube channel: https://www.youtube.com/@SiglentVideo/videos
 

Offline lundmarTopic starter

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

Offline gsocker

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

Online tautech

  • Super Contributor
  • ***
  • Posts: 28138
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #255 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.
Avid Rabid Hobbyist
Siglent Youtube channel: https://www.youtube.com/@SiglentVideo/videos
 

Offline lundmarTopic starter

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

Offline lundmarTopic starter

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

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

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.
« Last Edit: March 17, 2018, 10:46:49 am 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: ralphrmartin

Offline ralphrmartin

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

 :-//
« Last Edit: March 12, 2018, 06:34:09 pm by ralphrmartin »
 

Offline lundmarTopic starter

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

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

There is also a Lua quick guide here: 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

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.
« Last Edit: March 17, 2018, 10:46:05 am 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: ralphrmartin

Offline lundmarTopic starter

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

There is also a short video demonstrating how to use LXI Tools with Siglent instruments:

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 #263 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
« Last Edit: March 15, 2018, 12:26:51 am by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 299
  • Country: ca
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #264 on: March 15, 2018, 01:08:17 am »
Nice work...  Using it now...
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #265 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
« Last Edit: March 17, 2018, 10:45:36 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 #266 on: March 17, 2018, 11:29:58 am »
I've found some interesting lxi-tools snap statistics:



More statistics are available here: 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.
« Last Edit: March 17, 2018, 01:04:48 pm by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

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 #267 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.
- Nate

The optimist proclaims we live in the best of all possible worlds.  The pessimist fears this is true.
 

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 #268 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.
- Nate

The optimist proclaims we live in the best of all possible worlds.  The pessimist fears this is true.
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: Open source lxi-tools and liblxi v1.0 released for GNU/Linux
« Reply #269 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
« Last Edit: March 18, 2018, 02:06:52 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: N0NB

Offline lundmarTopic starter

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

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.
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

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 #271 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.
« Last Edit: March 18, 2018, 05:14:15 pm by N0NB »
- Nate

The optimist proclaims we live in the best of all possible worlds.  The pessimist fears this is true.
 

Offline lundmarTopic starter

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

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 #273 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.
- Nate

The optimist proclaims we live in the best of all possible worlds.  The pessimist fears this is true.
 

Offline lundmarTopic starter

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