Skip to content

Implement setting TX_GAIN_LORA for portduino#8501

Merged
thebentern merged 6 commits intomeshtastic:developfrom
Stary2001:portduino-tx-gain
Jan 22, 2026
Merged

Implement setting TX_GAIN_LORA for portduino#8501
thebentern merged 6 commits intomeshtastic:developfrom
Stary2001:portduino-tx-gain

Conversation

@Stary2001
Copy link
Member

I've implemented support for TX_GAIN_LORA in the portduino yaml config. Also refactors the code a little bit to support choosing linear/nonlinear gain at runtime for this.
Tested with this config:

Lora:
 Module: sx1262
 DIO2_AS_RF_SWITCH: true
 DIO3_TCXO_VOLTAGE: true
 CS: 8
 IRQ: 27
 Busy: 22
 Reset: 23
 TX_GAIN_LORA: 20
 SX1262_MAX_POWER: 12

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • native
    • T1000E

@Stary2001 Stary2001 added enhancement New feature or request linux-native related to running meshtastic as daemon on native linux labels Oct 31, 2025
Copy link
Contributor

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 pull request implements support for configuring TX_GAIN_LORA values through the portduino YAML configuration file, adding the ability to specify either a single gain value or an array of values for nonlinear power amplifiers. The implementation refactors the existing compile-time TX_GAIN_LORA handling to support runtime configuration on portduino platforms.

Key Changes:

  • Added num_pa_points and tx_gain_lora[] array to portduino configuration structure
  • Unified linear and nonlinear gain handling in RadioInterface to work with both compile-time (non-portduino) and runtime (portduino) configurations
  • Added YAML parsing and serialization for the new TX_GAIN_LORA configuration field

Reviewed Changes

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

File Description
src/platform/portduino/PortduinoGlue.h Added struct members for storing TX_GAIN_LORA values and YAML serialization logic
src/platform/portduino/PortduinoGlue.cpp Implemented YAML parsing for TX_GAIN_LORA configuration (single value or array)
src/mesh/RadioInterface.cpp Refactored power limiting logic to support both compile-time and runtime TX_GAIN_LORA values
src/configuration.h Added default NUM_PA_POINTS definition

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions bot added the Stale Issues that will be closed if not triaged. label Jan 4, 2026
@github-actions github-actions bot closed this Jan 16, 2026
@Stary2001 Stary2001 reopened this Jan 16, 2026
@github-actions github-actions bot removed the Stale Issues that will be closed if not triaged. label Jan 20, 2026
@thebentern thebentern merged commit d8d02cd into meshtastic:develop Jan 22, 2026
17 of 18 checks passed
Prondtoo pushed a commit to Prondtoo/meshtastic_fw that referenced this pull request Jan 30, 2026
* Implement setting TX_GAIN_LORA for portduino

* use std::size instead of sizeof

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Prondtoo pushed a commit to Prondtoo/meshtastic_fw that referenced this pull request Jan 30, 2026
* Implement setting TX_GAIN_LORA for portduino

* use std::size instead of sizeof

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request linux-native related to running meshtastic as daemon on native linux

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants