Giter Site home page Giter Site logo

tpfancontrol-rs's People

Contributors

arnavion avatar smhmd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tpfancontrol-rs's Issues

Non-hardcoded temperature files

Invoking sudo tpfancontrol errors out:

Error: sysfs error with /sys/class/hwmon/hwmon2/temp1_input: No such file or directory (os error 2)

I don't understand the function of these monitors, but I'm pretty sure the better way to find these paths is to do:

$ find /sys/devices -type f -name "temp*_input"

In my device, the output is:

/sys/devices/platform/coretemp.0/hwmon/hwmon3/temp3_input
/sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_input
/sys/devices/platform/coretemp.0/hwmon/hwmon3/temp2_input
/sys/devices/virtual/thermal/thermal_zone0/hwmon0/temp1_input
/sys/devices/virtual/thermal/thermal_zone0/hwmon0/temp2_input

Thinkfan makes you include these in your config file, for instance. Other tools find them on their own.

My device is a ThinkPad L540 running Artix Linux using runit for init.

Run on start using systemd

I have created systemd service:

[Unit]
Description=tpfancontrol-rs

[Service]
Type=oneshot
User=root
Environment="RUST_BACKTRACE=1"
ExecStart=/home/kobi/github/tpfancontrol-rs/target/release/tpfancontrol &

[Install]
WantedBy=multi-user.target

however service fails with:

● tpfancontrol-rs.service - tpfancontrol-rs
     Loaded: loaded (/etc/systemd/system/tpfancontrol-rs.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2021-03-15 11:54:24 CET; 5min ago
    Process: 65399 ExecStart=/home/kobi/github/tpfancontrol-rs/target/release/tpfancontrol & (code=exited, status=101)
   Main PID: 65399 (code=exited, status=101)

bře 15 11:54:24 pop-os tpfancontrol[65399]:    2: core::result::unwrap_failed
bře 15 11:54:24 pop-os tpfancontrol[65399]:              at ./build/rustc-n7HJ8w/rustc-1.47.0+dfsg1+llvm/library/core/src/result.rs:1220
bře 15 11:54:24 pop-os tpfancontrol[65399]:    3: cursive::backend::termion::Backend::init
bře 15 11:54:24 pop-os tpfancontrol[65399]:    4: cursive::cursive::Cursive::termion
bře 15 11:54:24 pop-os tpfancontrol[65399]:    5: tpfancontrol::main
bře 15 11:54:24 pop-os tpfancontrol[65399]: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
bře 15 11:54:24 pop-os tpfancontrol[65399]: [6B blob data]
bře 15 11:54:24 pop-os systemd[1]: tpfancontrol-rs.service: Main process exited, code=exited, status=101/n/a
bře 15 11:54:24 pop-os systemd[1]: tpfancontrol-rs.service: Failed with result 'exit-code'.
bře 15 11:54:24 pop-os systemd[1]: Failed to start tpfancontrol-rs.

Can you please help me to run the binary at boot using systemd?

fan level not linked to fan speed

First of all: Well done, great tool! However, I have problems with mapping the fan levels.
At level = 0, the fan speed is ~2000 rpm, where the fan should actually be off, and for any level higher than 0, it is constantly 2400 rpm.
Any idea why this is?
I am running Linux Mint 20.2 (with Kernel 5.13.0-21) on a Thinkpad T495s.

Setup

What I did:

$ hub clone --depth 1 Arnavion/tpfancontrol-rs && cd tpfancontrol-rs/
$ cargo build # sudo ?
$ sudo mkdir /etc/tpfancontrol
$ sudo cp config.toml.example /etc/tpfancontrol/config.toml
$ cargo run # ran with error
$ sudo cargo run # ran with error as well

error:

Finished dev [unoptimized + debuginfo] target(s) in 0.03s
     Running `target/debug/tpfancontrol`
Error: sysfs error with /sys/class/hwmon/hwmon2/temp1_input: No such file or directory (os error 2)

Do I need to modify something in the conf file other than thresholds?

I'm not familiar with Rust; hopefully, I'm not doing something obviously wrong.

If I wanted to start tpfancontrol-rs on boot or login, should I run cargo run in the directory or there is a binary I'm missing? (could not find anything in ~/.cargo/bin)

Doesn't build

mismatched types
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/cursive-0.10.0/src/backend/termion.rs:222:46
|
222 | let terminal = AlternateScreen::from(MouseTerminal::from(
| _____________________________________^
223 | | ::std::io::stdout().into_raw_mode().unwrap(),
224 | | ));
| |
^ expected struct AlternateScreen, found struct MouseTerminal
|
= note: expected struct AlternateScreen<_>
found struct MouseTerminal<RawTerminal<Stdout>>

For more information about this error, try rustc --explain E0308.
error: could not compile cursive due to previous error
warning: build failed, waiting for other jobs to finish...

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.