Setup Betaflight LUA Script on OpenTX Radios

by Oscar
Published: Last Updated on
Betaflight Lua Script Opentx Radio Tx16s

Betaflight LUA script allows you to change flight controller settings on your OpenTX radio, such as PID, rates, VTX channels and power, and many more. In this tutorial I will show you how to setup and install Betaflight LUA script on your TX.

What You Need

You will need a radio that supports OpenTX. See my radio recommendations.

Make sure to update OpenTX on your radio (version 2.3.4 or newer). Here’s how to update OpenTX.

Full telemetry on your quad is required, make sure Telemetry feature is enabled in Betaflight. That means if you are a Frsky user and using SBUS, SmartPort is required, or if you are using FPort that should work. For TBS Crossfire users, telemetry should be working already. ExpressLRS should work too with Telemetry enabled in your build option, but makes sure to use lower telemetry ratio such as 1:8 or even 1:4.

In order to change VTX settings from your radio, you need to have SmartAudio (or Tramp) and VTX Tables setup in Betaflight first.

Download Betaflight LUA script: https://github.com/

Copy Files to Radio SD Card

Turn on radio in Bootloader mode, and connect USB cable, the SD card inside the radio should pop up in your computer as an external drive. There could be a couple of external drives that appear, pick the bigger one.

Make a copy of your SD card content first.

Open the file you just downloaded from Github, open the “obj” folder, and you should see 3 folders, “BF”, “SCRIPTS”, “SOUNDS”. Just copy these 3 folders into the root directory of your SD card. Now disconnect USB and restart your radio.

Betaflight Lua Script Copy Files Opentx Radio Sd Card Content

To activate the BF LUA script, we used to go to the Telemetry screen, but that’s no longer the case. Now you can go into “System Settings”, then “Tools” Menu, and find “Betaflight Setup”.

Betaflight Lua Script Tools Menu

For the first time, it will take a few seconds to compile the scripts, but after that it should just load the script immediately.

Betaflight Lua Script Opentx Radio Tx16s

If it gets stuck at “initialising” screen, make sure Telemetry is actually working on your quad and that Telemetry feature is indeed enabled in Betaflight Configuration. (e.g. you should be getting battery voltage from the quad)

How to Use Betaflight LUA Script

Here’s the home screen of the Betaflight LUA script.

Betaflight Lua Script Config Home Menu Screen Options

The Betaflight LUA script has some of the most used Betaflight settings, but not all of them. So rarely you may still need access to a computer, or Speedybee APP to use the CLI.

After changing a setting, long press ENTER, and select option “Save Page” to save changes.

NOTE: changing PID values with LUA script doesn’t play well with the slider in configurator. Once you have changed individual value it will disable the slider and you will lose the P/D ratio. Just beware of it.

Here are some of the PID settings:

Betaflight Lua Script PidFilters and advanced settings:

Betaflight Lua Script Filters Pid Advance Screen

Here’s the VTX settings screen:

Betaflight Lua Script Vtx Settings

 

Whenever you made a change to the VTX Table in Betaflight (such as disabling a channel or editing power values), you have to reload the data from the quad. To do this, hold down the ENTER button, and select VTX Tables, and it will download the new VTX Tables to the radio. You need to do this with different VTX (quads) too if they have different VTXTable.

Leave a Comment

By using this form, you agree with the storage and handling of your data by this website. Note that all comments are held for moderation before appearing.

1 comment

Mozzzzi 18th September 2021 - 9:20 am

Thanks for all your great advice and tutorials. I really appreciate the work you do.

Reply