Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
233 commits
Select commit Hold shift + click to select a range
2aa0384
add .gitignore
jurgelenas Feb 11, 2026
299d1e3
Move blackwhite lua script to blackwhite dir
jurgelenas Feb 11, 2026
324d39b
Add lvgl lua, new lvgl based widgets
jurgelenas Feb 11, 2026
40aa9a5
de-box
jurgelenas Feb 11, 2026
66cc28e
Add readme
jurgelenas Feb 11, 2026
df2f12f
ui tweaks
jurgelenas Feb 11, 2026
0fb9e99
snooze warning for 60s
jurgelenas Feb 11, 2026
d254371
Rename ELRSlib to ELRS
jurgelenas Feb 11, 2026
c4e3989
Fix lvgl warning
jurgelenas Feb 11, 2026
ae9ec44
improve loading text
jurgelenas Feb 11, 2026
ffe847d
Add new BW Lua script
jurgelenas Feb 11, 2026
6903171
remove old one
jurgelenas Feb 11, 2026
815806c
implement slow loading simulator
jurgelenas Feb 11, 2026
c3dfd38
update crsf sim
jurgelenas Feb 11, 2026
d4b1684
Merge branch 'lvgl-lua' into blackwhite2
jurgelenas Feb 11, 2026
f939f9b
simplify full screen mode detection
jurgelenas Feb 14, 2026
8b57959
simulate CE long strings in TX Power folder
jurgelenas Feb 14, 2026
ef20f80
Migrate to 2 columns folder layout for all radios, except for 3 colum…
jurgelenas Feb 14, 2026
221aaba
borderPad layout improvements
jurgelenas Feb 14, 2026
213bfe7
fix el18 portrait layout
jurgelenas Feb 14, 2026
757c451
el18 improvements
jurgelenas Feb 14, 2026
930414c
improve tx16s
jurgelenas Feb 14, 2026
870769c
improve code style
jurgelenas Feb 14, 2026
eeec1e0
unify size naming convention
jurgelenas Feb 14, 2026
963b31c
Merge branch 'lvgl-lua' into blackwhite2
jurgelenas Feb 14, 2026
c12df12
refactor elrsv1 detected message
jurgelenas Feb 15, 2026
2fa0161
fix device info packets handling
jurgelenas Feb 15, 2026
5381af5
Merge branch 'lvgl-lua' into blackwhite2
jurgelenas Feb 15, 2026
3385bf3
fix device info handling
jurgelenas Feb 15, 2026
655617b
add generic alerts method
jurgelenas Feb 15, 2026
305ad21
remove debounced save
jurgelenas Feb 15, 2026
ffa77a9
Merge branch 'lvgl-lua' into blackwhite2
jurgelenas Feb 15, 2026
4a55bd2
remove debounced save
jurgelenas Feb 15, 2026
b2c83e4
Send initial DEVICE_PING after 1 second, then every 5 second while to…
jurgelenas Feb 15, 2026
1e849f8
Merge branch 'lvgl-lua' into blackwhite2
jurgelenas Feb 15, 2026
c959997
Send initial DEVICE_PING after 1 second, then every 5 second while to…
jurgelenas Feb 15, 2026
a961304
no periodic ping
jurgelenas Feb 17, 2026
6a4c1f8
Merge branch 'lvgl-lua' into blackwhite2
jurgelenas Feb 17, 2026
7c9f103
no periodic ping
jurgelenas Feb 17, 2026
6389699
migrate to unified lua for BW & Color lcd radios
jurgelenas Feb 17, 2026
e728662
remove per-byte lookup table allocation in string/options parser
jurgelenas Feb 17, 2026
9adb687
use table.concat instead of ..
jurgelenas Feb 17, 2026
08e1e4e
remove .. in favor of shim.tableConcat
jurgelenas Feb 17, 2026
446bc17
do not pass shim to ui
jurgelenas Feb 17, 2026
8274ca0
use sparse keys in protocol field allocation
jurgelenas Feb 17, 2026
e16f16d
Update readme for unified lua
jurgelenas Feb 17, 2026
ced30db
Add screenshots
jurgelenas Feb 17, 2026
c8ab817
resize screenshots
jurgelenas Feb 17, 2026
b969e1c
Revert "resize screenshots"
jurgelenas Feb 17, 2026
f0879ae
update image widths
jurgelenas Feb 17, 2026
93857d2
Migrate to lvgl constants, appyl diff from philmoz
jurgelenas Feb 18, 2026
f109fd0
fix code style issue
jurgelenas Feb 18, 2026
b3b9719
drop opentx support
jurgelenas Feb 18, 2026
34ad8fd
update lint
jurgelenas Feb 18, 2026
a46d011
Add BW screenshot
jurgelenas Feb 18, 2026
1b59070
Add lua-language-server, stylua, add edgetx lua api type definitions
jurgelenas Feb 18, 2026
3ca475c
stylua setup
jurgelenas Feb 18, 2026
21f8639
fix styling when battery voltage is present
jurgelenas Feb 24, 2026
906df0a
add shim
jurgelenas Feb 24, 2026
8ae2b53
armed flag text parity with the firmware
jurgelenas Feb 24, 2026
8b0eb7d
handle warnings better
jurgelenas Feb 24, 2026
a028b19
fix telemetry widget for elrs v4
jurgelenas Feb 24, 2026
1e74e66
Add separate alert for model mismatch
jurgelenas Feb 25, 2026
10d5bfb
improve copy on model mismatch
jurgelenas Feb 25, 2026
770c5f9
Add strings & float support lvgl
jurgelenas Feb 25, 2026
f39b601
Merge branch 'unified-lua-lsp-strings' into unified-lua-lsp
jurgelenas Feb 27, 2026
5cab7de
after number edit reload all releated fields
jurgelenas Feb 27, 2026
ba0b8ff
remove 2.11 support
jurgelenas Mar 4, 2026
4328aba
assign title to lvgl.choice
jurgelenas Mar 4, 2026
5569ebf
move device name to the bottom
jurgelenas Mar 4, 2026
9998b9d
rename "No link" to "No telemetry"
jurgelenas Mar 4, 2026
b763956
improve layout
jurgelenas Mar 4, 2026
6a7233d
add github workflow
jurgelenas Mar 4, 2026
bad38dd
fix workflow
jurgelenas Mar 4, 2026
2f6a55c
update github action runtime
jurgelenas Mar 4, 2026
683c6ef
add sync command
jurgelenas Mar 5, 2026
5dec8f9
update make file
jurgelenas Mar 5, 2026
3ca29df
Fix LVGL focus loss on field change by avoiding full UI rebuild
jurgelenas Mar 6, 2026
7acf530
count reloading fields as missing progress
jurgelenas Mar 6, 2026
a38d8b1
migrate to edgetx-cli pkg* commands
jurgelenas Mar 6, 2026
ebf6fc9
add license
jurgelenas Mar 6, 2026
e892fb3
add min edgetx version
jurgelenas Mar 6, 2026
35568a0
migrate from toml to yml for consistency with edgetx
jurgelenas Mar 6, 2026
17e45e3
Merge branch 'unified-lua-lsp-focus2' into unified-lua-lsp
jurgelenas Mar 6, 2026
1366aea
fix code style
jurgelenas Mar 6, 2026
fb8c77a
update readme
jurgelenas Mar 6, 2026
6e51c93
Move CRSFSimulator to src/
jurgelenas Mar 6, 2026
747c55a
mark CRSFSimulator as dev depency
jurgelenas Mar 6, 2026
9103748
remove test dir from lua checklist
jurgelenas Mar 6, 2026
3ea2862
Add GPL-3.0 license
jurgelenas Mar 16, 2026
71f7d8b
Suppress deprecated diagnostic in bitmap.d.lua
jurgelenas Mar 16, 2026
3a20099
remove edgetx-lua-stdlib
jurgelenas Mar 16, 2026
a8a7b89
add edgetx-lua-stdlib as submodule
jurgelenas Mar 16, 2026
e183664
include submodules in github action checkout
jurgelenas Mar 16, 2026
37abbfc
update edgetx versions information
jurgelenas Mar 29, 2026
43ec52a
remove dead code in lvgl
jurgelenas Apr 1, 2026
4f30343
Add editor config
jurgelenas Apr 1, 2026
ab516d2
feat: add per-channel output mapping config to CRSFSimulator
jurgelenas Apr 2, 2026
f4aaf9d
add TODO.md to .gitignore
jurgelenas Apr 2, 2026
535cdb6
Add package metadata to edgetx.yml manifest
jurgelenas Apr 14, 2026
67c8835
update edgetx package format
jurgelenas Apr 19, 2026
5f92789
raise minimum EdgeTX to 2.11.6 / 2.12.1
jurgelenas May 13, 2026
d1f9746
update title for bw unsupported alert
jurgelenas May 13, 2026
710b621
migrate away from ExpressLRS1 name to ExpressLRS for tool
jurgelenas May 13, 2026
20d6d54
update README CRSF Simulator section for src/ location
jurgelenas May 16, 2026
4bd6a69
update edgetx-cli package location
jurgelenas May 16, 2026
72b91c2
split development docs out of README into docs/development.md
jurgelenas May 16, 2026
10d7f30
show device status text while a COMMAND parameter executes
jurgelenas Jun 16, 2026
8b44aa8
reload current page after a COMMAND parameter completes
jurgelenas Jun 17, 2026
51da9e8
reload related fields after editing a string parameter
jurgelenas Jun 17, 2026
0fdd50a
add Bind Phrase echo field to simulator for string reload testing
jurgelenas Jun 17, 2026
398b789
show device name at top of root menu list
jurgelenas Jun 17, 2026
be235ed
fix repo url
jurgelenas Jun 24, 2026
3d2fb26
Add bind-phrase tool script
CapnBry Jun 27, 2026
8f1697b
Encapsulate history and defer
CapnBry Jun 27, 2026
f9056ab
Whitespace
CapnBry Jun 27, 2026
4689638
Add Bind command shortcut if RX not connected
CapnBry Jul 4, 2026
63a83e7
Include bindphrase textedit as disabled when RX is unreachable, do no…
CapnBry Jul 4, 2026
793e875
Include RX unbind button too why not
CapnBry Jul 4, 2026
23bd15e
support renamed Band/Enable field label in VTX Admin widget
jurgelenas Jul 5, 2026
ba04bb1
Rename to Bind Manager, scale for LCD size
CapnBry Jul 6, 2026
eb48f56
Rename history file as well
CapnBry Jul 6, 2026
b2940b1
Adjust formatting to make stylua stop emailing me
CapnBry Jul 7, 2026
9fbaf42
unify CRSF address constants: ADDRESS_HANDSET, ADDRESS_RX, ADDRESS_TX…
jurgelenas Jul 9, 2026
5caa3c6
require ExpressLRS v3.5.4 minimum
jurgelenas Jul 9, 2026
ff04b8c
Add X button to delete history items, fix a couple type errors
CapnBry Jul 25, 2026
9d9623a
Add Both option to set both the RX and TX at the same time
CapnBry Jul 25, 2026
4c5869f
Move elrs-bind into its own folder for future B&W UI flexibility
CapnBry Jul 25, 2026
187b162
Add support for direct UID input as comma-separated numbers
CapnBry Jul 27, 2026
fd2c6bb
Center history label since adding the delete shifted it to the edge
CapnBry Jul 27, 2026
ecc2052
Merge branch 'unified-lua-lsp' into bindphrase
CapnBry Aug 3, 2026
0e93851
stop polling ELRS status from the VTX Admin widget
jurgelenas Aug 9, 2026
e05809c
give VTX Admin one home for state checks and display strings
jurgelenas Aug 9, 2026
3bad52a
fix aux-switch pit mode always reading as off
jurgelenas Aug 9, 2026
9a0681a
hide VTX power and pit mode when no power level is set
jurgelenas Aug 9, 2026
538d984
rebuild the VTX Admin top bar as label over value
jurgelenas Aug 9, 2026
a15f1d9
show the 6POS cheatsheet as two rows
jurgelenas Aug 9, 2026
7229a5c
assert the 6POS position to the module on create
jurgelenas Aug 10, 2026
217238d
stop 6POS changes writing stale power and pit mode
jurgelenas Aug 10, 2026
38b2d70
show unused 6POS preset slots as "--"
jurgelenas Aug 10, 2026
749492e
stop an already-high Send VTx trigger firing when it is assigned
jurgelenas Aug 10, 2026
93b8ab5
say what Auto Push to VTX does
jurgelenas Aug 10, 2026
60f1d3f
stop tracking the VTX Admin presets file
jurgelenas Aug 10, 2026
e50a87c
Share one telemetry snapshot per tick in the ELRS Telemetry widget
jurgelenas Aug 10, 2026
4dc45f2
Gate model mismatch on link state, dedupe heroColor and rfModeText
jurgelenas Aug 10, 2026
fc33696
Make the per-screen font table the single source of truth for hero la…
jurgelenas Aug 10, 2026
8ecf2b3
Label the active antenna "Ant 1"/"Ant 2" instead of a bare 1/2
jurgelenas Aug 10, 2026
5366f72
Detect diversity from 2RSS instead of latching on the ANT sensor
jurgelenas Aug 10, 2026
2fa4b23
Correct the radio lists on the sd and sd_tall screen tiers
jurgelenas Aug 10, 2026
e4c2de6
Fold onElrsStatus's inline string parse into CRSF:fieldGetString
jurgelenas Aug 10, 2026
a2c8734
Drop init() and setMock once the ExpressLRS tool has started
jurgelenas Aug 10, 2026
3e09120
Restore parseParameterInfoMessage's comments and drop its unused return
jurgelenas Aug 10, 2026
da0bd27
Load the ELRS shim in CRSFSimulator so the mock works on B&W radios
jurgelenas Aug 10, 2026
425ed88
Share the ELRS CRSF library between the tool and the widgets
jurgelenas Aug 10, 2026
c17bdf3
Repaint the B&W page on the frame the load queue empties
jurgelenas Aug 11, 2026
96a1310
Drop the folder-ready check the LVGL UI can never reach
jurgelenas Aug 11, 2026
d4f0b09
Stop the widgets' unconditional CRSF polling
jurgelenas Aug 11, 2026
bdeea3d
Remove dead code across the tool, CRSF library and VTX widget
jurgelenas Aug 12, 2026
1d83d01
Split TX-module info out of the CRSF library into the telemetry widget
jurgelenas Aug 12, 2026
7ab758a
Decode ELRS frames in the CRSF library
jurgelenas Aug 12, 2026
a62d449
Serve the TX-module info state from the ELRS library
jurgelenas Aug 12, 2026
574931b
Document the ELRS library decoders and the elrsinfo module
jurgelenas Aug 12, 2026
12a4039
Teach the CRSF simulator firmware-faithful parameter chunking
jurgelenas Aug 12, 2026
59345f2
Extract the CRSF field codecs into the ELRS library
jurgelenas Aug 12, 2026
f04caf2
Move the field save and command writers into the ELRS library
jurgelenas Aug 12, 2026
c7331c9
Move chunk reassembly and the read request into the ELRS library
jurgelenas Aug 12, 2026
eaf8aff
Serve VTX Admin discovery from the shared field engine
jurgelenas Aug 12, 2026
6aea9ed
Name the ELRS library files after the protocol they speak
jurgelenas Aug 12, 2026
137e56c
Read the tool's link state off Protocol directly
jurgelenas Aug 12, 2026
381a8b0
Document the field engine boundaries
jurgelenas Aug 12, 2026
56e6cac
Merge branch 'crsf-fields' into unified-lua-lsp
jurgelenas Aug 12, 2026
612689d
Fix the B&W edit commit calling a deleted saver
jurgelenas Aug 12, 2026
1253c17
Decode link-layer strings without touching the frame
jurgelenas Aug 12, 2026
5152895
Split the parameter codec from transport as crsf_params
jurgelenas Aug 12, 2026
6af955a
Make the CRSF parameter session an explicit class
jurgelenas Aug 12, 2026
3bec451
Run VTX Admin on a CRSF parameter session
jurgelenas Aug 12, 2026
11b20df
Decompose the VTX Admin widget into components
jurgelenas Aug 12, 2026
77b9035
bump version to r3
jurgelenas Aug 12, 2026
9078c7a
Add 6POS preset collections to VTX Admin
jurgelenas Aug 13, 2026
b1c81d4
Fix out-of-memory on the tool's first launch on B&W radios
jurgelenas Aug 13, 2026
2a6de92
Fix the B&W title warning lagging its status answer
jurgelenas Aug 13, 2026
151b4ee
Merge branch 'unified-lua-lsp' into bindphrase
jurgelenas Aug 13, 2026
5113ab2
Add the MSP and command frame types to the CRSF transport
jurgelenas Aug 13, 2026
d840373
Split the bind tool's MSP framing into a shared msp codec
jurgelenas Aug 13, 2026
cad9c0e
Add the bind tool's defer timer to the shared library
jurgelenas Aug 13, 2026
83b8774
Route FileStorage concatenation through the B&W shim
jurgelenas Aug 13, 2026
cf98356
Teach the CRSF simulator the ELRS bind MSP traffic
jurgelenas Aug 13, 2026
0d1450b
Rearchitect the bind tool as ExpressLRSBind on the shared codec
jurgelenas Aug 13, 2026
7c7a60a
Replicate the firmware's B&W name editor as a shared component
jurgelenas Aug 14, 2026
e5c79c9
Add a B&W interface to the bind tool
jurgelenas Aug 14, 2026
3c52fa5
Document the bind tool and its MSP modules
jurgelenas Aug 14, 2026
efdffdc
Extract the tools' script loader into the ELRS library
jurgelenas Aug 14, 2026
a7993bb
Move the EdgeTX version gate into the shared library
jurgelenas Aug 14, 2026
9e8b802
Share the B&W alert screen between the tools
jurgelenas Aug 14, 2026
d6ee850
Share the LVGL startup dialogs between the tools
jurgelenas Aug 14, 2026
1e44cae
Match the firmware's receiver antenna parameter naming
jurgelenas Aug 14, 2026
e7b1680
Rework the bind tool around the transmitter's identity
jurgelenas Aug 14, 2026
f295d03
Merge branch 'bindphrase' into unified-lua-lsp
jurgelenas Aug 14, 2026
129c6f4
Revert "Rework the bind tool around the transmitter's identity"
jurgelenas Aug 14, 2026
0838825
Merge branch 'bindphrase' into unified-lua-lsp
jurgelenas Aug 14, 2026
5f6a015
Keep asking for model match while the mismatch stands
jurgelenas Aug 16, 2026
e277f64
Fold the shared elrsinfo module into the telemetry widget
jurgelenas Aug 16, 2026
04e0ae1
Give the CRSF simulator a GPS fix
jurgelenas Aug 16, 2026
cf9106b
Split the RF mode tables out of the telemetry module
jurgelenas Aug 16, 2026
c821c48
Give the telemetry widget's state and read model an owner each
jurgelenas Aug 16, 2026
4d1b624
Extract the telemetry full-screen page
jurgelenas Aug 16, 2026
7681746
Load the VTX Admin full-screen page on first entry
jurgelenas Aug 16, 2026
fc5e470
Drop the full-screen Power Index row
jurgelenas Aug 16, 2026
d122d62
Scope the cached telemetry sensor IDs to the model
jurgelenas Aug 16, 2026
36dc7a7
Settle the per-screen layout drift
jurgelenas Aug 16, 2026
62979c2
Document the widget components
jurgelenas Aug 16, 2026
151ad78
Report an unrated packet rate as having no sensitivity floor
jurgelenas Aug 16, 2026
f7c4ada
Measure the link by its headroom instead of its range
jurgelenas Aug 16, 2026
8970df5
Mock the downlink pair and a rate with no rated floor
jurgelenas Aug 16, 2026
61e9c70
Draw the 1/1 tier instead of listing it
jurgelenas Aug 16, 2026
8442738
Take the health colours from the theme, and draw the 1/2 tier
jurgelenas Aug 16, 2026
18fdd76
Keep dBm on the downlink RSSI at every width
jurgelenas Aug 17, 2026
ee99d22
Paint the power meter and antenna cells in the theme accent
jurgelenas Aug 17, 2026
4e47f52
Tighten the strip: smaller LED, inset panel, power above the uplink
jurgelenas Aug 17, 2026
5fa30b1
update
jurgelenas Aug 17, 2026
d598738
update simulator default vtx admin power level
jurgelenas Aug 17, 2026
9f601cb
improve the layouts
jurgelenas Aug 17, 2026
a1a4927
add name to telemetry widget
jurgelenas Aug 17, 2026
ca943f4
fix mismatch
jurgelenas Aug 17, 2026
cc44988
update layouts
jurgelenas Aug 17, 2026
aa77b7d
update screenshots
jurgelenas Aug 17, 2026
20292d4
Merge branch 'new-telemetry-widget-ui' into unified-lua-lsp
jurgelenas Aug 17, 2026
789d2cd
update styling
jurgelenas Aug 17, 2026
c7f0abd
update design
jurgelenas Aug 17, 2026
24bc07f
experiment
jurgelenas Aug 17, 2026
d84d061
redo widgets ui
jurgelenas Aug 18, 2026
c217292
Merge branch 'design-changes' into unified-lua-lsp
jurgelenas Aug 18, 2026
0156e7d
update rssi, update flysky compatiblity
jurgelenas Aug 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

