Skip to content

[RELAY-ONLY FEATURE] Add a TX module button action to toggle between two models #3108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wvarty
Copy link
Collaborator

@wvarty wvarty commented Jan 19, 2025

This is a new feature to help users that want to use a relay setup with ELRS, for example, if you want to mount you TX module on a tripod or mast, or outside the car (for cold / hot weather) etc:
E.g. something like this:
Screenshot_5

One of the challenges with using a relay setup is that changing the relay TX's power output and packet rate is very difficult. This is because the relay TX cannot be accessed via the LUA (you can only see the settings for the handset TX).

This is particularly frustrating if you are using the new LR1121 hardware, for example the RM Nomad, and you'd like to use K1000 for the nice fast data rate during MAVLink param download (i.e. after you first power up), but then you want to switch to 200hz-full right before you fly, for the long range LoRa advantages (at a slower data rate). Without access to the relay TX's LUA, this is impossible.

This feature adds a new button action that can be assigned to the buttons on a TX module which allows you to toggle between model 0 and model 1.

Screenshot_4

The idea is:

  1. You plug the relay TX into a handset for one-time setup
  2. You activate model 0 in ETX
  3. You jump into the LUA and setup the RF settings you want when you power up (i.e. K1000, F1000, on 10mW etc.)
  4. You change to model 1 in ETX
  5. You setup the RF settings you want for flight (i.e. 200hz-full on 1W etc.)
  6. You mount your relay TX on the tripod / wherever, and when you power up, you will be in model 0
  7. You download params, the mission, etc.
  8. When you are ready to launch, you hold the button on the relay TX to toggle to model 1, and now you're in your desired RF params for flight.

Quick demo video of the model toggling:
https://github.com/user-attachments/assets/b54caf56-67d6-47da-8009-c92e82031ad7

@@ -1020,6 +1020,7 @@ function appendRow(b,p,v) {
<option value='5' ${v['action']===5 ? 'selected' : ''}>Start WiFi</option>
<option value='6' ${v['action']===6 ? 'selected' : ''}>Enter Binding Mode</option>
<option value='7' ${v['action']===7 ? 'selected' : ''}>Start BLE Joystick</option>
<option value='9' ${v['action']===9 ? 'selected' : ''}>Toggle Selected Model</option>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest Toggle between Model 0 and 1 here to make it even more intuitive for the user what the button does.

@wvarty wvarty requested a review from Copilot May 17, 2025 05:24
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new TX module button action to toggle between two models, enabling users to quickly switch radio parameters in a relay setup. Key changes include renaming and overloading the model update functions, adding a new toggle function, and updating both configuration and UI elements to support the new action.

  • Updated tx_main.cpp to use an explicit model ID for toggling
  • Extended the configuration API with a new getter for model ID
  • Updated the common action enum and the UI select options in scan.js

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/src/tx_main.cpp Renamed the model update function and added a ToggleModelID function to support toggling.
src/lib/CONFIG/config.h Added a getter for the current model ID.
src/include/common.h Extended enum for button actions with a new toggle action.
src/html/scan.js Updated the UI to include a new select option for the toggle action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants