[Lua] Qestions on Debugging Mixer Scripts & Req for info on Compiled Scripts

openTx has introduced a range of new features, ideas and bling. It is fast becoming the firmware of choice for many users. openTx will run on ALL current hardware platforms, including the gruvin9x and sky9x boards. Work has already started to support the new FrSky X9D radio!
Post Reply
Spainman
Posts: 34
Joined: Thu Jun 19, 2014 8:47 pm
Country: -

[Lua] Qestions on Debugging Mixer Scripts & Req for info on Compiled Scripts

Post by Spainman »

I started playing around with lua scripting yesterday. I did some tests with one time and function scripts. 'Strategy' was to use the simulator along with the Debug Output window and print statements to see what's going on - works great.

- Right now I'm playing with mix scripts and print generates no output although I see that the run function executes fine (calculations are reflected in the outputs just as expected). Why doesn't print work here? What's the right way to 'debug' stuff in a mix script?

- Compiled scripts? I've seen some chatter on github about this and that regarding compiled scripts. I would appreciate a bit information on this. From what I've read compiling the scripts is advantageous resource-wise. I have some experience with lua (Wirshark Dissectors) but have never come across compiling lua scripts.
  • How is it done?
    What tools do I need?
    What is actually improved, is just the interpretation step bypassed and a kind of byte-code emitted or is the result actual native code?
    Does the compilation do optimisations?
A pointer where to get information about this in general and some info on the OpenTx specifics on this topic would be much appreciated.

Spainman
Posts: 34
Joined: Thu Jun 19, 2014 8:47 pm
Country: -

Re: [Lua] Qestions on Debugging Mixer Scripts & Req for info on Compiled Scripts

Post by Spainman »

Nevermind regarding the questions on printing to the debug console in mix scripts. I don't know what was wrong, but function scripts also stopped printing to the console and after restarting companion the output just works fine regardless of the script flavour.

I'm still eager to hear about compiled scripts...
User avatar
dinamich
Posts: 288
Joined: Mon Apr 01, 2013 1:21 pm
Country: Slovenia
Location: Ljubljana

Re: [Lua] Qestions on Debugging Mixer Scripts & Req for info on Compiled Scripts

Post by dinamich »

projectkk2glider@github

Post Reply

Return to “openTx”