From a89c6e0df8348dea8e4732d1183ad406ae55b895 Mon Sep 17 00:00:00 2001 From: rouggy Date: Wed, 29 Jul 2026 13:38:09 +0200 Subject: [PATCH] chore: sample the Yaesu meters throughout a transmission, not at its start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The one-shot survey fired as the transmission began and caught the meters still at rest — RM4=13 and everything else zero, which identifies nothing. And the operator's reading points the other way: the bar showing 81 tracks his 100 W, while the one labelled power sat at 8. What names a meter is which index FOLLOWS the power over a few seconds of steady carrier, so the survey now samples on every poll while transmitting, capped at a dozen lines. Two seconds of tune will settle it. Still not guessing at the mapping: the numbers will say which index is power and which is SWR on this radio, and it gets corrected then. --- internal/cat/yaesu.go | 5 +++-- internal/cat/yaesu_panel.go | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/internal/cat/yaesu.go b/internal/cat/yaesu.go index 6a2a946..8ba3415 100644 --- a/internal/cat/yaesu.go +++ b/internal/cat/yaesu.go @@ -104,8 +104,9 @@ type Yaesu struct { panelLoaded bool // Commands this rig answered "?;" to — asked once, then never again. unsupported map[string]bool - // metersSurveyed: the one-shot RM1..RM6 dump during the first transmission. - metersSurveyed bool + // metersLogged counts the RM1..RM6 samples taken during transmission, so the + // survey follows a real carrier instead of catching one instant of it. + metersLogged int } func NewYaesu(portName string, baud int, digital string) *Yaesu { diff --git a/internal/cat/yaesu_panel.go b/internal/cat/yaesu_panel.go index 07ab58a..daacc15 100644 --- a/internal/cat/yaesu_panel.go +++ b/internal/cat/yaesu_panel.go @@ -128,8 +128,12 @@ func (y *Yaesu) readPanel(mode string, split bool, txHz int64) { // of reading the wrong index (ALC, say) rather than of a scaling error. // Guessing again would just move the wrong number; this prints all six // once, and the log then says which is which on THIS radio. - if !y.metersSurveyed { - y.metersSurveyed = true + // Sampled on EVERY poll while transmitting, capped — one snapshot taken as + // the transmission starts catches the meters still at rest (RM4=13, the + // rest zero), which says nothing. What identifies a meter is which index + // TRACKS the power over a few seconds of steady carrier. + if y.metersLogged < 12 { + y.metersLogged++ raw := make([]string, 0, 6) for i := 1; i <= 6; i++ { cmd := fmt.Sprintf("RM%d;", i)