OpenTX Tutorial - Lua Telemetry Scripts Getting Started

Video Channel
Please help us to find bad videos. Broken or unappropriated video content?
Updated video
Correction in blog post (lua buid option not required)
Getting Started With Lua Telemetry Scripts
/
RCdiy
/
OpentTx Lua Scripts Telemetry
Getting started /
Repository
Help pay the bills :)
/
Us my affiliate links (It won't cost you anything.)
------------------------------------------------------------------------------------------------------------
OpenTx 2.1 Lua Script
Contents [show]
TELEMETRY
What is a Telemetry script
Access telemetry data
Displays customized telemetry screens
Process telemetry data (telemetry calculations)
Up to 3 active scripts per model
Selected from the telemetry screen settings
Can be used by different models (with caution)
Can be used to display non-telemetry data such a the Tx timer
Telemetry script file
SD Card copy on your computer /SCRIPTS/TELEMETRY/name.lua
name 6 or less characters
Suggestions
Read or at least skim through the Lua manual by the OpenTx developers.
Work on scripts using using plain text editors such as Notepad (Windows), TextEdit in plain text mode (OS X), or a Lua editor that has features to help developers (Win, Linux, Mac).
Test scripts using the companion simulator and log files.
Keep scripts simple.
Whenever possible avoid duplicating what OpenTx has already implemented.
Setup OpenTx
Edit Settings (Preferences)
Build Options Select “lua”
Other Settings SD Structure path ensure this points to a copy of Tx SD Card placed on your computer
LuaSettings
Telemetry Available
Companion Open a model that has Telemetry from the receiver
Select the Telemetry tab
Take note of the sensor names
TelemetryTab
For this example we will use RxBt
Sample Script
Download this file 01GtSt.lua (right click and Save As, Download Linked File). Check that the file ends with .lua and if it does not rename the file so that is does. i.e. 01GtSt.lua
Place it in SD Card copy on your computer /SCRIPTS/TELEMETRY/
Open the file in a text editor to review the default settings and edit it as required. In this example we will check that the script is using “RxBt”.
Add A Lua Script To Telemetry Screen
Companion Open a model that has Telemetry
Select the “Telemetry” tab
Scroll to the bottom and select a “Telemetry screen”
“Custom Screen Type” select “Script” and then “RxBt”
TelemetryScreen
If “RxBt” is not present close model editing window and open it up again.
Running & Testing A Lua Script In Companion
Companion Select a model that has telemetry
Right Click Select “Simulate”
Select “Taranis Simulator” (or your Tx equivalent)Simulator
Long press PAGE
If you don’t see the screen with the new script output press PAGE briefly, repeat till you do.
ChangedValues
Select “P4 – Telemetry Simulator”
TelemetryValues
Locate “RxBt” and then the box near it that has the value being displayed on the telemetry screen. Change the value and watch the screen change.
Running The Script On The Tx
Synchronize the SD card
Start up the Tx and aircraft like you usually would
Long press PAGE
If you don’t see the screen with the new script output press PAGE briefly, repeat till you do.
screen-2016-06-27-204454
Bug Report: opentx-taranisplus-timer3-noheli-lua-massstorage-mixersmon-ppmus-en-2.1.8
On the Tx the Telemetry script screen is blank. To work around it use this file RxBt2.lua.
References used to write this page
Lua OpenTX manual
AttitudeRC
Fpvracer.lt is not the owner of this text/video/image/photo content, the real source of content is Youtube.com and user declared in this page publication as Youtube.com user, if you have any question about video removal, what was shared by open community, please contact Youtube.com directly or report bad/not working video links directly to video owner on Youtube.com. Removed video from Youtube.com will also be removed from here.