[*.lua]
indent_style = space
indent_size = 2
max_line_length = 120

[Makefile]
indent_style = tab

[*.{yml,yaml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:

jobs:
check:
name: Lint and Typecheck
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
submodules: true

- name: Cache cargo
uses: actions/cache@v5
with:
path: ~/.cargo
key: cargo-stylua-${{ runner.os }}

- name: Install tools
run: make install-tools

- name: Run checks
run: make check
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.luac
src/WIDGETS/ELRSVTXAdmin/presets.txt
src/SCRIPTS/TOOLS/ExpressLRSBind/history.txt
bin/
.claude/plans/
TODO.md
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "edgetx-lua-stdlib"]
path = edgetx-lua-stdlib
url = https://github.com/jurgelenas/edgetx-lua-stdlib.git
branch = edgetx-2.12
16 changes: 16 additions & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"runtime.version": "Lua 5.3",
"runtime.builtin": {
"os": "disable",
"debug": "disable",
"package": "disable",
"coroutine": "disable",
"utf8": "disable",
"io": "disable",
"bit32": "disable"
},
"workspace.library": ["edgetx-lua-stdlib"],
"workspace.ignoreDir": ["bin", "edgetx-lua-stdlib"],
"workspace.checkThirdParty": false,
"diagnostics.disable": ["lowercase-global"]
}
7 changes: 7 additions & 0 deletions .stylua.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
column_width = 120
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferDouble"
call_parentheses = "Always"
collapse_simple_statement = "Never"
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
SRC_DIR := src

