New LUA scripts & widgets - #3
jurgelenas wants to merge 261 commits into
Conversation
…ns for mk3 and 1 column for small screen radios
…ol script is open
…ol script is open
At 400K baud the module splits a command answer into 27-byte chunks and serves the continuation only on CMD_QUERY. The session hurried the read deadline instead of the query one, so every extra chunk waited for the 2 s keep-alive: a confirm dialog took 2 s to appear, and again after Confirm. Query the next chunk on the next tick, as the legacy script did. Route every command step through one send path that retries a push the radio's single output slot refused and resets chunk state only after a successful send, so a one-chunk idle answer after a chunked executing one is no longer swallowed and Bind dismisses on its own. The click guard keys on the live popup, not on the field's stale status. Both UIs show "Sending..." while a click or confirm is unanswered, after a 200 ms grace so healthy links go straight to the dialog. The B&W popup repaints the page after a cancel. The simulator now chunks command answers and serves continuation chunks only on CMD_QUERY like the firmware, with the firmware's 2 s timeout; maxPacketBytes = 35 reproduces the 400K/500 Hz case.
|
Whew. A lot to get through but almost all these are small tweaks. I really like the visual redo you did on the VTX Admin, it looks great and the widget is a lot easier to glance at now. This took the better part of 2 days to get through all the code again with so many different scripts on so many platforms, but here's the abridged review notes!
AIness
ELRS Version requirementWe know what the ELRS version is from the deviceinfo header, and we know what version the script requires, but these scripts just sort of fail to work properly if the ELRS version isn't high enough. It could display a message about it. *** DO NOT MAKE THAT CHANGE, I DO NOT WANT TO REVIEW NEW FEATURE CODE AGAIN *** this could be done in a separate PR if you want. Somebody should though. |
After a value write the session re-read the parent folder and its value and INFO siblings but skipped COMMAND fields, so a command the firmware hides or shows in response kept its stale visibility until a full reload. Legacy elrs.lua made the same change in cc2e010; the firmware keeps Send VTx always visible because scripts did not re-read commands. The simulator now applies the firmware's VTX Admin visibility rules: Channel, Pwr Lvl and Pitmode hide while Band/Enable is Disabled, and Pitmode hides at Pwr Lvl "-". Send VTx hides with Band/Enable too, which exercises the command re-read.
The module reboots after a phrase write, and 6 attempts (3 s) ran out before it came back, leaving "No response" on screen. 12 attempts give it 6 s.
Re-read sibling crsf command fields after a value write
Retain legacy elrs.lua for old radios support
killEvents() refuses to mask KEY_ENTER for Lua scripts (api_general.cpp:1699), so a long ENTER is always followed by a break when the key is released. The editor acted on EVT_VIRTUAL_ENTER_LONG and that break then leaked: a long press on a space committed and the break reached the caller's row handler, which reopened the editor, and a case toggle also advanced the cursor. Record the long press instead and run its action on the following break, which consumes it. Case toggling moves into _toggleCase().
…to single row and add RSNR when in non FLRC mdoe addresses > Telem Widget - PWR reads 0 mW when not connected but others show -- > Telem Widget - No last GPS position on disconnect? If not in your design plans that's fine, something for later. > Telem Widget - Fullscreen - Maybe merge RSSI 1 / RSSI 2 onto one line so the RSNR can be added?
Addressed in #23
I was hoping for EdgeTX team to release official EdgeTX Lua typedefs based on my https://github.com/jurgelenas/edgetx-lua-stdlib idea. Unfortunately the progress has stalled. Will remove it later.
Addressed in #25
Addressed in #26
I think I had more reasons for it, but the only thing that I can remember now is that we are using directories for tool scripts.
Addressed in #27
Addressed in #28
Good idea. I have updated telemetry widget top bar layout too. Addressed in #29
Addressed in #30
Addressed in #31
Could not reproduce this one. Could you share a screenshot? What EdgetTX version you were using? |
Align telemetry widget grid values per column
Vtx admin top bar updates
Add PREV_PAGE/NEXT_PAGE cursor nagivation to BW text fields
Title the bind tool "ExpressLRS Bind" and show its version like the main tool
Raise the Bind tool's UID read retries to 12

No description provided.