Skip to main content
Version: 2.0.0

Lua Scripts

Introduction

You can adjust a variety of settings using only your transmitter with the Rotorflight Lua scripts. They allow you to change things like PIDs, rates, filters, failsafe and governed headspeed on the field. Prerequisites:

  • OpenTX 2.3.12, EdgeTX 2.5.0 or newer or Ethos 1.4 or newer on the transmitter and:
    • an FrSky SmartPort or F.Port receiver.
    • or a CRSF v2.11 or newer receiver.
    • or an ELRS 2.0.1 or newer receiver.

Examples:

  • TX16S with a FrSky X4R using the FrSkyX2 protocol.
  • Frsky Ethos Radio (X20, X18, X14 etc) with either SPORT,FPORT receiver or ELRS with an external module.
  • Taranis X9D with a TBS Crossfire TX/RX module.
  • Taranis QX7 and a FrSky R-XSR, using the FrSky D16 protocol (as long as you don't use the ACCST D16 2.1.1 LBT firmware on the R-XSR, because this firmware has telemetry bugs).
  • TX16S with an ELRS 2.0.1 module and receiver.

If you're not using F.Port, start up the Rotorflight Configurator, go to the Configuration tab and enable the TELEMETRY feature. F.Port telemetry does work without enabling this feature.

If telemetry is working properly on your system, the Lua scripts should work as well.

Installation

Download the latest release and copy the contents of the SCRIPTS folder to your transmitter. See also the readme.

and copy the contents of the SCRIPTS folder to your transmitter.

You will know if you did this correctly if the rf2.lua file shows up in the /SCRIPTS/TOOLS directory. Also Rotorflight 2 should now show up in the Tools menu of your transmitter.

Usage

On your transmitter, go to the Tools menu of your transmitter and select Rotorflight 2.

Tools

The first time you do this all scripts will be compiled and the Tools menu will be displayed again. Select Rotorflight conf again. Now the script will wait for a connection with the receiver.

Connection

Power up the receiver. The script will retrieve the API version used by Rotorflight and the device ID of the flight controller. After this you will see the main menu.

MainMenu

Here you can select what you want to change. For example, select PIDs.

PID

Now you can change the values of your PIDs. If you want to save your changes, long press the wheel/roller. The Page menu should now pop up. Select Save page to send your changes to the flight controller. Or press Exit to exit the Page menu.

PageMenu

There's quite a lot of settings you can adjust on the field. Here's an overview of all the pages:

Pages

Feel free to have a look at any page. As long as you don't select Save page, nothing will be changed.

Background script

This optional background script offers RTC synchronization and RSSI through MSP.

RTC synchronization will send the time of the transmitter to the flight controller. The script will beep if RTC synchronization has been completed.

Blackbox logs and files created by the FC will now have the correct timestamp.

The background script can be setup as a special or global function in EdgeTX.

The image below shows how to configure the background script as a special function.

By doing this, the script will automatically run as soon as the model is selected.

Background script

Background script