LUALS_VERSION := 3.17.1
LUALS_DIR := bin/lua-language-server
LUALS := $(LUALS_DIR)/bin/lua-language-server
LUALS_URL := https://github.com/LuaLS/lua-language-server/releases/download/$(LUALS_VERSION)/lua-language-server-$(LUALS_VERSION)-linux-x64.tar.gz

.PHONY: help install-tools install-stylua install-luals format format-check typecheck check sync push

help:
@echo "Usage: make <target>"
@echo ""
@echo " install-tools Install stylua and lua-language-server"
@echo " install-stylua Install stylua (via cargo)"
@echo " install-luals Install lua-language-server"
@echo " format Format Lua files with stylua"
@echo " format-check Check formatting without modifying files"
@echo " typecheck Run lua-language-server type checking"
@echo " check Run format-check and typecheck"
@echo " sync Sync source files to EdgeTX simulator SD card"
@echo " push Install package to EdgeTX radio and eject"

install-stylua:
@command -v cargo >/dev/null 2>&1 || { echo "cargo is required (install Rust: https://rustup.rs)"; exit 1; }
cargo install stylua --features lua53

install-luals:
mkdir -p $(LUALS_DIR)
curl -fSL $(LUALS_URL) | tar xz -C $(LUALS_DIR)

