A cross-platform Rust workspace for controlling the SkyRC MC5000 4-slot intelligent battery charger via Bluetooth Low Energy.
This project results from reverse‑engineering the SkyRC Android application's BLE protocol, with assistance from AI.
This workspace consists of three crates:
Core library implementing the MC5000 Bluetooth communication protocol.
# Use as a dependency
[dependencies]
mc5000-protocol = { path = "../mc5000-protocol" }Features:
- Bluetooth device scanning and connection
- Command encoding/decoding
- Status monitoring
- Charge configuration
Full-featured graphical interface for controlling the charger.
# Run the GUI
cargo run -p charger-controller
# or
./target/debug/charger-controllerFeatures:
- Real-time slot monitoring with graphs
- Visual configuration dialog
- Auto-charge mode with battery detection
- Data export to CSV
Console application for scripting and headless operation.
# Run the CLI
cargo run -p charger-controller-cli -- --help
# or
./target/debug/charger-cli --helpCommands:
scan- Scan for available devicesstatus [slot]- Get status of slotscharge <slot> [options]- Start chargingdischarge <slot> [options]- Start dischargingstop [slot]- Stop charging/discharging (all slots if no slot given)cycle <slot> [options]- Charge/discharge cycles for capacity testingrefresh <slot> [options]- Deep cycle restoration (NiMH/NiCd)break-in <slot> [options]- Conditioning cycles for new batteriesauto [slot]- Auto-detect chemistry and start chargingmonitor- Continuous slot monitoringdebug- Debug BLE communication and view raw notifications
| Chemistry | Target Voltage | Cutoff Voltage |
|---|---|---|
| Li-Ion | 4.20V | 3.20V |
| Li-Ion HV | 4.35V | 3.40V |
| LiFePO4 | 3.65V | 2.90V |
| NiMH | 1.65V | 0.90V |
| NiCd | 1.65V | 0.90V |
| eneloop | 1.65V | 0.90V |
| NiZn | 1.90V | 1.10V |
| RAM | 1.65V | 0.90V |
| LTO | 2.85V | 1.80V |
| Na-Ion | 4.00V | 2.00V |
- Charge (0x00) - Standard charging
- Storage (0x01) - Charge/discharge to storage voltage
- Discharge (0x02) - Discharge battery
- Cycle (0x03) - Charge-discharge cycle for capacity testing
- Refresh (0x04) - Deep cycle for NiMH/NiCd
- BreakIn (0x05) - New battery conditioning
# Build all crates
cargo build
# Build specific crate
cargo build -p mc5000-protocol
cargo build -p charger-controller
cargo build -p charger-controller-clicargo run -p charger-controller# Scan for devices
charger-cli scan
# Get all slot status
charger-cli status
# Get status of slot 2
charger-cli status 2
# Charge slot 3 with Li-Ion at 2000mA
charger-cli charge 3 --chemistry liion --current 2000
# Charge slot 1 with NiMH at 1000mA
charger-cli charge 1 --chemistry nimh --current 1000
# Discharge slot 2 with Li-Ion at 500mA
charger-cli discharge 2 --chemistry liion --current 500
# Run cycle mode on slot 4 (Li-Ion)
charger-cli cycle 4 --chemistry liion --current 2000
# Run refresh mode on slot 3 (NiMH)
charger-cli refresh 3 --chemistry nimh --current 400 --discharge-current 250
# Break-in new NiMH batteries in slot 1
charger-cli break-in 1 --chemistry nimh --current 300
# Auto-detect battery chemistry and start charging all slots
charger-cli auto
# Auto-detect and charge slot 2
charger-cli auto 2
# Stop slot 2
charger-cli stop 2
# Stop all slots
charger-cli stop
# Continuous monitoring
charger-cli monitorThe auto-charge feature automatically:
- Detects battery chemistry from voltage
- Starts charging at 100mA initial current
- Measures internal resistance
- Adjusts current based on:
min(capacity × 0.5C, 300mV/R, 3000mA)
# CLI
charger-cli auto
# Or in GUI, click the ⚡ Auto button- docs/PROTOCOL.md - BLE protocol specification
- Rust 1.70+
- btleplug (Bluetooth)
- iced 0.12 (GUI)
- clap 4.5 (CLI)
- tokio (async runtime)
# Run tests
cargo test
# Run with verbose output
MC5000_VERBOSE=1 cargo run -p charger-controller- GitHub Actions workflow:
.github/workflows/release.yml - Manual pre-release build: run the
build and releaseworkflow withworkflow_dispatch - Release build: publishing a GitHub release triggers the same workflow and uploads assets to the release
Generated assets are separated into:
mc5000-protocolcrate packagecharger-cliportable archives for Linux, Windows, and macOScharger-controllerportable archives for Linux and WindowsMC5000Charger.appzipped bundle andMC5000Charger.dmgfor macOS
Packaging metadata and auxiliary files live in packaging/, including the macOS bundling script at packaging/macos/create_app_bundle.sh.
MIT