| Crates.io | rust-patlite-beacon |
| lib.rs | rust-patlite-beacon |
| version | 0.1.1 |
| created_at | 2025-09-11 00:57:47.494776+00 |
| updated_at | 2025-09-11 21:55:15.695287+00 |
| description | A Rust library and CLI tool for controlling USB PATLITE beacon devices |
| homepage | https://github.com/benburkhart1/rust-patlite-beacon |
| repository | https://github.com/benburkhart1/rust-patlite-beacon |
| max_upload_size | |
| id | 1833194 |
| size | 64,638 |
A Rust library and CLI tool for controlling USB PATLITE beacon devices.
cargo build --release
On Linux, you need to set up udev rules to access the USB beacon without root privileges:
Copy the provided udev rules file to your system:
sudo cp udev/99-patlite-beacon.rules /etc/udev/rules.d/
Reload the udev rules:
sudo udevadm control --reload-rules
sudo udevadm trigger
Disconnect and reconnect your USB beacon device.
After these steps, you should be able to run the beacon commands without sudo.
On macOS, you need to run the beacon commands with root privileges:
sudo cargo run -- --color red
Or if using the compiled binary:
sudo ./target/release/rust-beacon --color red
Set LED to red:
cargo run -- --color red
cargo run -- scan
cargo run -- light red on
cargo run -- light blue pattern1
cargo run -- buzzer sweep 3 # Play sweep sound 3 times
cargo run -- buzzer on 0 # Continuous buzzer
cargo run -- volume 5
cargo run -- buzzer-ex shining-star 2 7
cargo run -- touch-sensor
cargo run -- reset
cargo run -- setting on
cargo run -- setting off
You can also use shorthand options:
cargo run -- --color red --pattern pattern1
cargo run -- --buzzer sweep --count 3 --volume 5
use rust_patlite_beacon::{Beacon, LedColor, LedPattern};
fn main() -> anyhow::Result<()> {
let beacon = Beacon::open()?;
beacon.set_light(LedColor::Red, LedPattern::On)?;
Ok(())
}