Is there anyone with Lua experience around? - Page 1
Forum section: electronics / general

author: rhb
author_rank: Super Contributor
timestamp: November 25, 2018, 03:42:47 pm
content: The GW Instek GDS-2000E line uses Lua to implement DSO apps. Many (most?) of them don't work. I'd like to fix those and make it possible to write our own apps in Lua.At present GW does not allow user access to a terminal session, however, I have been making good progress at gaining full control of the FW. I'll provide more details once I have multiple ways to modify the FW so that if GW decides to cut off access, we will still be able to get in and be able to fix bugs.Eventually I want to replace all the FW with a FOSS DSO FW package for Zynq and Cyclone V based DSOs. But that will take 2-3 years to complete unless I get lucky. And I don't feel that lucky.

author: ebastler
author_rank: Super Contributor
timestamp: November 25, 2018, 05:09:50 pm
content: Quote from: rhb on November 25, 2018, 03:42:47 pmI have used LUA on the ESP8266. Most of it did not work (robustly) either -- it seemed like the interpreter had memory leaks or some other flaws that caused programs to get stuck over time.More likely than not, GW Instek uses a totally different implementation. But the ESP8266 experience has spoiled LUA for me; I'm strongly inclined to stay away from it. Just personal bias, I'm afraid...

author: nctnico
author_rank: Super Contributor
timestamp: November 25, 2018, 05:14:17 pm
content: Probably there are some problems with the ESP8266 which likely uses the embedded version. I don't know of any problems with the full blown version of Lua. Every now and then I use Lua myself and I also know about products which are installed in large quantities which rely on Lua.

author: nctnico
author_rank: Super Contributor
timestamp: November 25, 2018, 05:22:31 pm
content: Addition: my recommendation is to install Lua on a PC and test a Lua script on it before uploading it to the oscilloscope. It is possible to include other Lua scripts so you can create a 'main' Lua script which has the functions which are made available by the oscilloscope firmware and include the script which should run in the oscilloscope.

author: legacy
author_rank: Super Contributor
timestamp: November 25, 2018, 05:45:14 pm
content: You might also consider ucPython.It's installed inmy pocket calculator(Numworks) and does a great jobSource available on GIT!

author: nctnico
author_rank: Super Contributor
timestamp: November 25, 2018, 07:03:00 pm
content: This is for use on an GW Instek oscilloscope which (probably) allows / uses Lua to implement some of the functionality.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 26, 2018, 06:00:27 pm
content: I've been using Lua lately, so if you can send/post some of the Lua scripts, I'll probably be able to help.One thing you have to consider though is that Lua is both extensible through pure Lua scripts (modules) and modules written in C.All the access to the hardware and GUI are most likely relying on C modules. If you don't have access to the source code of these, you won't be able to do much if the bugs are in them. Which is not unlikely at all. If you have access to the whole source code (C included), then we'd probably be able to do something.

author: rhb
author_rank: Super Contributor
timestamp: November 27, 2018, 02:12:09 am
content: Don't have access to anything other than compiled Lua apps most of which don't work. Not as in buggy, but as in won't do *anything*. Case in point, the digital filter app. All the buttons are greyed out except for the on/off button which is stuck on off.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 27, 2018, 04:17:28 pm
content: Do you mean compiled Lua as in bytecode-compiled with luac? So you have no C source code nor Lua source code actually.The only thing you could try is decompiling the Lua bytecode (if it's really bytecode you have access to) with a Lua decompiler such as this:https://github.com/viruscamp/luadecAbsolutely no guarantee you will get anything really understandable though.You would also have to know what Lua version was used as many things have evolved over the years with Lua.

author: rhb
author_rank: Super Contributor
timestamp: November 27, 2018, 10:15:28 pm
content: Quote from: SiliconWizard on November 27, 2018, 04:17:28 pmSo far as I know that is correct.QuoteAbout the only thing I have going for me is many years of working on uncommented source which meant I had to rely entirely on my knowledge of what the code was purported to do.The Lua apps are pretty trivial. These are broken DSO functions I want to either fix or rewrite from scratch.