install-tools: install-stylua install-luals

format:
stylua $(SRC_DIR)

format-check:
stylua --check $(SRC_DIR)

typecheck:
$(LUALS) --check .

check: format-check typecheck

sync:
edgetx-cli dev sync ../edgetx-sdcard

push:
edgetx-cli pkg install . --eject
138 changes: 130 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,135 @@
# ExpressLRS Lua Scripts

`elrs.lua` works with all versions of ExpressLRS from v2.0 to current. There is no requirement to use an e.g. elrsV3.lua for 3.x, just use elrs.lua.
Lua configuration tool and bind phrase manager for ExpressLRS on EdgeTX radios. Both work on black & white LCD and color LCD radios.

## Old ELRS.lua
The package also includes two color-LCD widgets: the **ELRS Telemetry Widget** and the **VTX Administrator Widget**.

When copying the lua to you handset, delete any old versions such as ELRS.lua, elrsV2.lua, or elrsV3.lua. The version-labeled filenames have been obsoleted.
## Features

### Downloading from Github:
Click the file link above, find the "Raw" button near the top of that page. Right-click, Save link as.., copy the .lua file into the /SCRIPTS/TOOLS directory of the SD card on your handset.
- Configure packet rate, telemetry ratio, switch mode, model match, antenna mode, TX power, WiFi connectivity, and more
- Compatible with **ExpressLRS v3.5.4+**

