-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Ethos-lua Tutorial
A small note: if you don't want to read the introductory blurb, please skip directly to "Ethos-Lua Basics".
This tutorial conveys the basic knowledge of Lua programming under Ethos.
After completing the tutorial, the user should be able to independently program smaller Lua programs. A basic requirement is familiarity with PC technology and fundamental programming knowledge. It is not required to have prior experience in programming with Lua.
Even "Basic" as a programming language would already have imparted the necessary background knowledge. This is the first version of the tutorial, which will be refined and expanded gradually over time. If the meaning of terms (e.g., handler, interpreter, etc.) is not clear, I ask that you clarify the term using a search engine if it is not listed in the glossary.
A Glossary will be gradually built up. It is not the goal of this tutorial to convey absolute programming basics without any prior knowledge. For this purpose, links to Lua beginner courses and reference pages are provided.
The guide follows a "TopDown" approach. From the general to the specific.
The section up to and including "Ethos Lua Basics" can also be interesting for pure Lua users to improve their understanding of working with Lua scripts.
First, general connections, terminologies, how Lua works under Ethos, basic functionalities, and the working environment are explained (Chapter 1).
Then you start with illustrative tasks, how to implement them, and the respective demo Lua scripts.
The requirements gradually increase. Individual chapters bundle the topics.
It is intended to convey an increasing level of detailed understanding, from simple requirements to more complex tasks.
In the end, every participant should be able to continue their education autodidactically according to their individual needs.
Why should one even bother with Lua for an Ethos transmitter?
If you look at the Ethos GitHub pages and the issues, there are many individual use cases and extension requests from users who demand very specific functionalities or display variants.
Very often, such a requirement fits a very limited user base and could even have negative side effects for other users or overall performance.
Even if the desired function/extension were to be implemented only optionally, additional fields would have to be provided in some Ethos menus for possible parameterization or activation.
Furthermore, every additional implementation consumes memory space, uses CPU resources, increases maintenance effort, and binds developer resources.
So, if an extension/idea serves only a small user base but imposes limitations on the general public, one should consider whether alternative implementations might be a better solution.
This is where Lua comes into play, allowing the user, if their idea is really important to them, to implement their individual needs on their transmitter as much as possible.
Additionally, they can make their "project" available to the public (e.g., via GitHub).
Is that too abstract? Examples can be:
-
Displaying more than one telemetry value in larger fonts with freely selectable color options
-
Announcements whose logic goes beyond what is possible with LSWs
-
Custom design of the transmitter's homepage, etc.

Otherwise, Lua scripts are also often used by accessory providers to configure their hardware or, for example, in functional model building, to extend functionalities via touch screen.