| Crates.io | zwo_mount_control |
| lib.rs | zwo_mount_control |
| version | 0.2.1 |
| created_at | 2026-01-14 20:02:41.084387+00 |
| updated_at | 2026-01-14 22:54:16.691588+00 |
| description | Rust library for controlling ZWO AM5/AM3 telescope mounts with satellite tracking support |
| homepage | |
| repository | https://github.com/jmcguigs/zwo_mount_control |
| max_upload_size | |
| id | 2043658 |
| size | 268,048 |
A Rust library for controlling ZWO AM5/AM3 telescope mounts via serial communication, with built-in support for satellite tracking using the space-dust crate for TLE/SGP4 propagation.
Add to your Cargo.toml:
[dependencies]
zwo_mount_control = { git = "https://github.com/jmcguigs/zwo_mount_control" }
use zwo_mount_control::{SerialMount, Mount, EquatorialPosition};
// Connect via serial port (typical on Linux/Mac)
let mut mount = SerialMount::new("/dev/ttyUSB0");
mount.connect()?;
// Get current position
let pos = mount.get_position()?;
println!("RA: {}h, Dec: {}°", pos.ra, pos.dec);
// Slew to Vega
let vega = EquatorialPosition::from_hms_dms(18, 36, 56.0, 38, 47, 1.0);
mount.goto_equatorial(vega)?;
use zwo_mount_control::{MockMount, Mount, HorizontalPosition};
let mut mount = MockMount::new();
mount.connect()?;
mount.unpark()?;
// Set Alt-Az mode and slew to horizontal coordinates
mount.set_altaz_mode()?;
let target = HorizontalPosition::new(180.0, 45.0);
mount.goto_altaz(target)?;
use zwo_mount_control::{SatelliteTracker, MockMount, Mount};
// ISS TLE data
let line1 = "1 25544U 98067A 24001.50000000 .00016717 00000-0 10270-3 0 9025";
let line2 = "2 25544 51.6400 208.9163 0006703 35.6028 75.3281 15.49560066429339";
let mut tracker = SatelliteTracker::from_tle(line1, line2)?;
// Set observer location (Los Angeles)
tracker.set_observer_location(34.0522, -118.2437, 71.0);
// Find next pass
let pass = tracker.find_next_pass(chrono::Utc::now(), 24.0)?;
if let Some(p) = pass {
println!("Next pass: {}", p);
}
cargo run --example basic_control
This example demonstrates:
cargo run --example satellite_tracking -- 25544 # ISS
cargo run --example satellite_tracking -- 20580 # Hubble Space Telescope
The example fetches TLE data from Celestrak and demonstrates satellite position calculations and pass predictions.
| Module | Description |
|---|---|
mount |
Core Mount trait and mount status types |
serial_mount |
Serial port mount implementation for real hardware |
mock_mount |
Simulated mount for testing |
protocol |
Serial command definitions (LX200-compatible with ZWO extensions) |
coordinates |
Coordinate conversion utilities (RA/Dec, Az/Alt, HMS/DMS) |
satellite_tracker |
Satellite tracking with TLE propagation |
error |
Error types |
Used when mount is in equatorial mode (on wedge, polar aligned):
Used when mount is in Alt-Az mode (on tripod, no wedge):
dialout group)# Linux: Add user to dialout group for serial access
sudo usermod -a -G dialout $USER
# Log out and back in for changes to take effect
space-dust - Satellite propagation (SGP4/TLE)serialport - Serial communicationchrono - Date/time handlingthiserror - Error typesMIT
Contributions are welcome! Please feel free to submit issues and pull requests.