easycom
A Rust library implementing the Easycom antenna rotator control protocol, supporting the Yaesu GS-232A/B command set, Easycomm II, and Easycomm III.
Works on std targets (desktop, server) and no_std targets (embedded firmware).
Features
- Encode and decode all standard Easycom commands
- Optional XOR checksum support
- Incremental
Parserfor byte-at-a-time UART feeds - Generic
Transporttrait — plug in serial, TCP, or any I/O channel - Echo suppression and keep-alive (
?) handling no_stdcompatible with a fixed-size stack buffer
Quick start
Add to Cargo.toml:
[]
= "0.1"
Query position over TCP
use ;
use ;
use TcpStream;
;
Send rotator to home position over serial
use ;
// (SerialTransport setup omitted — see examples/serial_home.rs)
session.send.unwrap;
session.send.unwrap;
Supported protocols
The library understands three wire protocols and accepts commands from any of them interchangeably. Responses are encoded in the format matching the original query.
GS-232A/B (Yaesu)
| Variant | Wire frame | Description |
|---|---|---|
Azimuth(az) |
Annn\r |
Set azimuth (0–360°) |
Elevation(el) |
Ennn\r |
Set elevation (0–180°) |
AzimuthElevation { az, el } |
Wnnn nnn\r |
Set both simultaneously |
QueryPosition |
C\r |
Query current position |
QueryStatus |
GS\r |
Query device status (returns ST=…) |
Stop |
S\r |
Stop all movement |
KeepAlive |
?\r |
Keep-alive ping |
Offset { az, el } |
O±nnn±nnn\r |
Relative move |
Easycomm II
| Variant | Wire frame | Description |
|---|---|---|
Azimuth(az) |
AZnnn.n\n |
Set azimuth (0–360°) |
Elevation(el) |
ELnnn.n\n |
Set elevation (0–180°) |
AzimuthElevation { az, el } |
AZnnn.n ELnnn.n\n |
Set both simultaneously |
QueryAzimuth |
AZ\n |
Query current azimuth |
QueryElevation |
EL\n |
Query current elevation |
Stop |
SA SE\n |
Stop all axes |
Easycomm II is the protocol used by hamlib (rotctl -m 204).
Easycomm III
| Variant | Wire frame | Description |
|---|---|---|
VelocityLeft(speed) |
VL<speed>\n |
Velocity left (mdeg/s) |
VelocityRight(speed) |
VR<speed>\n |
Velocity right (mdeg/s) |
VelocityUp(speed) |
VU<speed>\n |
Velocity up (mdeg/s) |
VelocityDown(speed) |
VD<speed>\n |
Velocity down (mdeg/s) |
GetStatusRegister |
GS\n |
Get status register (bitmask) |
GetErrorRegister |
GE\n |
Get error register (bitmask) |
ReadConfig(reg) |
CR<reg>\n |
Read configuration register |
WriteConfig { register, value } |
CW<reg>,<val>\n |
Write configuration register |
Reset |
RESET\n |
Reset device |
Park |
PARK\n |
Move to park position |
Easycomm III extends II with velocity control, device status/error registers, and configuration read/write. Used by SatNOGS rotator firmware.
Feature flags
| Flag | Default | Description |
|---|---|---|
std |
yes | Enables Vec-based API and MockTransport |
alloc |
no | Heap support without full std |
Disable default features for no_std:
[]
= { = "0.1", = false }
Examples
# Send rotator to home via serial
# Poll position from a TCP adapter every 5 seconds
# Interactive CLI (TCP or serial)
Publishing to crates.io
- Update
authors,repository, andhomepageinCargo.toml - Log in:
cargo login - Dry run:
cargo publish --dry-run - Publish:
cargo publish
License
MIT — see LICENSE