Skip to content

Commit

Permalink
Merge pull request #8 from stronnag/update_set_baud_rate
Browse files Browse the repository at this point in the history
Update set baud rate
  • Loading branch information
stronnag authored May 26, 2022
2 parents c4216e0 + 0531395 commit 5c1c50f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion LTM/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ S.onlyTracker = false
-- S.LOGGER = true

-- 2.3.12 and later
S.baudrate = 115200
-- if set to 0 (or less!) then the baud rate will not be changed
S.baudrate = 0

return S
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## 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](https://github.com/iNavFlight/inav) as the telemetry provider.
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](https://github.com/iNavFlight/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](https://github.com/stronnag/mwptools), ezgui, "mission planner for inav"
* LTM aware ground station [mwp](https://github.com/stronnag/mwptools), ezgui, "mission planner for inav" or
* Antenna tracker that uses LTM.

## Installation and Usage
Expand Down Expand Up @@ -36,19 +36,21 @@ 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.0 and (2.8-dev of early May 2022) cannot set the serial baud rate to other than the default of 115200.
* 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 (2.5.0 and later)
* 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.
Expand All @@ -61,12 +63,12 @@ In the simulator human readable debug messages are generated unconditionally.

## Caveats

Tested on a Radiomaster TX16S with OpenTX 2.3.9 (and 2.3.10 nightlies), internal module.
Requires smartport (e.g. Frsky D16) compatible RX on the aircraft, and EdgeTX.
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 using Crossfire with Taranis x9D+se, OpenTX 2.3 +luac, full Crossfire TX, Nano RX and the [u360gts antenna tracker](https://github.com/raul-ortega/u360gts).
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](https://github.com/raul-ortega/u360gts).

Other OpenTX compatible radios and other RX radio systems (e.g. R9) are NOT tested and as I don't have such hardware, may not work.
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

Expand Down
2 changes: 1 addition & 1 deletion ltm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ local function init()
S = loadScript("/SCRIPTS/FUNCTIONS/LTM/config.lua")()
dolog("Tracker only " .. string.format("%s",S.onlyTracker))
if rmaj >= 2 and rmin >= 3 and rrev >= 12 then
if S.baudrate ~= 115200 then
if S.baudrate > 0 then
setSerialBaudrate(S.baudrate)
end
end
Expand Down

0 comments on commit 5c1c50f

Please sign in to comment.