feat: support ERC rotator controllers through the existing GS-232A backend

An ERC (Easy Rotor Control, incl. ERC Mini) emulates Yaesu GS-232A/B, which is
exactly what the backend written for the microHAM ARCO already speaks — azimuth
out (Maaa), azimuth in (C), stop (S), which is the whole of what was asked for.
So this is two small gaps rather than a new backend:

  - Serial speed was hardcoded to 9600. An ARCO's virtual COM ignores it, but an
    ERC runs at whatever its own configuration sets, and a mismatch reads as a
    dead rotator. It is now selectable beside the COM port.
  - The entry was called "microHAM ARCO", so an ERC owner would never have found
    it. It is named after the PROTOCOL now: "GS-232A controller (microHAM ARCO,
    ERC…)".

The help text states the condition plainly in both languages, because it is the
one thing that will otherwise waste an evening: an ERC left on Hy-Gain DCU-1
speaks a different command set and simply will not answer.

Untested on hardware — I have no ERC here, and the GS-232 path itself is proven
on a real ARCO.
This commit is contained in:
2026-07-30 11:07:57 +02:00
parent 7759e09b4e
commit da886de189
6 changed files with 54 additions and 17 deletions
+14 -5
View File
@@ -178,7 +178,8 @@ const (
keyRotatorType = "rotator.type" // "pst" (PstRotator UDP) | "rotgenius" (4O3A native TCP) | "arco" (microHAM ARCO, GS-232A)
keyRotatorNum = "rotator.num" // Rotator Genius rotator index: 1 or 2
keyRotatorTransport = "rotator.transport" // arco: "tcp" (LAN) | "serial" (USB virtual COM)
keyRotatorComPort = "rotator.com_port" // arco serial transport
keyRotatorComPort = "rotator.com_port" // GS-232 serial transport
keyRotatorBaud = "rotator.baud" // GS-232 serial baud (an ERC needs it; an ARCO ignores it)
// Motorized antenna (Ultrabeam or SteppIR) — Hardware → Antenna. Keys keep the
// "ultrabeam." prefix for backward compatibility with configs saved before the
@@ -12550,8 +12551,11 @@ type RotatorSettings struct {
Port int `json:"port"` // default 12000 (pst) / 9006 (rotgenius) / 4001 (arco — must match the port set in ARCO's LAN CONTROL PROTOCOL)
HasElevation bool `json:"has_elevation"` // include EL in GoTo packets (PstRotator)
RotatorNum int `json:"rotator_num"` // Rotator Genius index: 1 or 2
Transport string `json:"transport"` // arco: "tcp" (LAN) | "serial" (USB virtual COM)
ComPort string `json:"com_port"` // arco serial transport
Transport string `json:"transport"` // GS-232 controller: "tcp" (LAN) | "serial" (COM)
ComPort string `json:"com_port"` // GS-232 serial transport
// Baud for the serial transport. An ARCO's virtual COM ignores it; an ERC runs
// at the rate set in its own configuration, so it has to be selectable.
Baud int `json:"baud"`
}
// GetRotatorSettings returns the persisted rotator config with defaults.
@@ -12562,7 +12566,7 @@ func (a *App) GetRotatorSettings() (RotatorSettings, error) {
}
m, err := a.settings.GetMany(a.ctx,
keyRotatorEnabled, keyRotatorHost, keyRotatorPort, keyRotatorHasElevation, keyRotatorType, keyRotatorNum,
keyRotatorTransport, keyRotatorComPort)
keyRotatorTransport, keyRotatorComPort, keyRotatorBaud)
if err != nil {
return out, err
}
@@ -12589,6 +12593,10 @@ func (a *App) GetRotatorSettings() (RotatorSettings, error) {
out.Transport = "serial"
}
out.ComPort = m[keyRotatorComPort]
out.Baud = 9600
if b, _ := strconv.Atoi(m[keyRotatorBaud]); b > 0 {
out.Baud = b
}
return out, nil
}
@@ -12622,6 +12630,7 @@ func (a *App) SaveRotatorSettings(s RotatorSettings) error {
keyRotatorNum: strconv.Itoa(s.RotatorNum),
keyRotatorTransport: s.Transport,
keyRotatorComPort: strings.TrimSpace(s.ComPort),
keyRotatorBaud: strconv.Itoa(s.Baud),
} {
if err := a.settings.Set(a.ctx, k, v); err != nil {
return err
@@ -12634,7 +12643,7 @@ func (a *App) SaveRotatorSettings(s RotatorSettings) error {
// USB virtual COM (serial) or the LAN CONTROL PROTOCOL TCP port.
func arcoClient(s RotatorSettings) *gs232.Client {
if s.Transport == "serial" {
return gs232.NewSerial(s.ComPort)
return gs232.NewSerial(s.ComPort, s.Baud)
}
return gs232.New(s.Host, s.Port)
}