Repository navigation
Add VTX Admin telemetry script for B&W radios - #41
jurgelenas wants to merge 2 commits into
Conversation
ELRVTX shows the VTX tuning, power and the six 6POS presets on a 128x64 dashboard; ENTER opens a menu with the colour widget's settings (VTX fields, Send VTx, 6POS quick change, presets). The VTX Admin core moves to SCRIPTS/ELRS/vtx/ so the widget and the telemetry script share it, along with the presets, now stored in SCRIPTS/ELRS/vtx/presets.txt. The core ticks from background() so the 6POS automation runs whatever page is shown. To fit B&W memory the menu is table-driven, dialogs load only when needed, and the session drops discovery fields it no longer needs. The loader reports why a script failed to load.
CapnBry
left a comment
There was a problem hiding this comment.
Man this is amazing. Works perfectly as far as the functionality goes, just a couple notes.
Channel 0
If I booth with VTXAdmin off, launch the admin script, go into menu, shows channel 0. If I set the band, the channel stays 0 but the main screen and the top right show the correct channel, not 0. Same happens if I have VTX admin on and set the band to off then leave the menu and come back the channel displays 0. Maybe the channel and power should be hidden line power hides the pit mode item if the VTX Admin is off?
Also should this follow the same naming as the lua has with Band/Enable or whatever it says?
See other requested changes in comments
| end | ||
|
|
||
| --- The VTX's tuning, not the switch: they differ after boot. Switch breaks ties. | ||
| local function activePreset() |
There was a problem hiding this comment.
This function seems to be the same as the inline one in the widget's display.lua, broke into matchesVtx(), activeIdx(). Can we move that into a VTXAdmin.activePreset(), or am I missing something in this code here that behaves differently?
| - name: ELRS | ||
| path: SCRIPTS/ELRS | ||
| exclude: | ||
| - presets.txt |
There was a problem hiding this comment.
I don't know how this yaml works but does the exclude need the path or does it match any filename? The file is now in vtx/presets.txt
| kept[id] = self._fields[id] | ||
| end | ||
| self._fields = kept | ||
| end |
There was a problem hiding this comment.
I'm not sure where to tag this but:
- At the end of loading the admin.onField() runs and deletes all the fields that loaded into its storage except the VTX ones via this retainFields()
- However, once the VTXAdmin goes into passive mode and the user launches the tool script, _onEntry still fires and because it has _acceptUnsolicited set, it parses the field and adds it back into VTXAdmins fields list again. All the fields get added back to the _fields list so the retainFields only worked on the initial load.
I think the way to solve this is to set a flag in self._retainedOnly = true in retainFields(), then have _acceptUnsolicited check and only parse fields which are in _fields already if _retainedOnly is true. You'd also need to set _retainedOnly back to nil on reloadAll().
| end | ||
| end | ||
| return best | ||
| end |
There was a problem hiding this comment.
Minor: Once a source moves, it can't be un-set without being returned to its original position. The encoder wheel stops working and you have to exit the field edit to be able to change it again.
Steps:
- Enter the 6POS Quick Change submenu on B&W radio.
- Lower throttle.
- Select Source so it is in edit mode.
- Raise the throttle. The source correctly becomes Thr. Leave the throttle high.
- Try to use the encoder to change the item value, you can't because every update it jumps back to Thr
Maybe to fix this you'd change movedSource so when it returns best it updates srcStart for that item? That's how EdgeTx does it I believe. This one isn't a huge deal so if you find that it isn't so simple to fix then I'd not worry about it.



No description provided.