Skip to content

Conversation

@MrD-RC
Copy link
Member

@MrD-RC MrD-RC commented Oct 19, 2025

User description

IMHO, this option has been missing for a long time. This allows pilots to quickly set the telemetry sensors used by both the OpenTX telemetry widget and ETHOS telemetry dashboard.

Changes:

  • Option to switch from raw accelerometer sensors to pitch and roll sensors
  • Option to select which units are used for fuel
  • Options are only shown when a FrSky RX is used
  • I have added translations for Chinese, Japanese, and Ukrainian. But would appreciate those translations being checked by people who know the languages.
image

PR Type

Enhancement


Description

  • Add FrSky SmartPort telemetry configuration options to receiver page

  • Allow switching between raw accelerometer and pitch/roll sensors

  • Enable selection of fuel telemetry sensor units

  • Conditionally display FrSky options based on receiver type

  • Add translations for English, Japanese, Ukrainian, and Chinese


Diagram Walkthrough

flowchart LR
  A["Receiver Page"] --> B["Serial RX Provider Dropdown"]
  B --> C{"Is FrSky Provider?"}
  C -->|Yes| D["Show FrSky Options"]
  C -->|No| E["Hide FrSky Options"]
  D --> F["Pitch/Roll Sensor Toggle"]
  D --> G["Fuel Unit Selector"]
  F --> H["Telemetry Configuration"]
  G --> H
Loading

File Walkthrough

Relevant files
Enhancement
receiver.js
Add FrSky options visibility toggle logic                               

tabs/receiver.js

  • Add change event listener to serialrx_provider dropdown
  • Show/hide FrSky options section based on selected receiver provider
  • Check if selected provider is one of FrSky types (SBUS, FPORT, FPORT2,
    FBUS)
  • Trigger change event on page load to set initial visibility state
+16/-2   
receiver.html
Add FrSky telemetry configuration UI elements                       

tabs/receiver.html

  • Add new frSkyOptions section with checkbox for pitch/roll sensor
    selection
  • Add dropdown select for SmartPort fuel unit configuration
  • Include help icons with tooltips for both new options
  • Structure matches existing configuration UI patterns
+20/-1   
Documentation
messages.json
Add English translations for FrSky options                             

locale/en/messages.json

  • Add serialrx_frSkyPitchRollLabel message for pitch/roll checkbox label
  • Add serialrx_frSkyPitchRollHelp message explaining sensor behavior
  • Add serialrx_frSkyFuelUnitLabel message for fuel unit dropdown label
  • Add serialrx_frSkyFuelUnitHelp message explaining fuel sensor
    selection
  • Add configurationFrSkyRXHelp message for section title
+15/-0   
messages.json
Add Japanese translations for FrSky options                           

locale/ja/messages.json

  • Add Japanese translations for pitch/roll sensor label and help text
  • Add Japanese translations for fuel unit label and help text
  • Add Japanese translation for FrSky options section title
+15/-0   
messages.json
Add Ukrainian translations for FrSky options                         

locale/uk/messages.json

  • Add Ukrainian translations for pitch/roll sensor label and help text
  • Add Ukrainian translations for fuel unit label and help text
  • Add Ukrainian translation for FrSky options section title
+15/-0   
messages.json
Add Simplified Chinese translations for FrSky options       

locale/zh_CN/messages.json

  • Add Simplified Chinese translations for pitch/roll sensor label and
    help text
  • Add Simplified Chinese translations for fuel unit label and help text
  • Add Simplified Chinese translation for FrSky options section title
+15/-0   

IMHO, this option has been missing for a long time. This allows pilots to quickly set the telemetry sensors used by both the OpenTX telemetry widget and ETHOS telemetry dashboard.

Changes:
- Option to switch from raw accelerometer sensors to pitch and roll sensors
- Option to select which units are used for fuel
- Options are only shown when a FrSky RX is used
- I have added translations for Chinese, Japanese, and Ukrainian. But would appreciate those translations being checked by people who know the languages.
@MrD-RC MrD-RC added this to the 9.0 milestone Oct 19, 2025
@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Oct 19, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
Locale-dependent logic

Description: Locale-dependent provider detection uses the option's displayed text to gate feature
visibility, which can be bypassed or fail under localization; rely on stable IDs/values
instead of user-facing text.
receiver.js [75-81]

Referred Code
const frSkyRXProviders = ["SBUS", "FPORT", "FPORT2", "FBUS"];

if (frSkyRXProviders.includes($(this).find("option:selected").text())) {
    $("#frSkyOptions").show();
} else {
    $("#frSkyOptions").hide();
}
Ticket Compliance
🎫 No ticket provided
- [ ] Create ticket/issue <!-- /create_ticket --create_ticket=true -->

</details></td></tr>
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
No custom compliance provided

Follow the guide to enable custom compliance check.

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Oct 19, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Tie UI visibility to telemetry configuration

The FrSky-specific UI options should be displayed based on whether FrSky
SmartPort telemetry is enabled, rather than being tied to the receiver protocol.
This change prevents showing irrelevant options for generic protocols like SBUS.

Examples:

