corsairmi

Crates.iocorsairmi
lib.rscorsairmi
version2.0.1+deprecated
sourcesrc
created_at2021-01-08 02:52:13.838654
updated_at2024-08-31 17:35:12.243071
descriptionRead data from Corsair RMi and HXi series power supplies.
homepagehttps://github.com/newAM/corsairmi-rs
repositoryhttps://github.com/newAM/corsairmi-rs
max_upload_size
id334126
size57,751
Alex Martens (newAM)

documentation

README

[!CAUTION] Deprecated Newer Linux kernels have a native driver for these power supplies.

crates.io docs.rs CI

corsairmi

Read data from Corsair RMi and HXi series power supplies.

This uses the Linux HIDRAW interface to communicate with the power supply.

This crate is based off of this implementation in C: notaz/corsairmi

Example

use corsairmi::PowerSupply;

let mut psu: PowerSupply = PowerSupply::open("/dev/hidraw5")?;
println!("Power consumption: {:.1} Watts", psu.input_power()?);

Features

An asynchronous implementation is available with the tokio feature flag.

udev rules

You will most likely want to update your udev rules so that you can access the power supply as a non superuser.

These are my udev rules, you will need to update the idProduct field for the product ID of your power supply, you can figure this value out with lsusb, or by reading the source.

Also note the value for idProduct must be lowercase hexadecimal.

# /etc/udev/rules.d/99-corsair.rules
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1b1c", ATTRS{idProduct}=="1c06", MODE="0666"

udev rules can be reloaded with sudo udevadm control --reload-rules && sudo udevadm trigger

Commit count: 34

cargo fmt