fix: do not report a Yaesu as connected when it answers nothing
The seven minutes of reconnects in the operator's log turned out to be the radio switched off — no defect. But the log said otherwise: 20:14:42 yaesu: ID query failed (timeout) — continuing… 20:14:44 yaesu: connected on COM7 @ 38400 baud, model="FTDX101D" Opening the port was treated as connecting, and the model name was left over from the previous session, so a powered-down rig produced a line claiming it was connected as a named model. That is what sent me looking for a software fault. Connect now tracks whether ANY probe answered. If none did, it clears the stale model, says so in terms an operator can act on — is it powered on, is the CAT rate right — and returns an error so the reconnect loop keeps trying rather than believing it succeeded.
This commit is contained in:
+4
-2
@@ -11,7 +11,8 @@
|
||||
"The ADIF import option that fills your station fields from your profile also stamps your default confirmation statuses (paper QSL, LoTW, eQSL, Club Log, HRDLog, QRZ.com) on the ones the file leaves empty — it always did, but nothing said so, and a WSJT-X log carries almost none. Existing confirmations are never overwritten.",
|
||||
"QRZ.com confirmation download marked far too many QSOs as confirmed: it accepted the paper-QSL received flag, which you uploaded to QRZ yourself, as if it were a QRZ confirmation. Only QRZ own confirmation now counts — check the QRZ received column after your next download, as earlier ones may have set it wrongly.",
|
||||
"The Recent QSOs counter labels each of its three numbers — shown, matching the filter, and in the log — with thousands separators. \"Showing 10000 of 23683 matches · 28648 total\" read as if the filter had found more QSOs than the log holds.",
|
||||
"Switching the CAT backend back to a Yaesu no longer risks leaving the serial port held. Each reconnect opened a new handle without closing the previous one, and Windows opens a serial port exclusively, so the next attempt could fail with \"port busy\"."
|
||||
"Switching the CAT backend back to a Yaesu no longer risks leaving the serial port held. Each reconnect opened a new handle without closing the previous one, and Windows opens a serial port exclusively, so the next attempt could fail with \"port busy\".",
|
||||
"A Yaesu that is switched off is reported as such. Opening the serial port used to be logged as \"connected\", with the model name left over from the previous session, so a radio that was simply powered down looked like a software fault."
|
||||
],
|
||||
"fr": [
|
||||
"Cliquer sur un spot du cluster en écoutant sur le VFO SUB ne ramène plus la radio sur le VFO principal. La commande utilisée pour s'accorder agit par définition sur le VFO principal ; sur SUB, c'est désormais le VFO secondaire qui est écrit, sans toucher à la sélection.",
|
||||
@@ -22,7 +23,8 @@
|
||||
"L'option d'import ADIF qui remplit vos champs station depuis votre profil applique aussi vos statuts de confirmation par défaut (QSL papier, LoTW, eQSL, Club Log, HRDLog, QRZ.com) sur ceux que le fichier laisse vides — c'était déjà le cas, mais rien ne le disait, et un log WSJT-X n'en contient pratiquement aucun. Les confirmations existantes ne sont jamais écrasées.",
|
||||
"Le téléchargement des confirmations QRZ.com marquait beaucoup trop de QSO comme confirmés : il acceptait l'indicateur de QSL papier reçue — que vous avez vous-même envoyé à QRZ — comme une confirmation QRZ. Seule la confirmation propre à QRZ compte désormais ; vérifiez la colonne QRZ.com reçu après votre prochain téléchargement, les précédents ayant pu la remplir à tort.",
|
||||
"Le compteur des QSO récents nomme chacun de ses trois nombres — affichés, correspondant au filtre, et présents dans le log — avec des séparateurs de milliers. « Showing 10000 of 23683 matches · 28648 total » se lisait comme si le filtre trouvait plus de QSO que le log n'en contient.",
|
||||
"Repasser le backend CAT sur un Yaesu ne risque plus de laisser le port série occupé. Chaque reconnexion ouvrait une nouvelle poignée sans fermer la précédente, et Windows ouvre un port série en exclusivité : la tentative suivante pouvait échouer avec « port occupé »."
|
||||
"Repasser le backend CAT sur un Yaesu ne risque plus de laisser le port série occupé. Chaque reconnexion ouvrait une nouvelle poignée sans fermer la précédente, et Windows ouvre un port série en exclusivité : la tentative suivante pouvait échouer avec « port occupé ».",
|
||||
"Un Yaesu éteint est signalé comme tel. L'ouverture du port série était journalisée comme « connecté », avec le nom de modèle hérité de la session précédente : une radio simplement hors tension ressemblait à un défaut du logiciel."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -158,7 +158,9 @@ func (y *Yaesu) Connect() error {
|
||||
// a reply impossible to attribute — we poll instead, so the traffic is ours.
|
||||
_ = y.write("AI0;")
|
||||
|
||||
answered := false
|
||||
if id, err := y.ask("ID;"); err == nil {
|
||||
answered = true
|
||||
code := strings.TrimSuffix(strings.TrimPrefix(id, "ID"), ";")
|
||||
if name, ok := yaesuModels[code]; ok {
|
||||
y.model = name
|
||||
@@ -178,6 +180,7 @@ func (y *Yaesu) Connect() error {
|
||||
// VS is a weaker substitute that an FTDX101 answers with the main VFO even
|
||||
// when the operator has moved both RX and TX to sub.
|
||||
if r, err := y.ask("FR;"); err == nil && strings.HasPrefix(r, "FR") {
|
||||
answered = true
|
||||
y.rxVFOCmd = "FR"
|
||||
debugLog.Printf("yaesu: receive VFO is read through FR (answered %q)", r)
|
||||
} else {
|
||||
@@ -186,6 +189,7 @@ func (y *Yaesu) Connect() error {
|
||||
|
||||
for _, c := range []string{"ST", "FT"} {
|
||||
if r, err := y.ask(c + ";"); err == nil && strings.HasPrefix(r, c) {
|
||||
answered = true
|
||||
y.splitCmd = c
|
||||
debugLog.Printf("yaesu: split is read through %s (answered %q)", c, r)
|
||||
break
|
||||
@@ -194,6 +198,18 @@ func (y *Yaesu) Connect() error {
|
||||
if y.splitCmd == "" {
|
||||
debugLog.Printf("yaesu: neither ST; nor FT; answered — split will be reported as OFF. Send this log if the rig does have split.")
|
||||
}
|
||||
// A port that opens is not a rig that is there.
|
||||
//
|
||||
// The log used to announce "connected … model=FTDX101D" after every probe had
|
||||
// timed out, with the model left over from the previous session — an operator
|
||||
// whose radio was simply switched OFF got a line saying it was connected, and
|
||||
// the real cause took a log study to find. Say what actually happened.
|
||||
if !answered {
|
||||
y.model = ""
|
||||
debugLog.Printf("yaesu: %s opens at %d baud but the rig answers nothing — is it powered on, and is its CAT rate %d?",
|
||||
y.portName, y.baud, y.baud)
|
||||
return fmt.Errorf("yaesu: %s opened but the rig is not answering — check that it is switched on", y.portName)
|
||||
}
|
||||
debugLog.Printf("yaesu: connected on %s @ %d baud, model=%q", y.portName, y.baud, y.model)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user