hamlib/rigs/anytone
Matt 332d76b61f Rewrite AT-D578UVIII backend with dual-mode serial protocol support
Add runtime-selectable dual-mode operation to the AnyTone AT-D578UVIII
backend via a -C commode= config flag on the existing model 37001.

Default mode (commode=0) uses the direct serial mic protocol for PTT
with no handshake and no radio display lockout. COM mode (commode=1)
uses the BT-01 ADATA protocol for PTT, get/set frequency, get/set VFO,
and set clock — the radio displays "EXTERNAL CABLE MODE" while connected.

The keepalive thread checks transaction_active before sending so that
raw commands via rigctld's w interface pass through without collision,
enabling third-party software to use undocumented ADATA commands through
the driver's managed session.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-04 16:33:10 -04:00
..
anytone.c Rewrite AT-D578UVIII backend with dual-mode serial protocol support 2026-07-04 16:33:10 -04:00
anytone.h Rewrite AT-D578UVIII backend with dual-mode serial protocol support 2026-07-04 16:33:10 -04:00
d578.c Rewrite AT-D578UVIII backend with dual-mode serial protocol support 2026-07-04 16:33:10 -04:00
Makefile.am Remove old-fashioned and buggy Android.mk build system 2026-05-17 22:49:59 +08:00
README.md Rewrite AT-D578UVIII backend with dual-mode serial protocol support 2026-07-04 16:33:10 -04:00

AnyTone AT-D578UVIII Hamlib Backend

Driver for the AnyTone AT-D578UVIII (and AT-D578UV Pro) dual-band mobile radio.

Dual-mode operation

A single rig model (37001) supports two serial protocols via the -C commode= runtime flag:

Default (commode=0) — direct serial mic protocol:

  • PTT on/off (VARA, fldigi, etc.)
  • No handshake, no radio display lockout
  • Keys PTT on whichever VFO is selected — behaves like the physical mic

COM mode (commode=1) — BT-01 ADATA protocol:

  • PTT, get/set frequency, get/set VFO, set clock
  • Radio displays "EXTERNAL CABLE MODE" while connected
# PTT only (no lockout)
rigctl -m 37001 -s 115200 -r /dev/ttyUSB0

# Full control (locks display)
rigctl -m 37001 -C commode=1 -s 115200 -r /dev/ttyUSB0

COM mode frequency limitations

  • set_freq requires Channel A selected with VFO A in VFO mode (not MR/memory mode)
  • VFO B selected: get_freq returns VFO A's frequency; set_freq is refused
  • PTT works regardless of VFO/mode selection

Raw command passthrough

In COM mode, rigctld's w (send_cmd) interface can send arbitrary ADATA commands. The keepalive thread yields to raw commands automatically, so third-party software can use protocol features the backend doesn't yet implement natively.

Protocol notes

The radio exposes two protocols on 115200 8N1:

  • Direct mic: raw 0x06 keepalive, 0x41 PTT. No init, no lockout.
  • BT-01 ADATA: +ADATA:00,NNN\r\n framing. Requires COM MODE handshake.

Protocol analysis based on jrobertfisher/AT-D578UV-software-mic and firmware reverse engineering of the D578UV v1.21 and BT-01 v1.02 firmware images.