Skip to content
Udo edited this page Jul 5, 2024 · 11 revisions

Ethos-lua Tutorial

preliminary TEST ONLY




Objective of the Tutorial


(Small note: If you don't want to read introductory chit-chat, please skip directly to “Ethos-Lua Basics”)

This tutorial imparts the basic knowledge of Lua programming under Ethos. Upon completion of the tutorial, the user should be able to independently program smaller Lua applications. A prerequisite is familiarity with PC technology and basic programming knowledge. It is not strictly necessary to have previously programmed in Lua. Even “Basic” as a programming language would already have provided the necessary background knowledge. This is the first version of the tutorial, and it will be progressively refined and expanded later. If the meaning of terms (e.g., handler, interpreter, etc.) is unclear, I kindly ask that you first clarify the term using a search engine.

A glossary will be developed later.

The aim is not to teach programming fundamentals completely from scratch. However, links will branch off to Lua beginner courses and reference pages.



Structure of this Documentation


The guide follows a “Top-Down” 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 handling Lua scripts.

First, general contexts, terminologies, functionalities, and the working environment are explained.

After that, you start with example tasks, how to implement them, and the respective demo-Luas.

Individual chapters bundle the topics.

It aims to impart more detailed understanding from simple requirements to more complex tasks.

In the end, each participant should be able to continue self-educating according to their individual needs.

Einzelne Kapitel bündeln die Themengebiete

Es soll von einfachen Anforderungen hin zu komplexeren Aufgaben immer mehr Detail-Verständnis übermittelt werden

Am Ende sollte jeder Teilnehmer in der Lage sein, sich autodidaktisch weiter auf seine individuellen Bedürfnisse hin Fortzubilden



Typical use cases


![Ethos-lua-tutorial ](https://github.com/strgaltdel/Ethos-lua-tutorial/blob/main/doc/bmp/00%20main/sample.png)

Why should you even bother with Lua for an Ethos transmitter?

When 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. Even if the desired function/extension were implemented optionally, additional fields for possible parameterization or activation would have to be maintained in various Ethos menus.

Furthermore, every additional implementation consumes memory, costs CPU resources, increases maintenance effort, and ties up developer resources. So if an extension/idea only serves a small user base but imposes restrictions on the general user base, one should consider whether alternative implementations might be a better solution.

This is where Lua steps in and allows the user to implement their individual needs on their transmitter themselves if the idea is really important to them. Additionally, they can share their "project" with the community (e.g., via GitHub).

Is that too abstract? Examples might include:

  • Displaying more than one telemetry value in larger fonts with freely selectable color options

  • Announcements whose logic goes beyond what is possible with LSWs

  • Individual design of the transmitter's homepage, etc.

Otherwise, Lua scripts are also often used by accessory providers to configure their hardware or, as in functional model building, to extend functionalities via the touchscreen.

Clone this wiki locally