Giter Club home page Giter Club logo

corsairmi-rs's Introduction

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

corsairmi-rs's People

Contributors

dependabot[bot] avatar newam avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.