Skip to content

TunerModel: prefer direct TGXL autotune (port 9010) over firmware-routed command#2163

Merged
ten9876 merged 1 commit intomainfrom
aether/tgxl-direct-autotune
Apr 29, 2026
Merged

TunerModel: prefer direct TGXL autotune (port 9010) over firmware-routed command#2163
ten9876 merged 1 commit intomainfrom
aether/tgxl-direct-autotune

Conversation

@ten9876
Copy link
Copy Markdown
Owner

@ten9876 ten9876 commented Apr 29, 2026

Summary

When a direct TGXL connection (port 9010) is configured, sends the native autotune command directly to the TGXL instead of routing tgxl autotune handle=<H> through the radio's command channel. Falls back to the radio path when no direct connection is available.

Why

SmartSDR firmware 4.2 changed the radio↔TGXL handshake — users on both AetherSDR and SmartSDR report the TUNE button no longer works on TGXL after the upgrade. The direct-to-TGXL channel is independent of the radio's command stream and isn't affected, so this gives affected users a working path again without waiting on a firmware fix.

Protocol

Reverse-engineered from a 4O3A management-app pcap (reference/TGXL_TUNE.json):

T+0.820s   →TGXL    C437|autotune
T+0.823s   TGXL→    R437|0|                      ← ack code 0 = success
T+0.832s   TGXL→    S0|state ... tuning=1 ...    ← sweep begins
                    (TGXL keys radio via hardware interlock cable)
T+2.768s   TGXL→    S0|state ... tuning=0 relayC1=16 relayL=4 relayC2=8
                    ← sweep complete (~1.94 s for 14.291 MHz)

The TGXL drives radio PTT via its hardware interlock cable when it receives autotune, so the client doesn't need to key the radio. The existing stateUpdated / statusUpdated signals already deliver tuning= and swr= to TunerApplet, so the TUNING…→SWR readout UI feedback works unchanged.

Changes

22 insertions, 1 deletion.

Test plan

  • Build passes (verified locally)
  • On-air test with TGXL on firmware 4.2: configure direct TGXL IP in Radio Setup, press TUNE in the Tuner applet, confirm:
    • Radio keys at tune power (TGXL drives PTT)
    • Tuning…→SWR readout cycles correctly in the TUNE button
    • Final SWR is reasonable for the band/antenna
    • Logs show TunerModel::autoTune: using direct TGXL path
  • Fallback test (no direct connection): clear direct TGXL IP, press TUNE, confirm legacy tgxl autotune handle=<H> command still fires (or fails the same way it does on 4.2 today — this branch doesn't fix that case)
  • Regression test: manual relay adjust (C1/L/C2 stepper) and antenna switch (3x1 ANT1/2/3) still work — these share the direct connection but go through different commands

Risks

  • Users without a direct TGXL connection configured will still hit the firmware bug on 4.2 — they can work around it by configuring direct, or wait for a firmware fix.
  • In a Multi-Flex scenario, two clients firing native autotune simultaneously have no coordination (the native command takes no handle=). Acceptable; rare edge case.
  • If TGXL refuses autotune when state.active=0, we may need to send activate ant=<N> first. Capture didn't include a from-cold case — worth verifying during on-air test.

🤖 Generated with Claude Code

When a direct TGXL connection (port 9010) is available, send the native
`autotune` command directly to the TGXL instead of `tgxl autotune
handle=<H>` over the radio's command channel. Falls back to the radio
path when no direct connection is configured.

Reverse-engineered from a pcap of the 4O3A management app firing
autotune. Wire format: `C<seq>|autotune\n` to port 9010, ack
`R<seq>|0|`, then `state ... tuning=1 ...` push during sweep,
`state ... tuning=0 ...` push on completion. The TGXL drives radio
PTT via its hardware interlock cable, so no client-side keying is
needed and the existing tuning/SWR UI feedback path is unchanged.

Motivation: SmartSDR firmware 4.2 changed the radio↔TGXL handshake;
multiple users report the TUNE button no longer works on TGXL across
both AetherSDR and SmartSDR. The direct-to-TGXL path bypasses the
broken firmware command and restores tune for users with a direct
TGXL connection configured.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@ten9876 ten9876 requested a review from jensenpat as a code owner April 29, 2026 14:48
@ten9876 ten9876 enabled auto-merge (squash) April 29, 2026 14:49
@ten9876 ten9876 merged commit 940c526 into main Apr 29, 2026
4 checks passed
@ten9876 ten9876 deleted the aether/tgxl-direct-autotune branch April 29, 2026 14:57
ten9876 added a commit that referenced this pull request Apr 29, 2026
Hotfix release for SmartSDR firmware 4.2 TGXL TUNE regression.

- CMakeLists.txt / README.md / CLAUDE.md: 0.9.2 → 0.9.2.1
- CHANGELOG: v0.9.2.1 entry covering the TGXL fix (#2163) and the
  redactPii regex tightening
- WhatsNewData.cpp: regenerated from CHANGELOG
- main.cpp: redactPii IPv4 regex was matching the 4-component
  version string `0.9.2.1` and rendering it as `*.*.*. 1` in logs
  and support bundles.  Negative lookbehind/lookahead now skip
  quoted ("0.9.2.1") and v-prefixed (v0.9.2.1) version forms.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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.

1 participant