3
$\begingroup$

I’m looking at how to use LUA scripts and was wondering how to configure them I am OpenTX radio.

Thanks.

More info: at present, I don’t want to write my own scripts, only run scripts that I can find online, such as VTX control.

$\endgroup$
  • 1
    $\begingroup$ This is a little vague, can expand on what you are wanting to do? i.e. are you just installing existing LUA scripts such as VTX control or writing your own scripts? $\endgroup$ – Paul Kendall Apr 16 at 1:06
  • $\begingroup$ @PaulKendall sorry - updating now. $\endgroup$ – Drones and Whatnot Apr 16 at 1:07
2
$\begingroup$
  • Download LUA scripts you need, for VTX control in Betaflight its: https://github.com/betaflight/betaflight-tx-lua-scripts/releases
  • Unzip it, you will have folders BF, SCRIPTS, SOUNDS
  • You need to copy these folders to the SD card root directory.
    • To do this put you TX to bootloader mode and connect a USB cable to it and access the SD card
    • Or you can just take SD card out of TX and use card reader to connect it to the PC If prompted during the install replace/merge existing on SD card files.
  • Now put the SD Card back or disconnect the USD cable and power up the TX.
  • You need to go to SD Card page on OpenTX now. Depending on the version and the TX itself it can be in different places.
    For example I have QX7 and OpenTX 2.3.5, I need to hold down MENU button and then hit PAGE once.
  • Go to BF folder and execute (by long pressing) bf.lua. Now use PAGE button to navigate to VTX page.

Additionally if you don't want to go to SD Card each time you can setup telemetry screen:

  • Go to the Telemetry page of your model.
  • Find a free screen (Screen 1, 2, etc.)
  • Select "Script" type for it
  • Then on the next column you select which script to display, select bf

Now you can run this LUA script from the Home page of the model.

Press "PAGE" button till the telemetry show up and then use "PAGE" to scroll to the screen you selected, like Screen 2, etc.

The only thing is that if you run scripts from TELEMETRY screen, they will use MENU button to skip pages inside the script, instead of PAGE. Because PAGE flips pages between telemetry screens.


If you have error "Script syntax error: not enough memory" you probably didn't check "luac" during the OpenTX install

Sources:
https://oscarliang.com/betaflight-change-pid-vtx-settings-taranis/
https://oscarliang.com/vtx-control/
https://oscarliang.com/t16-lua-script/

| improve this answer | |
$\endgroup$
  • $\begingroup$ That is an excellent walkthrough - thanks very much! $\endgroup$ – Drones and Whatnot Apr 16 at 9:48
2
$\begingroup$

Oscar Liang has a really good page for this specific use case https://oscarliang.com/vtx-control/

And Joshua Bardwell has some really good videos that you can follow along with https://www.youtube.com/watch?v=zFb5IJpM1XU

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.