feat(lora): surface FEM LNA Mode config on Device Config + Remote Admin (#3599)#3600
Conversation
…in (#3599) Adds support for Config.LoRaConfig.fem_lna_mode (FEM_LNA_Mode enum), a LoRa Front-End Module / Low Noise Amplifier mode option added in Meshtastic firmware v2.7.20 (meshtastic/firmware#9809). Users on amplified boards with an external LNA (e.g. certain RAK modules) can now configure it from the UI instead of the Python CLI. The protobuf field was already vendored (submodule at v2.7.25), so no submodule bump was needed. The enum (DISABLED=0, ENABLED=1, NOT_PRESENT=2, field tag 106) is added to shared constants in src/server/constants/meshtastic.ts. Surfaced on BOTH UI surfaces, end-to-end (read + display + write): - Device Configuration (LoRaConfigSection / ConfigurationTab): new "FEM LNA Mode" select; load, change-tracking, save payload, and config-import all carry femLnaMode. - Remote Admin (AdminCommandsTab): new "FEM LNA Mode" select; both remote-config read spots and the setLoRaConfig save payload carry femLnaMode. Both save paths funnel through protobufService.createSetLoRaConfigMessage, which now encodes femLnaMode for the local config-set and the remote admin message. proto3 elision (#3594): the zero enum value DISABLED is a real selectable mode, so it is read with a 0 default (never a non-zero ?? fallback) and the backend proto3-default block fills femLnaMode=0 when elided. Firmware gating: the control is shown unconditionally; writing 0 (DISABLED) is harmless on firmware that does not know field 106. Tests: protobufService.femLnaMode.test.ts round-trips the field (incl. the proto3-zero elision case); LoRaConfigSection.test.tsx covers the option constants and save payload. Full Vitest suite passes (7051 tests, 0 failures). Closes #3599 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011JEaCGwY9Wz8jeV4e22GW4
|
Claude finished @Yeraze's task —— View job PR Review: feat(lora): surface FEM LNA Mode configTasks:
Overall AssessmentThis is a clean, well-structured implementation of StrengthsProto3 Elision Handled Correctly — The zero-value Single Encode/Decode Path — Both Device Configuration and Remote Admin save paths funnel through Constants Properly Mirrored — Change Tracking Complete — Issues / ObservationsMinor:
|
Resolve migration-number collision: renumber the dead-drop migration 094_create_dead_drop -> 095_create_dead_drop (keeping main's 094_add_meshcore_node_favorite). Update migrations.ts registry, migrations.test.ts (count 95, last=create_dead_drop), and the migration's internal Postgres/MySQL export names. meshtasticManager.ts auto-merged cleanly (main's Yeraze#3593/Yeraze#3598/Yeraze#3600 changes + the mailbox dispatch coexist). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011JEaCGwY9Wz8jeV4e22GW4
Summary
Adds support for
Config.LoRaConfig.fem_lna_mode(theFEM_LNA_Modeenum), a LoRa Front-End Module (FEM) / Low Noise Amplifier (LNA) mode option added in Meshtastic firmware v2.7.20 (meshtastic/firmware#9809). Users on amplified boards with an external LNA (e.g. certain RAK modules) can now configure it from the MeshMonitor UI instead of dropping to the Python CLI.Closes #3599
Protobuf
The field was already vendored — the
protobufssubmodule onmainis at v2.7.25, which definesenum FEM_LNA_Mode { DISABLED = 0; ENABLED = 1; NOT_PRESENT = 2; }andFEM_LNA_Mode fem_lna_mode = 106;insideConfig.LoRaConfig. No submodule bump was required. The enum is mirrored into shared constants (src/server/constants/meshtastic.ts) per project rules — no magic numbers.Both surfaces (read + display + write)
LoRaConfigSection/ConfigurationTab): new "FEM LNA Mode" select. Load, change-tracking (save bar), save payload, and config-import all carryfemLnaMode.AdminCommandsTab): new "FEM LNA Mode" select. Both remote-config read spots and thesetLoRaConfigsave payload carryfemLnaMode.Both save paths funnel through
protobufService.createSetLoRaConfigMessage, which now encodesfemLnaModefor the local config-set and for the remote admin message.proto3 elision (#3594)
The zero enum value
DISABLEDis a real selectable mode, so:0default (never a non-zero?? fallback).femLnaMode = 0when the field is elided on the wire.Firmware gating
The control is shown unconditionally; writing
0(DISABLED) is harmless on older firmware that doesn't know field 106. No new gating framework was introduced.Tests
src/server/protobufService.femLnaMode.test.ts— round-tripsfemLnaModethrough encode/decode (ENABLED, NOT_PRESENT, and the proto3-zero DISABLED elision case, plus an absent-field case).src/components/configuration/LoRaConfigSection.test.tsx— covers theFEM_LNA_MODE_OPTIONSconstants and the save payload.tsc -p tsconfig.server.jsonand frontendtsc --noEmitshow no new errors (only the documented pre-existing baseline).🤖 Generated with Claude Code