Giter Site home page Giter Site logo

ltm-lua's Introduction

LTM-lua

Introduction

This project provides an OpenTX LUA script that outputs LTM (INAV'S Lightweight Tememetry) on a serial port on an OpenTX / EdgeTX radio. It is designed to work with INAV as the telemetry provider.

Typical use case:

  • Radiomaster TX16S radio (which has two normal / not inverted UARTS)
  • Bluetooth module attached to a radio UART
  • LTM aware ground station mwp, ezgui, "mission planner for inav" or
  • Antenna tracker that uses LTM.

Installation and Usage

  • Copy the script ltm.lua to the `SCRIPTS/FUNCTIONS' directory
  • Create a directory, SCRIPTS/FUNCTIONS/LTM; copy the files LTM/crsf.lua and LTM/config.lua to that directory, such that the following directory structure is maintained.
    ├── SCRIPTS
    │   ├── FUNCTIONS
    │   │   ├── ltm.lua
    │   │   ├── LTM
    │   │   │   ├── crsf.lua
    │   │   │   ├── config.lua
  • Enable the script as a Global Function or model specific Special Function.

Note that any Zip files in the release area will profile this directory structure.

The script may be invoked either on an external stimulus e.g. Telemetry or on a switch. See the OpenTX / TX vendor documentation for details on configuring your radio.

Note that the UARTs on the TX16S default to 115200 bps, so set BT devices accordingly.

Note that:

  • OpenTX 2.3.9, a bug causes no power to be supplied to the TX16S UARTS; this is fixed in the 2.3.10 nightlies.
  • OpenTX 2.3.10, a bug causes the Crossfire Flight Mode not to be set.
  • OpenTX 2.3.11, the baud rate is set incorrectly for LUA ports, rendering the data unreadable.
  • EdgeTX 2.7.1 and (2.8-dev of early May 2022) cannot set the LUA serial baud rate to other than the default of 115200.
  • The telemetry provider must be INAV for some status related fields.

No known issues with

  • OpenTx 2.3.14
  • EdgeTX (other than setting baud rate)

Configuration

There are a few user editable settings in the file LTM/config.lua; currently the user must edit this file directly as no radio UI is provdied.

In particular, the onlyTracker setting may be used to provide only GPS data for antenna trackers. See the comments in LTM/config.lua for details.

The S.baudrate setting may be used to set the baud rate; if S.baudrate is 0, then the device baud rate is unchanged, otherwise the specified baud rate is set. The default value is 0 (i.e. use radio setting).

Audio

The audio directory contains two synthesised voice files, ltmon.wav and ltmoff.wav that may be placed in SOUNDS/en and used to provide audible indications (via Special Functions) that LTM forwarding is enabled / disabled.

Logging

If the variable LOGGER is set to true, LTM binary messages written to a LOG/ file (simulator and radio). It is not advised to do this on the radio.

In the simulator human readable debug messages are generated unconditionally.

Caveats

Last tested successfully on a Radiomaster TX16S with OpenTX 2.3.15 and EdgeTX 2.7.1 and the internal module, FrSky D16 compatible RX (May 2022). Requires Smartport or CRSF compatible RX on the aircraft.

The scripts have also been tested by others using Crossfire with Taranis x9D+se, OpenTX 2.3 +luac, full Crossfire TX, Nano RX and the u360gts antenna tracker.

Other OpenTX/EdgeTX compatible radios and other RX radio systems (e.g. R9) are NOT tested and as I don't have such hardware.

Copyright and Licence

(c) Jonathan Hudson 2020-2022

GPL Version 3 or later.

ltm-lua's People

Contributors

stronnag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

mrmap alienix33

ltm-lua's Issues

Script is not working with 2.3.15

Since I have updated my TX16S to OpenTX 2.3.15 (from 2.3.10) the script is no longer working. I get no LTM output.
The strange thing is, when I tried your old initial version (without the config file), it is working. If you need more info, let me know.

Some data are missing

Hi, I am using LTM.lua script on my TX16S ( telemetry send by onboard X8R receiver and SPORT connected to FC).
On LTM messages output from TX16S uart:

  • following are ok: Lat, Long, RSSI, VBat
  • but numsats and fix remains at 0 (note roll, pitch and heading also)
    As LTM messages are used by an antenna tracker, numsats and fix data are very important please can you check what is wrong

External module support

Hi Jonathan

Great little project..... Just experimenting, and seems to work.
I appreciate this is still very experimental, but I can see this is opening up nice possibilities.

I noticed, it does work with internal module (Radiomaster TX16S), but it doesn't give any data when using an R9M external module (which also provides S-port data).
However, if I set the radio Serial port in the system menu from Lua to Telem Mirror (i.e. bypassing the Lua script), I do get raw S-port data from the BT module. But then telem mirror only seems to work with external modules, not the build-in..... But I guess that is OpenTx related, not your Lua script.
I'm pretty sure, that will get resolved in upcoming releases of openTx (currently running 2.3.9)

Thanks a lot !

Which serial port?

which serial port do we use on the tx16s? left or right on the bottom?

also, i assume it works fine turning the CRSF into LTM using the crossfire module as there's a CRSF lua script in there?

is crossfire support planned?

LTM would be a very good alternative as native crossfire data is overwhelming the build in BT module and the connection is breaking up constantly

cannot get telemetry on TX16s on EdgeTX 2.7.1

hello, i cannot get LTM telemetry out from my radiomaster tx16s.
-have set global function for proper switch to LTM lua script.
-have set aux as LUA in system menu/hardware
-other lua scripts that output information on AUX works
-when aux set as telemetry mirror, i got CRSF telemetry.

thanks for help

running
edgetx 2.7.1
TBS Crossfire 6.19
iNav 5.1.0

log file in attachment
CRSF-2022-10-05-174436.csv

Internal BT support

Is it possible to add an option to send LTM data via internal BT module of the radio (x-lite, horus, radiomaster) instead through serial port pins?

Tracker only mode

To achieve higher update rates for antenna tracking - we could skip most of the frames (only sat count, LAT/LONG and alt needed)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.