tabs/receiver.js [74-82]
        $serialRxProvider.on('change', function() {
            const frSkyRXProviders = ["SBUS", "FPORT", "FPORT2", "FBUS"];
            
            if (frSkyRXProviders.includes($(this).find("option:selected").text())) {
                $("#frSkyOptions").show();
            } else {
                $("#frSkyOptions").hide();
            }
        });

Solution Walkthrough:

Before:

// tabs/receiver.js
$serialRxProvider.on('change', function() {
    const frSkyRXProviders = ["SBUS", "FPORT", "FPORT2", "FBUS"];
    
    if (frSkyRXProviders.includes($(this).find("option:selected").text())) {
        $("#frSkyOptions").show();
    } else {
        $("#frSkyOptions").hide();
    }
});

$serialRxProvider.trigger("change");

After:

// tabs/receiver.js
function updateFrSkyOptionsVisibility() {
    // This is a hypothetical check, as the telemetry setting is not in the diff.
    // It would read the telemetry provider setting from the global configuration.
    const isSmartPortTelemetryEnabled = (CONFIG.telemetry_provider == 'SMARTPORT');

    if (isSmartPortTelemetryEnabled) {
        $("#frSkyOptions").show();
    } else {
        $("#frSkyOptions").hide();
    }
}

// This function should be called when the page loads, and whenever
// the telemetry configuration changes.
updateFrSkyOptionsVisibility();
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a design flaw where UI options are shown based on a receiver protocol (SBUS) that doesn't guarantee the use of the relevant telemetry system, which could confuse users.

Medium
Possible issue
Hide FrSky options for non-serial receivers
Suggestion Impact:The commit added $("#frSkyOptions").hide(); in the non-SERIAL branch of the receiver mode change handler, implementing the suggested fix.

code diff:

                 $serialWrapper.hide();
+                $("#frSkyOptions").hide();

Hide the #frSkyOptions section when the receiver mode is changed to a non-SERIAL
type to prevent it from being displayed incorrectly.

tabs/receiver.js [86-93]

 $receiverMode.on('change', function () {
     if ($(this).find("option:selected").text() == "SERIAL") {
         $serialWrapper.show();
     } else {
         $serialWrapper.hide();
+        $("#frSkyOptions").hide();
     }
 });

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies a UI logic bug where the frSkyOptions section remains visible after switching from a SERIAL receiver to a non-serial one, and provides the correct fix.

Medium
Fix incorrect help icon association
Suggestion Impact:The commit updates the div's for attribute to frSkyFuelUnit exactly as suggested, fixing the incorrect association.

code diff:

-                        <div for="frSkyPitchRoll" class="helpicon cf_tip" data-i18n_title="serialrx_frSkyFuelUnitHelp"></div>
+                        <div for="frSkyFuelUnit" class="helpicon cf_tip" data-i18n_title="serialrx_frSkyFuelUnitHelp"></div>

Update the for attribute on the help icon div for the fuel unit dropdown from
frSkyPitchRoll to frSkyFuelUnit to correctly associate it.

tabs/receiver.html [87]

-<div for="frSkyPitchRoll" class="helpicon cf_tip" data-i18n_title="serialrx_frSkyFuelUnitHelp"></div>
+<div for="frSkyFuelUnit" class="helpicon cf_tip" data-i18n_title="serialrx_frSkyFuelUnitHelp"></div>

[Suggestion processed]

Suggestion importance[1-10]: 5

__

Why: The suggestion correctly identifies a copy-paste error in the for attribute of a help icon div, which should be associated with frSkyFuelUnit instead of frSkyPitchRoll.

Low
  • Update

@MrD-RC
Copy link
Member Author

MrD-RC commented Oct 19, 2025

  • Tie UI visibility to telemetry configuration I believe it is safer to leave it attached to the Serial RX provider. 3 of the 4 protocols have SmartPort built in to them. So do not need SmartPort to be set up as a separate telemetry port. The only one that does use SmartPort on a separate UART is SBUS. Which is the oldest and least likely to be used protocol.
  • Hide FrSky options for non-serial receivers This is a good suggestion. I have implemented it. I also added code to show the FrSky options again, if a FrSky receiver is selected after switching back to a serial receiver.
  • Fix incorrect help icon association Done

- Added help note to assist people using SBUS in the case of seeing no telemetry
- Corrected an error in the help icons on the OSD page
@MrD-RC
Copy link
Member Author

MrD-RC commented Oct 19, 2025

I have added a compromise for the Tie UI visibility to telemetry configuration suggestion. I still believe that the current implementation is the right way to go. But I have added a help icon which contains some details for people using SBUS, and how they need to set up SmartPort if the telemetry is not working.

@MrD-RC
Copy link
Member Author

MrD-RC commented Oct 19, 2025

I'm happy for this to be merged. Of course, peer review is welcomed. Also from anyone who speaks Chinese, Japanese, or Ukrainian.

@MrD-RC MrD-RC merged commit c0966bd into master Oct 26, 2025
11 of 12 checks passed
@MrD-RC MrD-RC deleted the MrD_Allow-telemetry-selection-for-LUA-from-receiver-page branch October 26, 2025 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants