LUA and openTx

General Help and support for the Taranis Radio.
Post Reply
Raythegreat
Posts: 284
Joined: Sat Apr 16, 2016 11:33 pm
Country: -

LUA and openTx

Post by Raythegreat »

Hi,

I'm building a motor thrust meter setup and would like to automate the entire process using my Taranis X9D+ (openTx), an Rx+ ESC + Lipo and LUA scripts.
Can anyone can help me about about how to control the throttle using LUA?
I studied the LUA manual and could not find a clear solution.

Of course, this setup is not going into any aircraft, it will be a fixed grounded setup, so no security danger other than putting my fingers into the propeller. :)

Thank you,
Ray

Raythegreat
Posts: 284
Joined: Sat Apr 16, 2016 11:33 pm
Country: -

Re: LUA and openTx

Post by Raythegreat »

Hi all,

I'm struggling with lua scripts.
Here is a problem I have.

I wrote a lua script and I can run it successfully in the telemetry page and from any screen display. No error messages whatsoever and the script works well.
But if I try to run the script from the SD card using with the execute command I always have the error message "Script syntax error" even if there is no syntax error in the script. The Activate RX script from Mike B works perfectly in the execute menu.
So there must be a reason why the execute does not work for my scripts even if I put only one single line.

Please help with this issue.

Thanks
Ray
User avatar
Kilrah
Posts: 11105
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: LUA and openTx

Post by Kilrah »

There are multiple types of scripts. To be executable from the SD browser it has to be a one-time script.

https://doc.open-tx.org/opentx-2-3-lua- ... e_overview
Raythegreat
Posts: 284
Joined: Sat Apr 16, 2016 11:33 pm
Country: -

Re: LUA and openTx

Post by Raythegreat »

Hi Kilrah,

Thank you.
This helped a lot.
I added a return 1 at the end of my script and I don't have the script syntax error anymore and the script worked.
My question now is what is the best way to guaranty a one-time script? With a return other than 0 or something else?

Ray

Post Reply

Return to “General help (FrSky Taranis radio)”