| Crates.io | aranet-core |
| lib.rs | aranet-core |
| version | 0.1.9 |
| created_at | 2026-01-16 19:34:06.265249+00 |
| updated_at | 2026-01-22 03:18:46.557584+00 |
| description | Core BLE library for Aranet environmental sensors |
| homepage | |
| repository | https://github.com/cameronrye/aranet |
| max_upload_size | |
| id | 2049143 |
| size | 414,891 |
Core BLE library for Aranet environmental sensors.
This crate provides low-level Bluetooth Low Energy (BLE) communication with Aranet sensors including the Aranet4, Aranet2, AranetRn+ (Radon), and Aranet Radiation devices.
| Device | Sensors |
|---|---|
| Aranet4 | CO₂, Temperature, Pressure, Humidity |
| Aranet2 | Temperature, Humidity |
| AranetRn+ | Radon (Bq/m³), Temperature, Pressure, Humidity |
| Aranet Radiation | Dose Rate (µSv/h), Total Dose (mSv) |
[dependencies]
aranet-core = "0.1"
use aranet_core::{Device, scan};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Scan for devices
let devices = scan::scan_for_devices().await?;
println!("Found {} devices", devices.len());
// Connect to a device
let device = Device::connect("Aranet4 12345").await?;
// Read current values
let reading = device.read_current().await?;
println!("CO₂: {} ppm", reading.co2);
println!("Temperature: {:.1}°C", reading.temperature);
// Read device info
let info = device.read_device_info().await?;
println!("Serial: {}", info.serial);
// Download history
let history = device.read_history().await?;
println!("Downloaded {} records", history.len());
Ok(())
}
Device identification varies by platform:
AA:BB:CC:DD:EE:FF)Run the examples with:
# Scan for nearby devices
cargo run --example scan_devices
# Read current sensor values
cargo run --example read_sensor
# Download measurement history
cargo run --example download_history
This crate is part of the aranet workspace:
| Crate | crates.io | Description |
|---|---|---|
| aranet-types | Shared types for sensor data | |
| aranet-store | Local data persistence | |
| aranet-cli | Command-line interface | |
| aranet-tui | Terminal UI dashboard | |
| aranet-service | - | Background collector and REST API |
| aranet-gui | - | Desktop GUI application |
| aranet-wasm | - | WebAssembly module |
MIT
Made with ❤️ by Cameron Rye