### Downloading from Configurator:
Use the button shown in the image below to download the .lua script into the /SCRIPTS/TOOLS directory of the SD card on your handset.
![downloadlua](https://user-images.githubusercontent.com/68074253/129203116-c1234719-3e8c-4cbf-a391-b7fb8dc0262d.png)
## Installation

Copy the contents of the `src/` directory to the **root** of your radio's SD card, preserving the directory structure. Delete any old ELRS scripts (`ELRS.lua`, `elrsV2.lua`, `elrsV3.lua`, `expresslrs.lua` and their `.luac` counterparts) from `SCRIPTS/TOOLS/`.

When done, your SD card should contain:

```
SCRIPTS/
ELRS/
crsf.lua -- shared CRSF protocol library
crsf_params.lua -- parameter codec (tool, VTX Admin)
crsf_session.lua -- stateful parameter client (tool, VTX Admin)
msp.lua -- MSP-over-CRSF codec (bind tool)
defer.lua -- deferred-callback timer (bind tool)
loader.lua -- GC-guarded script loader (both tools)
edgetx_version.lua -- EdgeTX minimum-version gate (both tools)
ui/
lcd/
text_edit.lua -- BW text editor (bind tool)
alert.lua -- BW alert screen (both tools)
lvgl/
dialogs.lua -- color startup dialogs (both tools)
sensors.lua -- telemetry sensor reader
file_storage.lua -- key=value file persistence
shim.lua -- BW compatibility shim
TOOLS/
ExpressLRS/
main.lua -- entry point
navigation.lua -- folder navigation
ui/
lvgl.lua -- color LCD UI (LVGL)
lcd.lua -- black & white LCD UI
ExpressLRSBind/
main.lua -- entry point
history_storage.lua -- bind phrase history persistence
ui/
lvgl.lua -- color LCD UI (LVGL)
lcd.lua -- black & white LCD UI
WIDGETS/
ELRSTelemetry/
main.lua -- entry point
telemetry.lua -- link state: drain, device info, model match, sensor snapshot
rf_modes.lua -- RF mode names and RSSI floors, by firmware version
loadable.lua -- per-instance wiring and lifecycle
ui/
display.lua -- read model shared by every layout below
fullscreen.lua -- full-screen page
topbar.lua -- top-bar layout
sd.lua sd_tall.lua hd.lua portrait.lua small.lua
ELRSVTXAdmin/
main.lua -- entry point
loadable.lua -- VTX config client and wiring
presets_storage.lua -- preset slot persistence
presets.txt
ui/
display.lua -- read model shared by every layout below
fullscreen.lua -- full-screen editor
topbar.lua -- top-bar layout
sd.lua sd_tall.lua hd.lua portrait.lua small.lua
```

The shared library `SCRIPTS/ELRS/` is required by both tools and both widgets.

### Install with edgetx-cli

You can also install this package using [edgetx-cli](https://github.com/jurgelenas/edgetx-cli):

```sh
edgetx-cli pkg install ExpressLRS/Lua-Scripts
```

Use the `--eject` flag to automatically unmount the SD card after installation.

## ExpressLRS Configuration Tool

The main tool (`SCRIPTS/TOOLS/ExpressLRS/`) lets you configure your ExpressLRS transmitter and receiver settings directly from your radio.

<img src="screenshots/tool_main_bw.png" width="256" alt="ExpressLRS Configuration Tool"><br/>

<img src="screenshots/tool_main.png" width="472" alt="ExpressLRS Configuration Tool">

## ExpressLRS Bind Phrase Manager

The bind tool (`SCRIPTS/TOOLS/ExpressLRSBind/`) sets the bind phrase -- or a raw UID entered as
comma-separated bytes -- on the transmitter, the receiver, or both in one sequence, reads the
current UID back for verification, and can put the TX in bind mode or unbind a connected receiver.
The last five phrases are kept as a pick-and-send history. Setting the phrase over MSP requires
**ExpressLRS 4.1+** on the device.

<img src="screenshots/tool_bind_bw.png" width="256" alt="ExpressLRS Bind Phrase Manager"><br/>

<img src="screenshots/tool_bind.png" width="472" alt="ExpressLRS Bind Phrase Manager">

## Widgets

Both widgets running side-by-side on the home screen:

<img src="screenshots/widgets.png" width="472" alt="ELRS Widgets">

## ELRS Telemetry Widget

The telemetry widget (`WIDGETS/ELRSTelemetry/`) displays real-time link statistics on your home screen: link quality, RSSI, range, RF mode, TX power, battery voltage, current, GPS, and flight mode. It supports multiple screen resolutions (800x480, 480x320, 480x272, 320x480, 320x240).

<img src="screenshots/widget_telemetry_fullscren.png" width="472" alt="ELRS Telemetry Widget">

## VTX Administrator Widget

The VTX Administrator widget (`WIDGETS/ELRSVTXAdmin/`) provides control over your video transmitter settings -- band, channel, power level, and pit mode -- directly from your radio telemetry screen. It also supports 6POS quick change for rapid VTX channel switching via a 6POS switch. Presets are organised into six collections selected in the widget's editor, so your home field and a race event can each keep their own set of channels.

<img src="screenshots/widget_vtxadmin_fullscreen.png" width="472" alt="VTX Administrator Widget">

## Development

See [docs/development.md](docs/development.md) for the tool's internal architecture and the CRSF simulator used for testing inside the EdgeTX simulator.

## Compatibility

| Radio type | Firmware | ExpressLRS |
|------------|----------|------------|
| Black & white LCD | EdgeTX 2.11.6+, 2.12.1+, or 3.0+ | v3.5.4+ |
| Color LCD | EdgeTX 2.11.6+, 2.12.1+, or 3.0+ | v3.5.4+ |

The bind phrase manager additionally requires **ExpressLRS 4.1+** on the device for its MSP
configuration support; on older firmware it reports "No response (needs ELRS 4.1+)".
Loading