Ethos v1.5.7 and X18, X20 series User Manual
Lua Scripts
Lua scripts allow you to create custom widgets to display information in the Ethos main views.
In future it will also allow you to modify the behaviour of the radio to add specialized functions
for custom tasks, and to interface with flight controllers and the like.
The Lua scripting language is a lightweight embeddable scripting language and is designed to
be used for all sorts of applications from games to web applications and image processing, and
in this case for implementing custom functions in the radio.
Please note that Lua scripts increase the startup time of the radio. If they are implemented
correctly the delay should not be noticeable, but if it is not the case, then the delay may be
almost indefinite.
ETHOS Lua interpreter
The Lua interpreter embedded inside ETHOS is based on LUA 5.4.3. and is packaged with
these libraries:
• basic library
• table library
• io library
• os library
• math library
ETHOS Lua documentation
The ETHOS Lua documentation can be found in the Lua development tools tab in Ethos Suite.
ETHOS Lua example script files location
The ETHOS Lua example script files are stored on https://github.com/FrSkyRC/ETHOS-
Feedback-Community/tree/main/lua. To download a file:
• Open the above link in a web browser.
• Navigate to the folder and then the main.lua file you want to download.
• Click on the main.lua to open it and view the code.
• Click on ‘Raw’.
• Right-click the page and click ‘Save Page as’, then save the file as main.lua in your download
location.
• To avoid clashes with other main.lua files, move the downloaded main.lua file into a suitably
named folder (suggest to use the same folder name as the one the file came from).
For other files like images:
• Click on the file.
• Click on ‘Download’. It will download into your browser.
• Right-click the image and click ‘Save Image as’, then save the file (as for example
servo.png) in your download location.
The majority of the examples are for Lua widgets, which are configured in the Configure
Screens section. Another application for Lua scripts is to create System Tools, which appear
after ‘Info’ in the System section of the menus. Please refer to the ‘servo’ example for an
example System Tool.
Lua scripting configuration limits
- 2MB for bitmaps (one full screen bitmap on X20 consumes 768K)
- 2MB for Lua scripts (this is a large amount)