OpenTX Tutorial - Lua Telemetry Scripts Getting Started (Correction in description)

Pubblicato il: 11 gennaio 2017
sul canale di: RCdiy
8,010
40

Updated video
   • Telemetry Getting Started (Correction...  

Correction in blog post (lua buid option not required)
Getting Started With Lua Telemetry Scripts
http://rcdiy.ca/aa-telemetry-scripts-...

RCdiy
http://rcdiy.ca/

OpentTx Lua Scripts Telemetry
Getting started http://rcdiy.ca/telemetry-scripts-get...
Repository https://github.com/RCdiy/OpenTxLua

Help pay the bills :)
  / rcdiy  
http://rcdiy.ca/patronage/

Us my affiliate links (It won't cost you anything.)
http://amzn.to/2iDRfgb
https://www.banggood.com/Wholesale-To...

------------------------------------------------------------------------------------------------------------
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


In questa pagina del sito puoi guardare il video online OpenTX Tutorial - Lua Telemetry Scripts Getting Started (Correction in description) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato RCdiy 11 gennaio 2017, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 8,010 volte e gli è piaciuto 40 spettatori. Buona visione!